1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-04 06:45:43 +02:00

Fix warnings.

This commit is contained in:
Markus Schorn 2008-04-11 09:37:31 +00:00
parent b681d5978e
commit 147b628385
2 changed files with 9 additions and 11 deletions

View file

@ -119,6 +119,7 @@ public class TypeInfoLabelProvider extends LabelProvider {
buf.append(returnType); buf.append(returnType);
} }
} }
break;
case ICElement.C_VARIABLE: case ICElement.C_VARIABLE:
ITypeReference ref= typeInfo.getResolvedReference(); ITypeReference ref= typeInfo.getResolvedReference();
if (ref != null) { if (ref != null) {
@ -137,6 +138,7 @@ public class TypeInfoLabelProvider extends LabelProvider {
} }
} }
} }
break;
} }
} }
if (isSet(SHOW_PATH)) { if (isSet(SHOW_PATH)) {

View file

@ -184,14 +184,11 @@ public class TypeSelectionDialog extends TwoPaneElementSelector {
} }
} }
private static class StringComparator implements Comparator { private static class StringComparator implements Comparator<String> {
public int compare(Object left, Object right) { public int compare(String left, String right) {
String leftString = (String) left; int result = left.compareToIgnoreCase(right);
String rightString = (String) right;
int result = leftString.compareToIgnoreCase(rightString);
if (result == 0) if (result == 0)
result = leftString.compareTo(rightString); result = left.compareTo(right);
return result; return result;
} }
@ -676,8 +673,7 @@ public class TypeSelectionDialog extends TwoPaneElementSelector {
ArrayList<IndexTypeInfo> result= new ArrayList<IndexTypeInfo>(); ArrayList<IndexTypeInfo> result= new ArrayList<IndexTypeInfo>();
Object[] typeInfos= super.getFoldedElements(index); Object[] typeInfos= super.getFoldedElements(index);
if (typeInfos != null) { if (typeInfos != null) {
for (int i = 0; i < typeInfos.length; i++) { for (Object typeInfo : typeInfos) {
Object typeInfo = typeInfos[i];
if (typeInfo instanceof IndexTypeInfo) { if (typeInfo instanceof IndexTypeInfo) {
addFoldedElements((IndexTypeInfo) typeInfo, result); addFoldedElements((IndexTypeInfo) typeInfo, result);
} }
@ -688,8 +684,8 @@ public class TypeSelectionDialog extends TwoPaneElementSelector {
private void addFoldedElements(IndexTypeInfo typeInfo, ArrayList<IndexTypeInfo> result) { private void addFoldedElements(IndexTypeInfo typeInfo, ArrayList<IndexTypeInfo> result) {
ITypeReference[] refs= typeInfo.getReferences(); ITypeReference[] refs= typeInfo.getReferences();
for (int i = 0; i < refs.length; i++) { for (ITypeReference ref : refs) {
result.add(new IndexTypeInfo(typeInfo, refs[i])); result.add(new IndexTypeInfo(typeInfo, ref));
} }
} }
} }