Skip to content
This repository has been archived by the owner on Jan 26, 2019. It is now read-only.

Commit

Permalink
More config woes
Browse files Browse the repository at this point in the history
  • Loading branch information
robotia committed Mar 24, 2016
1 parent 3ff8827 commit 4faff5e
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

public class CauldronConfig extends ConfigBase
{
private String HEADER = "This is the main configuration file for Cauldron.\n"
private final String HEADER = "This is the main configuration file for Cauldron.\n"
+ "\n"
+ "If you need help with the configuration or have any questions related to Cauldron,\n"
+ "join us at the IRC or drop by our forums and leave a post.\n"
Expand Down Expand Up @@ -89,16 +89,19 @@ public CauldronConfig(String fileName, String commandName)

public void init()
{
Setting setting = null;
for(Field f : this.getClass().getDeclaredFields())
for(Field f : this.getClass().getFields())
{
if(Modifier.isFinal(f.getModifiers()) && f.getType().isInstance(Setting.class))
if(Modifier.isFinal(f.getModifiers()) && Modifier.isPublic(f.getModifiers()) && !Modifier.isStatic(f.getModifiers()))
{
try
{
setting = (Setting) f.get(this);
Setting setting = (Setting) f.get(this);
if(setting == null) continue;
settings.put(setting.path, setting);
}
catch (ClassCastException e)
{

}
catch(Throwable t)
{
Expand Down

0 comments on commit 4faff5e

Please sign in to comment.