archaius
archaius copied to clipboard
PropertyListener check the previous value against the new one
Hi, i tried to implement a property listener to observe the changing in a String property, but the listener is invoked also when the new value is the same of the previous. I see the source code and at the line 174 of DefaultPropertyContainer.java class there is a compare between instances instead of the value, is there a reason?
if (prev != value) { if (last.compareAndSet(prev, value)) { listener.onChange(value); } }
Most likely I have implemented in the wrong way PollingResponse class, i will try to rewrite the logic.