Bug 24346 - Method declaration not found in field initializer
Summary: Method declaration not found in field initializer
Status: VERIFIED 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.1 M2   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-10-03 04:51 EDT by Jerome Lanneluc CLA
Modified: 2002-10-17 10:26 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jerome Lanneluc CLA 2002-10-03 04:51:18 EDT
Build 20021001

1. Create the following cu p/X.java:
package p;
public class X {
	public void bar() {
	}
	public Object x = new Object() {
		public void foo() {
		}
	};
}
2. Open the Java search dialog.
3. Search for method declaration of "foo"
Observe: None is found
Comment 1 Jerome Lanneluc CLA 2002-10-03 04:52:16 EDT
Removing the declaration of bar() makes it work.
Comment 2 Jerome Lanneluc CLA 2002-10-03 11:50:31 EDT
The HasLocalTypeMASK was not set on the field declaration and thus the "foo" 
reference was not added to the index.

This was due to a bug in the Parser that used to mark only method declarations 
and type declarations in Parser.markCurrentMethodWithLocalType(). Fixed this 
method and renamed it to markEnclosingMemberWithLocalType().
Comment 3 David Audel CLA 2002-10-17 10:26:54 EDT
Verified.