Skip to content

Commit

Permalink
Fixes #43 - useless Jaxen XPath.equals().
Browse files Browse the repository at this point in the history
Remov hashCode and equals() methods testing just the XPath string is too naive.
  • Loading branch information
rolfl committed Dec 6, 2011
1 parent f57eb10 commit ed58a7b
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions core/src/java/org/jdom2/xpath/jaxen/JDOMXPath.java
Original file line number Diff line number Diff line change
Expand Up @@ -337,23 +337,7 @@ private void setXPath(String expr) throws JDOMException {

@Override
public String toString() {
return (xPath.toString());
}

@Override
public boolean equals(Object o) {
if (o instanceof JDOMXPath) {
JDOMXPath x = (JDOMXPath)o;

return (super.equals(o) &&
xPath.toString().equals(x.xPath.toString()));
}
return false;
}

@Override
public int hashCode() {
return xPath.hashCode();
return (String.format("[XPath: %s]", xPath.toString()));
}

}
Expand Down

0 comments on commit ed58a7b

Please sign in to comment.