@Override public boolean satisfies(TypeDeclaration type) { if (type.equals(TypeDeclaration.this)) { return false; } else { Declaration dm = type.getDirectMember(member.getName(), signature, false); return dm != null && dm.equals(member); } }
private boolean isMember(Declaration dec, List<TypeDeclaration> visited) { if (visited.contains(this)) { return false; } visited.add(this); for (Declaration member : getMembers()) { if (dec.equals(member)) { return true; } } for (TypeDeclaration t : getSatisfiedTypeDeclarations()) { if (t.isMember(dec, visited)) { return true; } } TypeDeclaration et = getExtendedTypeDeclaration(); if (et != null) { if (et.isMember(dec, visited)) { return true; } } return false; }
static boolean equals(Declaration d1, Declaration d2) { return d1 == d2 || (d1 != null && d1.equals(d2)); }