@@ -28,8 +28,7 @@ public class DefaultPropertyFactory implements PropertyFactory, ConfigListener {
28
28
29
29
/**
30
30
* Create a Property factory that is attached to a specific config
31
- * @param config
32
- * @return
31
+ * @param config The source of configuration for this factory.
33
32
*/
34
33
public static DefaultPropertyFactory from (final Config config ) {
35
34
return new DefaultPropertyFactory (config );
@@ -64,6 +63,8 @@ public DefaultPropertyFactory(Config config) {
64
63
}
65
64
66
65
@ Override
66
+ @ Deprecated
67
+ @ SuppressWarnings ("deprecation" )
67
68
public PropertyContainer getProperty (String propName ) {
68
69
return new PropertyContainer () {
69
70
@ Override
@@ -130,7 +131,7 @@ public <T> Property<T> asType(Function<String, T> mapper, String defaultValue) {
130
131
try {
131
132
return mapper .apply (value );
132
133
} catch (Exception e ) {
133
- LOG .warn ("Invalid value '{}' for property '{}'" , propName , value );
134
+ LOG .error ("Invalid value '{}' for property '{}'. Will return the default instead. " , propName , value );
134
135
}
135
136
}
136
137
@@ -216,7 +217,7 @@ public T get() {
216
217
try {
217
218
newValue = supplier .get ();
218
219
} catch (Exception e ) {
219
- LOG .warn ("Unable to get current version of property '{}'" , keyAndType .key , e );
220
+ LOG .error ("Unable to get current version of property '{}'" , keyAndType .key , e );
220
221
}
221
222
222
223
if (cache .compareAndSet (currentValue , newValue , cacheVersion , latestVersion )) {
@@ -260,16 +261,18 @@ public synchronized void run() {
260
261
261
262
@ Deprecated
262
263
@ Override
264
+ @ SuppressWarnings ("deprecation" )
263
265
public void addListener (PropertyListener <T > listener ) {
264
266
oldSubscriptions .put (listener , onChange (listener ));
265
267
}
266
268
267
269
/**
268
270
* Remove a listener previously registered by calling addListener
269
- * @param listener
271
+ * @param listener The listener to be removed
270
272
*/
271
273
@ Deprecated
272
274
@ Override
275
+ @ SuppressWarnings ("deprecation" )
273
276
public void removeListener (PropertyListener <T > listener ) {
274
277
Subscription subscription = oldSubscriptions .remove (listener );
275
278
if (subscription != null ) {
0 commit comments