Community
Participate
Working Groups
Build ID: M20080911-1700 IntelliJ IDEA 8 offers a helpful refactoring that moves the declaration of an existing local variable when the variable is used outside its scope. For example: if (list.isEmpty()) { boolean empty = true; //... } if (empty) { ... } The compilation problem caused by 'empty' being used in the second if statement offers a number of quick-fixes, but moving the declaration into scope is not currently among them. The proposed refactoring should move the declaration in front of the first if block but should leave the assignment where it was. It might also be necessary to add a default initialization for the declaration: boolean empty = false; if (list.isEmpty()) { empty = true; //... } if (empty) { ... } This refactoring would be slightly different from most of the other existing refactorings because it also searches other scopes in addition to the current scope to come up with a content assist suggestion.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.