| Summary: | NPE in BaseSlidableAnchor.hashCode | ||
|---|---|---|---|
| Product: | [Modeling] GMF-Runtime | Reporter: | Anthony Hunter <ahunter.eclipse> |
| Component: | General | Assignee: | Alex Boyko <aboyko> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | antoine |
| Version: | 2.2 | ||
| Target Milestone: | 2.2 | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
|
Description
Anthony Hunter
The isDefaultAnchor implementation of the BaseSlidableAnchor is actually just checking if relativeReference is null. We have completely overridden this and we calculate the defaultAnchor in a different manner. So we got in trouble with this implementation change. I believe you should just plainly check that the relativeReference is not null in the hashcode method rather than in the isDefaultAnchor method. If it is null, you should rely on the super method for hashcode. Anthony and Antoine, I agree that checking for isDefault() instead of a plain null check is incorrect, relies too much on the default implementation of #isDefault(). However, I feel that we should return the hash of the owner figure rather than super.hashCode(). Owner figure may cache anchors. (In reply to comment #2) > Anthony and Antoine, > > I agree that checking for isDefault() instead of a plain null check is > incorrect, relies too much on the default implementation of #isDefault(). > However, I feel that we should return the hash of the owner figure rather than > super.hashCode(). Owner figure may cache anchors. > OK, yes we can fix right away. Fixed for 2.2 as described [target cleanup] 2.2 RC was the original target milestone for this bug [GMF Restructure] Bug 319140 : product GMF and component Runtime was the original product and component for this bug |