Bug 6542 - extract method: incorrect error message
Summary: extract method: incorrect error message
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 M1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-12-04 08:07 EST by Adam Kiezun CLA
Modified: 2002-01-14 10:37 EST (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 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