| Summary: | ASTMatcher comparing Long variables declares differences | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Johannes Tietje <johannes.tietje> | ||||
| Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> | ||||
| Status: | VERIFIED WONTFIX | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | amj87.iitr, Olivier_Thomann | ||||
| Version: | 3.7 | ||||||
| Target Milestone: | 3.7 RC1 | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Johannes Tietje
Created attachment 194563 [details]
Test project to reproduce the bug.
You should replace your ASTMatcher with your own implementation if you want to match 1l with 1L.
Something like this would work:
ASTMatcher matcher = new ASTMatcher(true) {
@Override
public boolean match(NumberLiteral node, Object other) {
if (!(other instanceof NumberLiteral)) {
return false;
}
NumberLiteral o = (NumberLiteral) other;
return safeEquals(
node.getToken().toLowerCase(),
o.getToken().toLowerCase());
}
};
By default, the ASTMatcher is matching 1:1. So only identical nodes are reported as matching.
For example, 0x01 doesn't match with 1.
Closing as WONTFIX.
Let me know if you have any questions.
Verified for 3.7RC1. |