diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CFileTypesPropertyPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CFileTypesPropertyPage.java index e6c0f950dc4..11dbb1b446e 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CFileTypesPropertyPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CFileTypesPropertyPage.java @@ -121,7 +121,7 @@ public class CFileTypesPropertyPage extends PropertyPage { return; List existingValues = parseItemsIntoList(contentTypeNode.get(key, null), PREF_SEPARATOR); //$NON-NLS-1$ int index = -1; - for (int j = 0; j < existingValues.size(); j++) + for (int j = 0; index == -1 && j < existingValues.size(); j++) if (((String) existingValues.get(j)).equalsIgnoreCase(spec)) index = j; if (index == -1)