Bug 538518 - [extract local] variable replace all occurrences only in nearest enclosing block
Summary: [extract local] variable replace all occurrences only in nearest enclosing block
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.9   Edit
Hardware: All All
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-03 00:10 EDT by Ori Marko CLA
Modified: 2018-09-03 02:24 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ori Marko CLA 2018-09-03 00:10:48 EDT
I want an option to extract local variable only in nearest enclosing block, for example in the following the code, allow to change only inside if statements:

    if (myState.equals(STATE_ONE){
      if (myObj.getStatus() == ONE || myObj.getStatus() == TWO ) {
      }
      myObj.changeMe();
    }
    if (myObj.getStatus() == THREE || myObj.getStatus() == FOUR) {
    }
    myObj.changeMe2();
Comment 1 Holger Voormann CLA 2018-09-03 02:24:26 EDT
First asked on Stack Overflow: https://stackoverflow.com/q/52137330