Bug 283359 [Browser] WebBrowserEditorInput#equals(Object) is wrong
Build ID: 3.2.201.v20080708_34x Steps To Reproduce: Looking at the WebBrowserEditorInput#equals(Object) method in 3.2.201.v20080708_34x version of the org.eclipse.ui.browser (similarly in the head), there are few issues: 1) The javadoc is wrong, and it doesn't make sense. 2) The line: if (url != null && !url.equals(obj)) should be if (url != null && !url.equals(other.url)) For reference, I'm pasting the contents of the equals method: /** * Indicates whether some other object is "equal to" this one. In this case * it means that the underlying IFolders are equal. */ public boolean equals(Object obj) { if (this == obj) return true; if (!(obj instanceof WebBrowserEditorInput)) return false; WebBrowserEditorInput other = (WebBrowserEditorInput) obj; if (url != null && !url.equals(obj)) return false; return canReplaceInput(other); } More information:
bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserEditorInput.java
}
	/*
	 * Returns whether the editor input exists.
	 */
	public boolean exists() {
		if ((style & IWorkbenchBrowserSupport.PERSISTENT) != 0)
			return false;
		return true;
	}
	/**
	 * Returns an object which is an instance of the given class associated with
	 * this object. Returns <code>null</code> if no such object can be found.
	 * 
	 * @param adapter
	 *            the adapter class to look up
	 * @return a object castable to the given class, or <code>null</code> if
	 *         this object does not have an adapter for the given class
	 */
	public Object getAdapter(Class adapter) {
		return null;
	}
	/**
	 * Returns the ID of an element factory which can be used to recreate this
	 * object. An element factory extension with this ID must exist within the
	 * workbench registry.
	 * 
	 * @return the element factory ID
	 */
	public String getFactoryId() {
		return ELEMENT_FACTORY_ID;