Skip to content
Snippets Groups Projects
Commit 5ff9d0d5 authored by Andreas Bayha's avatar Andreas Bayha
Browse files

YELLOW

parent 21dc8c3a
No related branches found
No related tags found
1 merge request!1254014
AnnotationEntry.java d5f58056645ef5336d94c1030b26fab83c571c55 YELLOW
AnnotationEntry.java 50d8790560ed60ba534b9d84a42f985e8f3e92a4 YELLOW
AnnotationValueService.java 01fc46fb381854b16ce78779217ffc7c29036c14 GREEN
IAnnotationValueService.java 81ff274a7b2d4c58e7b8485db857eb83f99710d0 GREEN
......@@ -238,8 +238,24 @@ public class AnnotationEntry implements Comparable<AnnotationEntry> {
IModelElement thisModelElement = this.getModelElement();
if(thisModelElement instanceof INamedElement &&
otherModelElement instanceof INamedElement) {
return ((INamedElement)thisModelElement).getName()
.compareTo(((INamedElement)otherModelElement).getName());
INamedElement thisNamed = (INamedElement)thisModelElement;
INamedElement otherNamed = (INamedElement)otherModelElement;
int stringCompare = thisNamed.getName().compareTo(otherNamed.getName());
// In case the name is some special character, it shall be in the end of e.g. lists.
if(!thisNamed.getName().matches("^[a-zA-Z0-9^].*")) {
if(otherNamed.getName().matches("^[a-zA-Z0-9].*")) {
return stringCompare * -1;
}
}
if(!otherNamed.getName().matches("^[a-zA-Z0-9^].*")) {
if(thisNamed.getName().matches("^[a-zA-Z0-9].*")) {
return stringCompare * -1;
}
}
return stringCompare;
}
return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment