You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (!method.isAnnotationPresent(ConfigOptional.class)) {
88
96
thrownewInvalidConfigFileException("Variable in config (path: " + path + ") is required, but is not set");
89
97
}
90
98
99
+
returnnull;
100
+
}
101
+
102
+
if (method.getReturnType().equals(String.class) && this.automaticColorStrings) {
103
+
StringasString = (String) value;
91
104
if (!this.configuration.getCache().containsKey(path)) {
92
-
cache = ConversionUtils.fixColors(cache);
93
-
this.configuration.addToCache(path, cache);
105
+
asString = ConversionUtils.fixColors(asString);
106
+
this.configuration.addToCache(path, asString);
94
107
}
95
108
96
-
returncache;
109
+
returnasString;
97
110
}
98
111
99
112
if (TypeUtils.isSimpleType(method)) {
100
-
Objectvalue = this.configuration.get(path);
101
-
if (value == null) {
102
-
if (!method.isAnnotationPresent(ConfigOptional.class)) {
103
-
thrownewInvalidConfigFileException("Variable in config (path: " + path + ") is required, but is not set");
104
-
}
105
-
106
-
returnnull;
107
-
}
108
-
109
-
110
-
if (!method.getReturnType().isInstance(value) && !value.getClass().equals(TypeUtils.getWrapper(method.getReturnType()))) {
111
-
thrownewInvalidConfigException("Method " + method.getName() + " does not return type same as variable in config (path: " + path + "; " + value.getClass() + ")");
112
-
}
113
-
114
113
returnvalue;
115
114
}
116
115
117
-
if (method.getReturnType().isArray()) {
118
-
thrownewInvalidConfigException("Arrays are not supported, use Collection instead");
0 commit comments