Posted By

guetux on 05/29/09


Tagged

java eclipse boolean overhead


Versions (?)

Boolean fun from eclipse project


 / Published in: Java
 

i love those ternary expressions, they really make things clear, don't they? found in org.eclipse.jface.action.Action

  1. public void setEnabled(boolean enabled) {
  2. if (enabled != this.enabled) {
  3. Boolean oldVal = this.enabled ? Boolean.TRUE : Boolean.FALSE;
  4. Boolean newVal = enabled ? Boolean.TRUE : Boolean.FALSE;
  5. this.enabled = enabled;
  6. firePropertyChange(ENABLED, oldVal, newVal);
  7. }
  8. }

Report this snippet  

You need to login to post a comment.