archaius icon indicating copy to clipboard operation
archaius copied to clipboard

PropertyListener check the previous value against the new one

Open eRfO opened this issue 7 years ago • 1 comments

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); } }

eRfO avatar Jun 15 '17 22:06 eRfO

Most likely I have implemented in the wrong way PollingResponse class, i will try to rewrite the logic.

eRfO avatar Jun 15 '17 22:06 eRfO