Bug 6542

Summary: extract method: incorrect error message
Product: [Eclipse Project] JDT Reporter: Adam Kiezun <akiezun>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: dirk_baeumer
Version: 2.0   
Target Milestone: 2.0 M1   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Adam Kiezun CLA 2001-12-04 08:07:05 EST
i have 2 cus:
A.java
package p;

public class A {
	private class Inner{
		private static final int PREVIEW_ID= I.I+ 1;
		void m(){
			/*[*/m();/*]*/
		}
	}
}

I.java
package p;
public interface I{
	int I= 0;
}

try extracting the selected fragment in A::m()
you get a dialog saying that there is a compilation error, which is incorrect.
Comment 1 Dirk Baeumer CLA 2001-12-04 10:25:25 EST
I suspect this is because we are building the AST using the Java Model as a 
lookup environment. The Java model doesn't contain any constant definition so 
the AST can't correctly resolve it and produces an error. 

Philippe, do we have to move this error to flow analysis too, as we did with 
the switch statement ?
Comment 2 Philipe Mulet CLA 2001-12-05 07:28:58 EST
Yes, this is a similar problem, and yes we could defer the error reporting.
I'll take this one on our side.
Comment 3 Philipe Mulet CLA 2001-12-05 07:34:42 EST
Fixed in latest