Bug 87777 - Bindings.isEqualTo returns false for equal bindings
Summary: Bindings.isEqualTo returns false for equal bindings
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M6   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-11 10:35 EST by Dirk Baeumer CLA
Modified: 2005-03-30 23:24 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 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