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:
parent
6cc20b8467
commit
ad2b990865
1 changed files with 14 additions and 10 deletions
|
@ -127,12 +127,14 @@ public class CElementSorter extends ViewerSorter {
|
|||
return MACROS;
|
||||
} else if (element instanceof INamespace) {
|
||||
String name = ((ICElement)element).getElementName();
|
||||
if( name.length() > 0 ) {
|
||||
if (name.startsWith("__")) { //$NON-NLS-1$
|
||||
return NAMESPACES_SYSTEM;
|
||||
}
|
||||
if (name.charAt(0) == '_') {
|
||||
return NAMESPACES_RESERVED;
|
||||
}
|
||||
}
|
||||
return NAMESPACES;
|
||||
} else if (element instanceof IUsing) {
|
||||
return USINGS;
|
||||
|
@ -170,12 +172,14 @@ public class CElementSorter extends ViewerSorter {
|
|||
return INCLUDEREFERENCES;
|
||||
} else if (element instanceof ICElement) {
|
||||
String name = ((ICElement)element).getElementName();
|
||||
if( name.length() > 0 ) {
|
||||
if (name.startsWith("__")) { //$NON-NLS-1$
|
||||
return CELEMENTS_SYSTEM;
|
||||
}
|
||||
if (name.charAt(0) == '_') {
|
||||
return CELEMENTS_RESERVED;
|
||||
}
|
||||
}
|
||||
return CELEMENTS;
|
||||
} else if (element instanceof IFile) {
|
||||
return RESOURCES;
|
||||
|
|
Loading…
Add table
Reference in a new issue