diff --git a/archaius2-core/src/main/java/com/netflix/archaius/DefaultPropertyFactory.java b/archaius2-core/src/main/java/com/netflix/archaius/DefaultPropertyFactory.java index 1c82c90d..cb86d91f 100644 --- a/archaius2-core/src/main/java/com/netflix/archaius/DefaultPropertyFactory.java +++ b/archaius2-core/src/main/java/com/netflix/archaius/DefaultPropertyFactory.java @@ -28,8 +28,7 @@ public class DefaultPropertyFactory implements PropertyFactory, ConfigListener { /** * Create a Property factory that is attached to a specific config - * @param config - * @return + * @param config The source of configuration for this factory. */ public static DefaultPropertyFactory from(final Config config) { return new DefaultPropertyFactory(config); @@ -64,6 +63,8 @@ public DefaultPropertyFactory(Config config) { } @Override + @Deprecated + @SuppressWarnings("deprecation") public PropertyContainer getProperty(String propName) { return new PropertyContainer() { @Override @@ -130,7 +131,7 @@ public Property asType(Function mapper, String defaultValue) { try { return mapper.apply(value); } catch (Exception e) { - LOG.warn("Invalid value '{}' for property '{}'", propName, value); + LOG.error("Invalid value '{}' for property '{}'. Will return the default instead.", propName, value); } } @@ -216,7 +217,7 @@ public T get() { try { newValue = supplier.get(); } catch (Exception e) { - LOG.warn("Unable to get current version of property '{}'", keyAndType.key, e); + LOG.error("Unable to get current version of property '{}'", keyAndType.key, e); } if (cache.compareAndSet(currentValue, newValue, cacheVersion, latestVersion)) { @@ -260,16 +261,18 @@ public synchronized void run() { @Deprecated @Override + @SuppressWarnings("deprecation") public void addListener(PropertyListener listener) { oldSubscriptions.put(listener, onChange(listener)); } /** * Remove a listener previously registered by calling addListener - * @param listener + * @param listener The listener to be removed */ @Deprecated @Override + @SuppressWarnings("deprecation") public void removeListener(PropertyListener listener) { Subscription subscription = oldSubscriptions.remove(listener); if (subscription != null) {