cdt/cdt_5_0_x/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryUtil.java
equal
deleted
inserted
replaced
10 *******************************************************************************/ |
10 *******************************************************************************/ |
11 |
11 |
12 package org.eclipse.cdt.internal.core.model; |
12 package org.eclipse.cdt.internal.core.model; |
13 |
13 |
14 import java.io.File; |
14 import java.io.File; |
|
15 import java.text.MessageFormat; |
15 import java.util.*; |
16 import java.util.*; |
16 |
17 |
17 import org.eclipse.cdt.core.CCorePlugin; |
18 import org.eclipse.cdt.core.CCorePlugin; |
18 import org.eclipse.cdt.core.model.CModelException; |
19 import org.eclipse.cdt.core.model.CModelException; |
19 import org.eclipse.cdt.core.model.CoreModel; |
20 import org.eclipse.cdt.core.model.CoreModel; |
334 // Check duplication. |
335 // Check duplication. |
335 Set<IPathEntry> entrySet = new HashSet<IPathEntry>(entries.length); |
336 Set<IPathEntry> entrySet = new HashSet<IPathEntry>(entries.length); |
336 for (IPathEntry entry : entries) { |
337 for (IPathEntry entry : entries) { |
337 if (entry != null) { |
338 if (entry != null) { |
338 if (entrySet.contains(entry)) { |
339 if (entrySet.contains(entry)) { |
339 StringBuffer errMesg = new StringBuffer(CCorePlugin.getResourceString("CoreModel.PathEntry.DuplicateEntry")); //$NON-NLS-1$ |
340 return new CModelStatus(ICModelStatusConstants.INVALID_PATHENTRY, |
340 return new CModelStatus(ICModelStatusConstants.INVALID_PATHENTRY, errMesg.toString()); |
341 MessageFormat.format("{0}{1}", //$NON-NLS-1$ |
|
342 CCorePlugin.getResourceString("CoreModel.PathEntry.DuplicateEntry"), //$NON-NLS-1$ |
|
343 entry.getPath().toString())); |
341 } |
344 } |
342 else { |
345 else { |
343 entrySet.add(entry); |
346 entrySet.add(entry); |
344 } |
347 } |
345 } |
348 } |