Bug 148567 - Boolean code flipper
Boolean code flipper
Status: RESOLVED FIXED
Product: java
Classification: Unclassified
Component: Refactoring
6.x
All All
: P3 (vote)
: 7.2
Assigned To: Jan Becicka
issues@java
: PLAN
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-09-28 03:07 UTC by janicki
Modified: 2011-12-12 14:22 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
:


Attachments

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
https://bitbucket.org/jlahoda/jackpot30/wiki/Home
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