Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PropertyListener check the previous value against the new one #495

Open
eRfO opened this issue Jun 15, 2017 · 1 comment
Open

PropertyListener check the previous value against the new one #495

eRfO opened this issue Jun 15, 2017 · 1 comment
Labels

Comments

@eRfO
Copy link

eRfO commented Jun 15, 2017

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
Copy link
Author

eRfO commented Jun 15, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants