Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Goldthorpe2009-08-18 19:59:42 +0000
committerChris Goldthorpe2009-08-18 19:59:42 +0000
commit987573238ea36c2325bb5bb5c313b12694310d83 (patch)
tree73c9851857f0aeba800a429fb75f49640e9b2b44 /bundles/org.eclipse.ui.browser
parent4d6a0bbac84f855e60da43bb0aeadffece60ab92 (diff)
downloadeclipse.platform.ui-987573238ea36c2325bb5bb5c313b12694310d83.tar.gz
eclipse.platform.ui-987573238ea36c2325bb5bb5c313b12694310d83.tar.xz
eclipse.platform.ui-987573238ea36c2325bb5bb5c313b12694310d83.zip
Bug 286949 – Bad usage of URL#equals(Object) in WebBrowserEditorInputv20090824
Diffstat (limited to 'bundles/org.eclipse.ui.browser')
-rw-r--r--bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserEditorInput.java23
1 files changed, 19 insertions, 4 deletions
diff --git a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserEditorInput.java b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserEditorInput.java
index 19c5ba248b5..eb2e3e94a0e 100644
--- a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserEditorInput.java
+++ b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserEditorInput.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -190,9 +190,13 @@ public class WebBrowserEditorInput implements IEditorInput,
return false;
WebBrowserEditorInput other = (WebBrowserEditorInput) obj;
- if (url != null && !url.equals(other.url))
- return false;
-
+ if (url != null) {
+ if (other.url == null || !url.toExternalForm().equals(other.url.toExternalForm())) {
+ return false;
+ }
+ } else if (other.url != null) {
+ return false;
+ }
return canReplaceInput(other);
}
@@ -363,4 +367,15 @@ public class WebBrowserEditorInput implements IEditorInput,
public String toString() {
return "WebBrowserEditorInput[" + url + " " + style + " " + id + "]"; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
+
+ public int hashCode() {
+ int result = 0;
+ if (url != null) {
+ result = result + url.toExternalForm().hashCode();
+ }
+ if (id != null) {
+ result = result + id.hashCode();
+ }
+ return result;
+ }
}

Back to the top