| Summary: | "Invert boolean" [refactoring] [quick assist] | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Magnus Ihse Bursie <magnus.ihse.bursie> |
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
| Status: | RESOLVED WONTFIX | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | akiezun |
| Version: | 2.0 | Keywords: | helpwanted |
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
Time permitted for 2.1 could be a quick assist as well. Chaning state from assigned later to resolved later. Assigned later got introduced by the last bug conversion and is not a supported Eclipse bug state. As of now 'LATER' and 'REMIND' resolutions are no longer supported. Please reopen this bug if it is still valid for you. |
Often, you find that you have defined the boolean to default to the "wrong" state. Like in this code snippet: boolean isClosed = false; while (!isClosed) { // process } In this case, the code would be more easy to read if it was changed to boolean isOpen = true; while (isOpen) { // process } This code is of course very simple, but in more complex systems this kind of change can be of significant help. The refactoring should do the following: ask for a new name for the boolean variable, and invert (and of course simplify) all expressions with this variable.