Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 148567 - Boolean code flipper
Boolean code flipper
Product: java
Classification: Unclassified
Component: Refactoring
All All
: P3 (vote)
: 7.2
Assigned To: Jan Becicka
Depends on:
  Show dependency treegraph
Reported: 2008-09-28 03:07 UTC by janicki
Modified: 2011-12-12 14:22 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description janicki 2008-09-28 03:07:24 UTC
Sometimes I decide to flip the logic of a boolean variable.  For example, I may want to rename "isDisabled" to "isEnabled".  I think it would be a neat feature to 
automatically search the code for usages of that boolean, then carefully flip the logic... adding or removing a '!' where necessary.  Maybe this could be 
integrated into the "rename" feature as an option when it detects you're renaming a boolean?

In general I think it's always best to name booleans in the "positive" sense, but even I sometimes forget and need to fix it later.
Comment 1 Jan Becicka 2011-01-13 13:26:55 UTC
try to use jackpot
Comment 2 Jan Becicka 2011-12-12 14:22:00 UTC
Initial revision pushed to trunk

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo