@Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final JarPluginProviderLoader that = (JarPluginProviderLoader) o; if (classCache != null ? !classCache.equals(that.classCache) : that.classCache != null) { return false; } if (!pluginJar.equals(that.pluginJar)) { return false; } if (mainAttributes != null ? !mainAttributes.equals(that.mainAttributes) : that.mainAttributes != null) { return false; } if (pluginProviderDefs != null ? !pluginProviderDefs.equals(that.pluginProviderDefs) : that.pluginProviderDefs != null) { return false; } return true; }
/** * Returns true if the specified Object is also a Manifest and has the same main Attributes and * entries. * * @param o the object to be compared * @return true if the specified Object is also a Manifest and has the same main Attributes and * entries */ public boolean equals(Object o) { if (o instanceof Manifest) { Manifest m = (Manifest) o; return attr.equals(m.getMainAttributes()) && entries.equals(m.getEntries()); } else { return false; } }
/** * Determines if the receiver is equal to the parameter object. Two {@code Manifest}s are equal if * they have identical main attributes as well as identical entry attributes. * * @param o the object to compare against. * @return {@code true} if the manifests are equal, {@code false} otherwise */ @Override public boolean equals(Object o) { if (o == null) { return false; } if (o.getClass() != this.getClass()) { return false; } if (!mainAttributes.equals(((Manifest) o).mainAttributes)) { return false; } return getEntries().equals(((Manifest) o).getEntries()); }
/** @tests java.util.jar.Attributes#Attributes(java.util.jar.Attributes) */ public void test_ConstructorLjava_util_jar_Attributes() { Attributes a2 = new Attributes(a); assertEquals(a, a2); a.putValue("1", "one(1)"); assertTrue("equal", !a.equals(a2)); }
/** @tests java.util.jar.Attributes#clone() */ public void test_clone() { Attributes a2 = (Attributes) a.clone(); assertEquals(a, a2); a.putValue("1", "one(1)"); assertTrue("equal", !a.equals(a2)); }