Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CLibraryFileEntry.java12
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionManager.java23
2 files changed, 23 insertions, 12 deletions
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CLibraryFileEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CLibraryFileEntry.java
index 9ebe581e650..d7ec4873b20 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CLibraryFileEntry.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CLibraryFileEntry.java
@@ -93,6 +93,18 @@ public final class CLibraryFileEntry extends ACPathEntry implements
}
@Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result + ((fSourceAttachmentPath == null) ? 0 : fSourceAttachmentPath.hashCode());
+ result = prime * result
+ + ((fSourceAttachmentPrefixMapping == null) ? 0 : fSourceAttachmentPrefixMapping.hashCode());
+ result = prime * result
+ + ((fSourceAttachmentRootPath == null) ? 0 : fSourceAttachmentRootPath.hashCode());
+ return result;
+ }
+
+ @Override
public boolean equals(Object other) {
if(other == this)
return true;
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionManager.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionManager.java
index e537251e6d4..2c1d9c1da22 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionManager.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionManager.java
@@ -1793,14 +1793,15 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
newEntries = EMPTY_LANGUAGE_SETTINGS_ENTRIES_ARRAY;
}
+ Set<ICLanguageSettingEntry> newEntrySet = new HashSet<ICLanguageSettingEntry>(Arrays.asList(newEntries));
+ Set<ICLanguageSettingEntry> oldEntrySet = new HashSet<ICLanguageSettingEntry>(Arrays.asList(oldEntries));
+
// Check the removed entries.
- for (int i = 0; i < oldEntries.length; i++) {
+ for (ICLanguageSettingEntry oldEntry : oldEntries) {
boolean found = false;
- for (int j = 0; j < newEntries.length; j++) {
- if (oldEntries[i].equals(newEntries[j])) {
- found = true;
- break;
- }
+ if (newEntrySet.contains(oldEntry)) {
+ found = true;
+ break;
}
if(!found){
result[1] = true;
@@ -1809,13 +1810,11 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
}
// Check the new entries.
- for (int i = 0; i < newEntries.length; i++) {
+ for (ICLanguageSettingEntry newEntry : newEntries) {
boolean found = false;
- for (int j = 0; j < oldEntries.length; j++) {
- if (newEntries[i].equals(oldEntries[j])) {
- found = true;
- break;
- }
+ if (oldEntrySet.contains(newEntry)) {
+ found = true;
+ break;
}
if(!found){
result[0] = true;

Back to the top