1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

fix bug 104506: StringIndexOutOfBoundsException

This commit is contained in:
Andrew Niefer 2005-07-20 15:13:57 +00:00
parent 6cc20b8467
commit ad2b990865

View file

@ -127,12 +127,14 @@ public class CElementSorter extends ViewerSorter {
return MACROS; return MACROS;
} else if (element instanceof INamespace) { } else if (element instanceof INamespace) {
String name = ((ICElement)element).getElementName(); String name = ((ICElement)element).getElementName();
if( name.length() > 0 ) {
if (name.startsWith("__")) { //$NON-NLS-1$ if (name.startsWith("__")) { //$NON-NLS-1$
return NAMESPACES_SYSTEM; return NAMESPACES_SYSTEM;
} }
if (name.charAt(0) == '_') { if (name.charAt(0) == '_') {
return NAMESPACES_RESERVED; return NAMESPACES_RESERVED;
} }
}
return NAMESPACES; return NAMESPACES;
} else if (element instanceof IUsing) { } else if (element instanceof IUsing) {
return USINGS; return USINGS;
@ -170,12 +172,14 @@ public class CElementSorter extends ViewerSorter {
return INCLUDEREFERENCES; return INCLUDEREFERENCES;
} else if (element instanceof ICElement) { } else if (element instanceof ICElement) {
String name = ((ICElement)element).getElementName(); String name = ((ICElement)element).getElementName();
if( name.length() > 0 ) {
if (name.startsWith("__")) { //$NON-NLS-1$ if (name.startsWith("__")) { //$NON-NLS-1$
return CELEMENTS_SYSTEM; return CELEMENTS_SYSTEM;
} }
if (name.charAt(0) == '_') { if (name.charAt(0) == '_') {
return CELEMENTS_RESERVED; return CELEMENTS_RESERVED;
} }
}
return CELEMENTS; return CELEMENTS;
} else if (element instanceof IFile) { } else if (element instanceof IFile) {
return RESOURCES; return RESOURCES;