Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Weinand2001-08-06 15:18:43 +0000
committerAndre Weinand2001-08-06 15:18:43 +0000
commit929f682d4d7420854f8f5a589bdcb19b17d9c60e (patch)
tree4aef5239ac41783ae6dd5073429b1af4316b7e54
parent9a6fed89beebb64c53a2aaecd8593b9d14565a71 (diff)
downloadeclipse.platform.team-929f682d4d7420854f8f5a589bdcb19b17d9c60e.tar.gz
eclipse.platform.team-929f682d4d7420854f8f5a589bdcb19b17d9c60e.tar.xz
eclipse.platform.team-929f682d4d7420854f8f5a589bdcb19b17d9c60e.zip
1GHBPA1: ITPVCM:WINNT - Compare - next change arrow switches to wrong file
-rw-r--r--bundles/org.eclipse.compare/buildnotes_compare.html2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffNode.java47
-rw-r--r--bundles/org.eclipse.compare/plugin.properties2
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html2
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffNode.java47
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/plugin.properties2
6 files changed, 76 insertions, 26 deletions
diff --git a/bundles/org.eclipse.compare/buildnotes_compare.html b/bundles/org.eclipse.compare/buildnotes_compare.html
index 287881738..bb0d039ca 100644
--- a/bundles/org.eclipse.compare/buildnotes_compare.html
+++ b/bundles/org.eclipse.compare/buildnotes_compare.html
@@ -33,6 +33,8 @@ Problem reports fixed</h2>
1GFMLFB: ITPUI:WIN2000 - files that are out of sync with the file system appear as empty<br>
1GG0ELM: ITPVCM:ALL - Local history displayed some of Today's items as Yesterday<br>
1GGNKHN: ITPJUI:ALL - No progress during replace with local history<br>
+1GF2JNI: ITPUI:ALL - (minor)Compare failed title should be title case<br>
+1GHBPA1: ITPVCM:WINNT - Compare - next change arrow switches to wrong file<br>
<h2>
Problem reports closed</h2>
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffNode.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffNode.java
index a25a0033f..c1cf1ee7b 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffNode.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffNode.java
@@ -290,23 +290,46 @@ public class DiffNode extends DiffContainer implements ITypedElement, ICompareIn
}
}
- //---- object
-
+ /* (non Javadoc)
+ * see Object.hashCode
+ */
public int hashCode() {
- Object id= getId();
- if (id != null)
- return id.hashCode();
- return super.hashCode();
+ String[] path= getPath(this, 0);
+ int hashCode= 1;
+ for (int i= 0; i < path.length; i++) {
+ String s= path[i];
+ hashCode= (31*hashCode) + (s != null ? s.hashCode() : 0);
+ }
+ return hashCode;
}
-
+
+ /* (non Javadoc)
+ * see Object.equals
+ */
public boolean equals(Object other) {
if (other != null && getClass() == other.getClass()) {
- DiffNode d= (DiffNode) other;
- Object id1= getId();
- Object id2= d.getId();
- if (id1 != null && id2 != null)
- return id1.equals(id2);
+ String[] path1= getPath(this, 0);
+ String[] path2= getPath((DiffNode) other, 0);
+ if (path1.length != path2.length)
+ return false;
+ for (int i= 0; i < path1.length; i++)
+ if (! path1[i].equals(path2[i]))
+ return false;
+ return true;
}
return super.equals(other);
}
+
+ private static String[] getPath(ITypedElement el, int level) {
+ String[] path= null;
+ if (el instanceof IDiffContainer) {
+ IDiffContainer parent= ((IDiffContainer)el).getParent();
+ if (parent instanceof ITypedElement)
+ path= getPath((ITypedElement)parent, level+1);
+ }
+ if (path == null)
+ path= new String[level+1];
+ path[(path.length-1)-level]= el.getName();
+ return path;
+ }
}
diff --git a/bundles/org.eclipse.compare/plugin.properties b/bundles/org.eclipse.compare/plugin.properties
index 78bb9134b..e551d489d 100644
--- a/bundles/org.eclipse.compare/plugin.properties
+++ b/bundles/org.eclipse.compare/plugin.properties
@@ -20,7 +20,7 @@ contentViewers= Content Viewer
#
CompareUIPlugin.dialogTitle=Compare
CompareUIPlugin.noActiveWorkbenchPage=Can\'t find active workbench page
-CompareUIPlugin.compareFailed=Compare failed
+CompareUIPlugin.compareFailed=Compare Failed
CompareUIPlugin.openEditorError=Problems Opening Editor
CompareUIPlugin.noDifferences=There are no differences between the selected inputs.
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html
index 287881738..bb0d039ca 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html
@@ -33,6 +33,8 @@ Problem reports fixed</h2>
1GFMLFB: ITPUI:WIN2000 - files that are out of sync with the file system appear as empty<br>
1GG0ELM: ITPVCM:ALL - Local history displayed some of Today's items as Yesterday<br>
1GGNKHN: ITPJUI:ALL - No progress during replace with local history<br>
+1GF2JNI: ITPUI:ALL - (minor)Compare failed title should be title case<br>
+1GHBPA1: ITPVCM:WINNT - Compare - next change arrow switches to wrong file<br>
<h2>
Problem reports closed</h2>
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffNode.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffNode.java
index a25a0033f..c1cf1ee7b 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffNode.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffNode.java
@@ -290,23 +290,46 @@ public class DiffNode extends DiffContainer implements ITypedElement, ICompareIn
}
}
- //---- object
-
+ /* (non Javadoc)
+ * see Object.hashCode
+ */
public int hashCode() {
- Object id= getId();
- if (id != null)
- return id.hashCode();
- return super.hashCode();
+ String[] path= getPath(this, 0);
+ int hashCode= 1;
+ for (int i= 0; i < path.length; i++) {
+ String s= path[i];
+ hashCode= (31*hashCode) + (s != null ? s.hashCode() : 0);
+ }
+ return hashCode;
}
-
+
+ /* (non Javadoc)
+ * see Object.equals
+ */
public boolean equals(Object other) {
if (other != null && getClass() == other.getClass()) {
- DiffNode d= (DiffNode) other;
- Object id1= getId();
- Object id2= d.getId();
- if (id1 != null && id2 != null)
- return id1.equals(id2);
+ String[] path1= getPath(this, 0);
+ String[] path2= getPath((DiffNode) other, 0);
+ if (path1.length != path2.length)
+ return false;
+ for (int i= 0; i < path1.length; i++)
+ if (! path1[i].equals(path2[i]))
+ return false;
+ return true;
}
return super.equals(other);
}
+
+ private static String[] getPath(ITypedElement el, int level) {
+ String[] path= null;
+ if (el instanceof IDiffContainer) {
+ IDiffContainer parent= ((IDiffContainer)el).getParent();
+ if (parent instanceof ITypedElement)
+ path= getPath((ITypedElement)parent, level+1);
+ }
+ if (path == null)
+ path= new String[level+1];
+ path[(path.length-1)-level]= el.getName();
+ return path;
+ }
}
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/plugin.properties b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/plugin.properties
index 78bb9134b..e551d489d 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/plugin.properties
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/plugin.properties
@@ -20,7 +20,7 @@ contentViewers= Content Viewer
#
CompareUIPlugin.dialogTitle=Compare
CompareUIPlugin.noActiveWorkbenchPage=Can\'t find active workbench page
-CompareUIPlugin.compareFailed=Compare failed
+CompareUIPlugin.compareFailed=Compare Failed
CompareUIPlugin.openEditorError=Problems Opening Editor
CompareUIPlugin.noDifferences=There are no differences between the selected inputs.

Back to the top