Bug 132442 - [Refactoring] Extract local variable doesn't handle scope correctly
Summary: [Refactoring] Extract local variable doesn't handle scope correctly
Status: RESOLVED DUPLICATE of bug 27740
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-18 01:04 EST by Hosam CLA
Modified: 2006-03-22 05:11 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hosam CLA 2006-03-18 01:04:20 EST
(Using Eclipse Version: 3.2.0 Build id: I20060223-1656)
Here is a minimal case to reproduce:

// start of code
int i = 0;
for(; arr[i] != 0; ++i) {
   int c = arr[i];
}
// end of code

Select "arr[i]" and choose to extract a local variable. The newly declared variable is declared outside the loop, which causes a logical error.
Comment 1 Markus Keller CLA 2006-03-22 05:11:55 EST

*** This bug has been marked as a duplicate of 27740 ***