/**@inheritDoc*/ @Override public boolean equals (Object other) { if (other instanceof ElementHandle) { return signatureEquals((ElementHandle)other); } return false; }
public boolean equalsHandle(Delegate obj) { ElementDelegate other = (ElementDelegate) obj; return el.signatureEquals(other.el) && cpInfo.equals(other.cpInfo); }
/** * Tests if the handle has this same signature as the parameter. * The handles has the same signatures if it is resolved into the same * element in the same {@link javax.tools.JavaCompiler} task, but may be resolved into * the different {@link Element} in the different {@link javax.tools.JavaCompiler} task. * @param element to be checked * @return true if this handle resolves into the same {@link Element} * in the same {@link javax.tools.JavaCompiler} task. */ public boolean signatureEquals (@NonNull final T element) { final ElementKind ek = element.getKind(); final ElementKind thisKind = getKind(); if ((ek != thisKind) && !(thisKind == ElementKind.OTHER && (ek.isClass() || ek.isInterface()))) { return false; } final ElementHandle<T> handle = create (element); return signatureEquals (handle); }