Bug 91098

Summary: The Mark Occurrences feature does not mark all occurrences
Product: [Eclipse Project] JDT Reporter: Cyril Adrian <cyril.adrian>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: CLOSED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: daniel_megert
Version: 3.1   
Target Milestone: 3.1 M7   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Cyril Adrian CLA 2005-04-12 06:07:07 EDT
The precise test case is the following:

String a;
String[] b;
String[][] c;

Put the cursor on String or String[]. All occurrences of String get highlighted.
Now put the cursor on String[][]. No occurrence of String is highlighted. It
looks like there is a missing loop when removing square brackets ;o)

I use 3.1M6.

Best regards,

Cyril
Comment 1 Dani Megert CLA 2005-04-13 06:32:41 EDT
The important thing is to have this as variable declarations - it works for
field declarations:

public class Test {
	String fa; <- works
	String[] fb; <- works
	String[][] fc; <- works
	String[][][] fd; <- works
	
	void foo() {
		String a; <- works
		String[] b; <- works
		String[][] c; <- DOES NOT WORK
		String[][][] d; <- DOES NOT WORK
	}
}

Same behavior in 3.0. It seems that the bindings are not considered equal.

Moving to J Core for comment.
Comment 2 Olivier Thomann CLA 2005-04-13 10:33:18 EDT
I will investigate.
Comment 3 Olivier Thomann CLA 2005-04-13 11:33:29 EDT
The bug seems to come from wrong positions in the node for:
		String[][] c;
		String[][][] d;

The component types have no positions. I am investigating a fix.
Comment 4 Olivier Thomann CLA 2005-04-13 12:38:43 EDT
The problem did come from missing positions.
Fixed and released in HEAD.
Regression tests added in
org.eclipse.jdt.core.tests.dom.ASTConverterTestAST3_2.test0603/0604.
Comment 5 Maxime Daniel CLA 2005-05-13 06:52:43 EDT
Verified for 3.1 M7 using build I20050512-2035 + jdt.core HEAD.
Comment 6 Cyril Adrian CLA 2005-05-17 04:49:02 EDT
It works. Thank you very much :-)

Best regards,

Cyril