@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((node == null) ? 0 : node.hashCode()); return result; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; OffendingNodeWarning other = (OffendingNodeWarning) obj; if (node == null) { if (other.node != null) return false; } else if (!node.equals(other.node)) return false; return true; }
@Override public String toString() { String pv = "null"; if (previous != null) { pv = previous.getNodeName(); if (previous.isNodeType(AstNode.NT_TEXT)) { pv = ((Text) previous).getContent(); if (pv.length() > 16) { pv = pv.substring(pv.length() - (16 - 4)); pv = "... " + pv; } } pv = '"' + pv + '"'; } String pf = "-"; if (prefix != null) pf = '"' + prefix.getContent() + '"'; return String.format("LineEntry(%s, %s, %d)", pv, pf, tickCount); }
private static Span makeSpan(AstNode node) { return new Span(node.getNativeLocation(), WikitextPrinter.print(node)); }