From 8b676319befac457aa5cc960962fdfae17338369 Mon Sep 17 00:00:00 2001 From: Jason Montojo Date: Fri, 2 Nov 2007 17:10:19 +0000 Subject: [PATCH] Fix for bug 208577 --- .../cdt/internal/core/model/APathEntry.java | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/APathEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/APathEntry.java index a22fc6f8737..f97838d6159 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/APathEntry.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/APathEntry.java @@ -8,9 +8,13 @@ * Contributors: * QNX Software Systems - Initial API and implementation * Anton Leherbauer (Wind River Systems) + * IBM Corporation *******************************************************************************/ package org.eclipse.cdt.internal.core.model; +import java.util.HashSet; +import java.util.Set; + import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; @@ -91,15 +95,17 @@ public abstract class APathEntry extends PathEntry { if (otherExcludes.length != excludeLength) { return false; } + + Set excludeSet = new HashSet(); + Set otherSet = new HashSet(); for (int i = 0; i < excludeLength; i++) { - if (exclusionPatterns[i] != otherExcludes[i]) { - // compare toStrings instead of IPaths - // since IPath.equals is specified to ignore trailing separators - String myPattern = exclusionPatterns[i].toString(); - if (!myPattern.equals(otherExcludes[i].toString())) { - return false; - } - } + // compare toStrings instead of IPaths + // since IPath.equals is specified to ignore trailing separators + excludeSet.add(exclusionPatterns[i].toString()); + otherSet.add(otherExcludes[i].toString()); + } + if (!excludeSet.equals(otherSet)) { + return false; } } IPath otherBasePath = otherEntry.getBasePath();