Remove modifier reflection

Fixes #2484
This commit is contained in:
Jesse Boyd 2019-11-10 11:23:25 +00:00
parent ed588476e0
commit c155c65a8f
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
2 changed files with 4 additions and 8 deletions

View File

@ -365,12 +365,8 @@ public class Config {
* @throws NoSuchFieldException
* @throws IllegalAccessException
*/
private static void setAccessible(Field field)
throws NoSuchFieldException, IllegalAccessException {
private static void setAccessible(Field field) {
field.setAccessible(true);
Field modifiersField = Field.class.getDeclaredField("modifiers");
modifiersField.setAccessible(true);
modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL);
}
/**

View File

@ -16,10 +16,10 @@ public class Settings extends Config {
@Comment("These first 7 aren't configurable") // This is a comment
@Final // Indicates that this value isn't configurable
public static final String ISSUES = "https://github.com/IntellectualSites/PlotSquared/issues";
@Final public static final String SUGGESTION =
public static String ISSUES = "https://github.com/IntellectualSites/PlotSquared/issues";
@Final public static String SUGGESTION =
"https://github.com/IntellectualSites/PlotSquaredSuggestions";
@Final public static final String WIKI =
@Final public static String WIKI =
"https://github.com/IntellectualSites/PlotSquared/wiki";
@Final public static String DATE; // These values are set from P2 before loading
@Final public static String BUILD; // These values are set from P2 before loading