/** * Set the stylesheet file. * @param stylesheet a {@link org.apache.tools.ant.types.Resource} value * @throws Exception on error */ public void setStylesheet(final Resource stylesheet) throws Exception { if (this.stylesheet != null) { // resetting the stylesheet - reset transformer transformer = null; // do we need to reset templates as well if (!this.stylesheet.equals(stylesheet) || (stylesheet.getLastModified() != templatesModTime)) { templates = null; } } this.stylesheet = stylesheet; }
/** * Implement basic Resource equality. * @param other the object to check against. * @return true if the specified Object is equal to this Resource. * @since Ant 1.7 */ @Override public boolean equals(Object other) { if (this == other) { return true; } if (isReference()) { return getCheckedRef().equals(other); } return other != null && other.getClass().equals(getClass()) && compareTo((Resource) other) == 0; }
/** * Equality check based on the resource's name in addition to the * resource itself. * @since Ant 1.8.1 */ @Override public boolean equals(Object other) { if (other == null || other.getClass() != getClass()) { return false; } MappedResource m = (MappedResource) other; String myName = getName(); String otherName = m.getName(); return (myName == null ? otherName == null : myName.equals(otherName)) && getResource().equals(m.getResource()); }
/** * Test whether an Object equals this URLResource. * @param another the other Object to compare. * @return true if the specified Object is equal to this Resource. */ public synchronized boolean equals(Object another) { if (this == another) { return true; } if (isReference()) { return getCheckedRef().equals(another); } if (another == null || another.getClass() != getClass()) { return false; } URLResource other = (URLResource) another; return getURL() == null ? other.getURL() == null : getURL().equals(other.getURL()); }
/** * Compare another Object to this ArchiveResource for equality. * @param another the other Object to compare. * @return true if another is a Resource representing * the same entry in the same archive. */ @Override public boolean equals(Object another) { if (this == another) { return true; } if (isReference()) { return getCheckedRef().equals(another); } if (another == null || !another.getClass().equals(getClass())) { return false; } ArchiveResource r = (ArchiveResource) another; return getArchive().equals(r.getArchive()) && getName().equals(r.getName()); }
if (r1.equals(r2)) { return 0;
if (r1.equals(r2)) { return true;