Returns true if the specified object represents an annotation that is logically equivalent to this one.


@param object Object to inspect.

@return true if same annnotationType and all attributes are equal, else false.
778892
private boolean annotationEquals(Object object) {
        if (object == null 
                    || !(object instanceof Annotation) 
                    || !annotationType.equals(((Annotation) object).annotationType())) {
                     return false;
         }
        
        for (Map.Entry<String, Method> entry : attributes.entrySet()) {
            String methodName = entry.getKey();
            Method method = entry.getValue();
            Object otherValue;
            try {
                otherValue = method.invoke(object);
                Object value = attributeData.get(methodName);
                if (!attributeEquals(value, otherValue)) {
                    return false;
                }
            } catch (Exception e) {
               return false;
            } 
           
        }
        return true;
    }
230152
@Override
    public boolean matches(Object obj) {
        if (!(obj instanceof Throwable))
            return false;

        Throwable throwable = (Throwable) obj;

        return throwable.getCause() == null;
    }
1057745
private boolean containsAnnotation(List<AnnotationExpr> annos, String annotationName) {
        for (AnnotationExpr anno : annos) {
            if (anno.getName().getName().equals(annotationName)) {
                return true;
            }
        }
        return false;
    }
753994
private static boolean classIsJPAEntity(JavaClass cls) {
		AnnotationEntry[] annotations = cls.getAnnotationEntries();
		if (annotations != null) {
			for (AnnotationEntry annotation : annotations) {
				if ("Ljavax/persistence/Entity;".equals(annotation.getAnnotationType())) {
					return true;
				}
			}
		}

		return false;
	}
96528
public static boolean isInAnnotation(Env<?> env, JCTree tree) {
        TreePath tp = TreePath.getPath(env.toplevel, tree);
        if (tp != null) {
            for (Tree t : tp) {
                if (t.getKind() == Tree.Kind.ANNOTATION)
                    return true;
            }
        }
        return false;
    }
166908
private static boolean isIdentityToString(Object pObject) {
        try {
            Method toString = pObject.getClass().getMethod("toString");
            if (toString.getDeclaringClass() == Object.class) {
                return true;
            }
        }
        catch (Exception ignore) {
            // Ignore
        }

        return false;
    }
104835
public function equals($object)
    {
        if (!is_object($object)) {
            return false;
        }

        if (!is_a($object, get_class($this))) {
            return false;
        }

        $props = array_keys(get_object_vars($this));
        $skip = array('_inspector', '___mocked', 'inspector');

        $equals = true;
        foreach ($props as $property) {
            if (in_array($property, $skip)) {
                continue;
            }
            $annotations = $this->inspector->getPropertyAnnotations($property);
            $property = str_replace('_', '', $property);
            
            if (!$annotations->hasAnnotation('@write')
                && $this->$property != $object->$property
            ) {
                return false;
            }

        }
        return $equals;
    }
54458
public boolean schemaEquals(Object obj) {
		return equals(obj) && Arrays.equals(fieldNames, ((RowTypeInfo) obj).fieldNames);
	}
335300
boolean equivalent(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        WlpInformation other = (WlpInformation) obj;

        if (appliesTo == null) {
            if (other.appliesTo != null)
                return false;
        } else if (!appliesTo.equals(other.appliesTo))
            return false;

        if (date == null) {
            if (other.date != null)
                return false;
        } else if (!date.equals(other.date))
            return false;

        if (links == null) {
            if (other.links != null)
                return false;
        } else if (!links.equals(other.links))
            return false;

        if (shortName == null) {
            if (other.shortName != null)
                return false;
        } else if (!shortName.equals(other.shortName))
            return false;

        if (lowerCaseShortName == null) {
            if (other.lowerCaseShortName != null)
                return false;
        } else if (!lowerCaseShortName.equals(other.lowerCaseShortName))
            return false;

        if (productEdition == null) {
            if (other.productEdition != null)
                return false;
        } else if (!productEdition.equals(other.productEdition))
            return false;

        if (productId == null) {
            if (other.productId != null)
                return false;
        } else if (!productId.equals(other.productId))
            return false;

        if (productInstallType == null) {
            if (other.productInstallType != null)
                return false;
        } else if (!productInstallType.equals(other.productInstallType))
            return false;

        if (productVersion == null) {
            if (other.productVersion != null)
                return false;
        } else if (!productVersion.equals(other.productVersion))
            return false;

        if (provideFeature == null) {
            if (other.provideFeature != null)
                return false;
        } else {
            if (other.provideFeature != null) {
                if (other.provideFeature.size() != provideFeature.size()) {
                    return false;
                }
                for (String s : other.provideFeature) {
                    if (!provideFeature.contains(s)) {
                        return false;
                    }
                }
            } else {
                return false;
            }
        }

        if (links == null) {
            if (other.links != null)
                return false;
        } else if (!links.equals(other.links))
            return false;

        if (provideFix == null) {
            if (other.provideFix != null)
                return false;
        } else if (!provideFix.equals(other.provideFix))
            return false;

        if (requireFeature == null) {
            if (other.requireFeature != null)
                return false;
        } else {
            if (other.requireFeature != null) {
                if (other.requireFeature.size() != requireFeature.size()) {
                    return false;
                }
                for (String s : other.requireFeature) {
                    if (!requireFeature.contains(s)) {
                        return false;
                    }
                }
            } else {
                return false;
            }
        }

        if (requireFix == null) {
            if (other.requireFix != null)
                return false;
        } else {
            if (other.requireFix != null) {
                if (other.requireFix.size() != requireFix.size()) {
                    return false;
                }
                for (String s : other.requireFix) {
                    if (!requireFix.contains(s)) {
                        return false;
                    }
                }
            } else {
                return false;
            }
        }

        if (typeLabel == null) {
            if (other.typeLabel != null)
                return false;
        } else if (!typeLabel.equals(other.typeLabel))
            return false;

        if (visibility == null) {
            if (other.visibility != null)
                return false;
        } else if (!visibility.equals(other.visibility))
            return false;

        if (scriptLanguage == null) {
            if (other.scriptLanguage != null)
                return false;
        } else if (!scriptLanguage.equals(other.scriptLanguage))
            return false;

        if (downloadPolicy == null) {
            if (other.downloadPolicy != null)
                return false;
        } else if (!downloadPolicy.equals(other.downloadPolicy))
            return false;

        if (provisionCapability == null) {
            if (other.provisionCapability != null)
                return false;
        } else if (!provisionCapability.equals(other.provisionCapability))
            return false;

        if (installPolicy == null) {
            if (other.installPolicy != null)
                return false;
        } else if (!installPolicy.equals(other.installPolicy))
            return false;

        if (displayPolicy == null) {
            if (other.displayPolicy != null)
                return false;
        } else if (!displayPolicy.equals(other.displayPolicy))
            return false;

        if (webDisplayPolicy == null) {
            if (other.webDisplayPolicy != null)
                return false;
        } else if (!webDisplayPolicy.equals(other.webDisplayPolicy))
            return false;

        if (vanityRelativeURL == null) {
            if (other.vanityRelativeURL != null)
                return false;
        } else if (!vanityRelativeURL.equals(other.vanityRelativeURL))
            return false;

        if (featuredWeight == null) {
            if (other.featuredWeight != null)
                return false;
        } else if (!featuredWeight.equals(other.featuredWeight))
            return false;

        if (wlpInformationVersion == null) {
            if (other.wlpInformationVersion != null)
                return false;
        } else if (!wlpInformationVersion.equals(other.wlpInformationVersion))
            return false;

        if (mainAttachmentSize != other.mainAttachmentSize)
            return false;

        if (supersededBy == null) {
            if (other.supersededBy != null) {
                return false;
            }
        } else if (!supersededBy.equals(other.supersededBy)) {
            return false;
        }

        if (supersededByOptional == null) {
            if (other.supersededByOptional != null) {
                return false;
            }
        } else if (!supersededByOptional.equals(other.supersededByOptional)) {
            return false;
        }

        if (javaSEVersionRequirements == null) {
            if (other.javaSEVersionRequirements != null) {
                return false;
            }
        } else if (!javaSEVersionRequirements.equals(other.javaSEVersionRequirements)) {
            return false;
        }

        if (mainAttachmentSHA256 == null) {
            if (other.mainAttachmentSHA256 != null) {
                return false;
            }
        } else if (!mainAttachmentSHA256.equals(other.mainAttachmentSHA256)) {
            return false;
        }

        if (genericRequirements == null) {
            if (other.genericRequirements != null) {
                return false;
            }
        } else if (!genericRequirements.equals(other.genericRequirements)) {
            return false;
        }

        if (packagedJava == null) {
            if (other.packagedJava != null) {
                return false;
            }
        } else if (!packagedJava.equals(other.packagedJava)) {
            return false;
        }

        if (requireFeatureWithTolerates == null) {
            if (other.requireFeatureWithTolerates != null) {
                return false;
            }
        } else if (!requireFeatureWithTolerates.equals(other.requireFeatureWithTolerates)) {
            return false;
        }

        if (mavenCoordinates == null) {
            if (other.mavenCoordinates != null) {
                return false;
            }
        } else if (!mavenCoordinates.equals(other.mavenCoordinates)) {
            return false;
        }

        if (singleton == null) {
            if (other.singleton != null)
                return false;
        } else if (!singleton.equals(other.singleton))
            return false;

        if (ibmInstallTo == null) {
            if (other.ibmInstallTo != null)
                return false;
        } else if (!ibmInstallTo.equals(other.ibmInstallTo))
            return false;

        return true;
    }
1311049
private static boolean compareAnnotated(Annotated a1, Annotated a2) {
        return a1.getAnnotations().equals(a2.getAnnotations());
    }
113552
@GwtIncompatible("incompatible method")
    private static boolean annotationArrayMemberEquals(final Annotation[] a1, final Annotation[] a2) {
        if (a1.length != a2.length) {
            return false;
        }
        for (int i = 0; i < a1.length; i++) {
            if (!equals(a1[i], a2[i])) {
                return false;
            }
        }
        return true;
    }
105680
public boolean equalsTo(Object o)
    {
        if(o == null || !(o instanceof Reference))
        {
            return false;
        }
        
        Reference refCompared = (Reference)o;
        if(!StringUtil.isEquals(sections, refCompared.sections)) return false;
        if(systemUnderTest == null || !systemUnderTest.equalsTo(refCompared.systemUnderTest)) return false;
        if(requirement == null || !requirement.equalsTo(refCompared.requirement)) return false;
        if(specification == null || !specification.equalsTo(refCompared.specification)) return false;
        
        return true;
    }
233705
@GwtIncompatible("incompatible method")
    private static boolean arrayMemberEquals(final Class<?> componentType, final Object o1, final Object o2) {
        if (componentType.isAnnotation()) {
            return annotationArrayMemberEquals((Annotation[]) o1, (Annotation[]) o2);
        }
        if (componentType.equals(Byte.TYPE)) {
            return Arrays.equals((byte[]) o1, (byte[]) o2);
        }
        if (componentType.equals(Short.TYPE)) {
            return Arrays.equals((short[]) o1, (short[]) o2);
        }
        if (componentType.equals(Integer.TYPE)) {
            return Arrays.equals((int[]) o1, (int[]) o2);
        }
        if (componentType.equals(Character.TYPE)) {
            return Arrays.equals((char[]) o1, (char[]) o2);
        }
        if (componentType.equals(Long.TYPE)) {
            return Arrays.equals((long[]) o1, (long[]) o2);
        }
        if (componentType.equals(Float.TYPE)) {
            return Arrays.equals((float[]) o1, (float[]) o2);
        }
        if (componentType.equals(Double.TYPE)) {
            return Arrays.equals((double[]) o1, (double[]) o2);
        }
        if (componentType.equals(Boolean.TYPE)) {
            return Arrays.equals((boolean[]) o1, (boolean[]) o2);
        }
        return Arrays.equals((Object[]) o1, (Object[]) o2);
    }
1035904
public final static boolean objectEquals(Object a, Object b) {
        return a == null ?
                b == null ? true : false :
                    b == null ? false : a.equals(b);
    }
502935
public boolean isDocumentedAnnotation(AnnotationTypeDoc annotationDoc) {
        for (AnnotationDesc anno : annotationDoc.annotations()) {
            if (anno.annotationType().qualifiedName().equals(
                    Documented.class.getName())) {
                return true;
            }
        }
        return false;
    }
974669
@Override
    public boolean compare(Object object) {
        if (!(object instanceof IAtomType)) {
            return false;
        }
        if (!super.compare(object)) {
            return false;
        }
        AtomType type = (AtomType) object;
        return Objects.equal(getAtomTypeName(), type.getAtomTypeName())
                && Objects.equal(maxBondOrder, type.maxBondOrder) && Objects.equal(bondOrderSum, type.bondOrderSum);
    }
1311101
public static boolean isAnnotated(AnnotatedElement element, Class<? extends Annotation> annotationType) {
        return findAnnotation(element, annotationType) != null;
    }