Skip to content

Instantly share code, notes, and snippets.

@cemo
Created February 26, 2014 09:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cemo/9236abe34d2b126242ad to your computer and use it in GitHub Desktop.
Save cemo/9236abe34d2b126242ad to your computer and use it in GitHub Desktop.
@Override
public void setAttribute(String name, Object value) {
synchronized (this){
Object attribute = getAttribute(name);
if(!Objects.equal(value, attribute) ){
super.setAttribute(name, value);
dirty = true;
}
}
}
@Override
public void removeAttribute(String name) {
synchronized (this){
Object attribute = getAttribute(name);
if(attribute != null){
super.removeAttribute(name);
dirty = true;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment