DescriptionUnder the previous WrappedTreeNode.equals(), the tree for
"System.out.println" would be considered equal to subtree for just
"System.out" because they have the same start position (right before
"System"), same kind (MEMBER_SELECT), and same tag (SELECT).
This commit changes it to also take into account the tree's "preferred
position", which should be more unique. E.g., for
"System.out.println" the preferred position is the second dot, while
for the subtree "System.out" it's the first dot.
Additionally, this commit adds a runtime check to WrappedTreeMap's
constructor to detect collisions so we don't risk silently returning
the wrong end positions.
Fixes issue 200.
Patch Set 1 #
Total comments: 2
Patch Set 2 : Tweak comment #MessagesTotal messages: 4
|