I am using java jsoup to create HTML DOM trees that I use Node.hashCode(). But I found that while traversing the DOM tree, there are many hash code collisions using the following code:
doc.traverse(new NodeVisitor(){
@Override
public void head(Node node, int depth) {
System.out.println("node hash: "+ node.hashCode());
}
@Override
public void tail(Node node, int depth) {
}
}
So, when this is done, I see many identical hash codes even in the first few outputs.
The hash codes are quite large and I do not expect such strange behavior. I used jsoup-1.8.1. Any input would be greatly appreciated, thanks.
source
share