Community
Participate
Working Groups
I200411010800 (probably already in 2.1.2, see bug 47418) class MyClass { MyClass(int a, int b) { } void take(MyClass mc) { } void run() { take( new MyClass(1, 2) ); // space in ") )" is in match } } - Search for references to constructor MyClass(int a, int b). => Result is "new MyClass(1, 2) " (including the space!) => Expected: "new MyClass(1, 2)" This leads to a problem when we try to find the ASTNode for this SearchMatch.
This is not a search bug while reporting the match. Match length comes from the compiler ASTNode AllocationExpression which matches the pattern.
Created attachment 16094 [details] This patch to fixes the problem... Just store rParenPos instead of scanner.currentPosition-1 while consuming ClassBodyopt...
So this is maybe the same as bug 79239.
*** Bug 79239 has been marked as a duplicate of this bug. ***
Fixed. Now AllocationExpression rightly lengthes to its own closing parenthesis. [jdt-core-internal] Test cases added JavaSearchTest#testConstructorReferenceBug77388()
Olivier, may you verify that this fix is OK please, thx?
Verified.
Verified in 200412140800