Bug 87777

Summary: Bindings.isEqualTo returns false for equal bindings
Product: [Eclipse Project] JDT Reporter: Dirk Baeumer <dirk_baeumer>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: markus.kell.r
Version: 3.1   
Target Milestone: 3.1 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Dirk Baeumer CLA 2005-03-11 10:35:39 EST
xy/Try.java:
package xy;
public class Try {
    void hello() {
        C.world();
    }
}

xy/C.java:
package xy;
class C {
    public static void world() {
        System.out.println("x");
    }
}

Create two isolated ASTs.

Compare the normalized binding of C#world with the one from the invocation
C.world() in Try#hello returns false using isEqualTo. 

I normalized both binding first by calling getMethodDeclaration.

The reason for the mismatch is that the type bindings for the declaring types
have different modifiers.
Comment 1 Olivier Thomann CLA 2005-03-11 12:41:45 EST
The problem comes from the fact that I should not directly compare modifiers. I
should mask the modifiers with AccJustFlags. In this case, one of the declaring
class of the method was not resolved. This ended up with the modifiers still
containing the AccUnresolved bit.
Comment 2 Olivier Thomann CLA 2005-03-11 12:44:44 EST
Fixed and released in HEAD.
Regression test in ASTConverterTestAST3_2.test0600.
Comment 3 Olivier Thomann CLA 2005-03-30 23:24:28 EST
Verified in 20050330-0500