Closed psygate closed 7 years ago
Would changing this provide any advantage? It's obvious what it's doing and performance isn't an argument here either.
Not really. The compiler will just convert it to a StringBuilder anyway, so efficiency isn't an argument.
It's more a semantic "correctness" -- so not a high priority. I could lower it.
It does some additional checks and path normalization, which can enhance the compatibility with different file systems than NTFS, FAT and Ext. It's not exactly the most urgend thing ever, but see here: http://www.docjar.com/html/api/java/io/File.java.html Line 289.
This is a very weird approach anyway. Instead of hardcoding parsing from a file named "config.yml", and reimplementing a getter for every primitive, spigot's default config system should probably just be used in that class. The whole loading of the config and exception catching could be replaced with
Bastion plugin = Bastion.getPlugin();
plugin.saveDefaultConfig();
plugin.reloadConfig();
config = plugin.getConfig();
Quite so; I see no reason not to correct it to use the Spigot loader system.
ConfigManager uses String concatination instead of the File(File parent, String child) constructor