diff --git a/core/org.eclipse.cdt.ui/browser/org/eclipse/cdt/ui/browser/typeinfo/TypeInfoLabelProvider.java b/core/org.eclipse.cdt.ui/browser/org/eclipse/cdt/ui/browser/typeinfo/TypeInfoLabelProvider.java index d35781eaebe..0ba02040827 100644 --- a/core/org.eclipse.cdt.ui/browser/org/eclipse/cdt/ui/browser/typeinfo/TypeInfoLabelProvider.java +++ b/core/org.eclipse.cdt.ui/browser/org/eclipse/cdt/ui/browser/typeinfo/TypeInfoLabelProvider.java @@ -119,6 +119,7 @@ public class TypeInfoLabelProvider extends LabelProvider { buf.append(returnType); } } + break; case ICElement.C_VARIABLE: ITypeReference ref= typeInfo.getResolvedReference(); if (ref != null) { @@ -137,6 +138,7 @@ public class TypeInfoLabelProvider extends LabelProvider { } } } + break; } } if (isSet(SHOW_PATH)) { diff --git a/core/org.eclipse.cdt.ui/browser/org/eclipse/cdt/ui/browser/typeinfo/TypeSelectionDialog.java b/core/org.eclipse.cdt.ui/browser/org/eclipse/cdt/ui/browser/typeinfo/TypeSelectionDialog.java index 3715a2ada2c..bf6a974eb8f 100644 --- a/core/org.eclipse.cdt.ui/browser/org/eclipse/cdt/ui/browser/typeinfo/TypeSelectionDialog.java +++ b/core/org.eclipse.cdt.ui/browser/org/eclipse/cdt/ui/browser/typeinfo/TypeSelectionDialog.java @@ -184,14 +184,11 @@ public class TypeSelectionDialog extends TwoPaneElementSelector { } } - private static class StringComparator implements Comparator { - public int compare(Object left, Object right) { - String leftString = (String) left; - String rightString = (String) right; - - int result = leftString.compareToIgnoreCase(rightString); + private static class StringComparator implements Comparator { + public int compare(String left, String right) { + int result = left.compareToIgnoreCase(right); if (result == 0) - result = leftString.compareTo(rightString); + result = left.compareTo(right); return result; } @@ -676,8 +673,7 @@ public class TypeSelectionDialog extends TwoPaneElementSelector { ArrayList result= new ArrayList(); Object[] typeInfos= super.getFoldedElements(index); if (typeInfos != null) { - for (int i = 0; i < typeInfos.length; i++) { - Object typeInfo = typeInfos[i]; + for (Object typeInfo : typeInfos) { if (typeInfo instanceof IndexTypeInfo) { addFoldedElements((IndexTypeInfo) typeInfo, result); } @@ -688,8 +684,8 @@ public class TypeSelectionDialog extends TwoPaneElementSelector { private void addFoldedElements(IndexTypeInfo typeInfo, ArrayList result) { ITypeReference[] refs= typeInfo.getReferences(); - for (int i = 0; i < refs.length; i++) { - result.add(new IndexTypeInfo(typeInfo, refs[i])); + for (ITypeReference ref : refs) { + result.add(new IndexTypeInfo(typeInfo, ref)); } } }