diff --git a/org.fortiss.tooling.base/src/org/fortiss/tooling/base/annotation/.ratings b/org.fortiss.tooling.base/src/org/fortiss/tooling/base/annotation/.ratings index e567fc04ca81bcc2277d488b25cec0b1092483ca..abca4e511b5e2d1043905174118e90e9146c34db 100644 --- a/org.fortiss.tooling.base/src/org/fortiss/tooling/base/annotation/.ratings +++ b/org.fortiss.tooling.base/src/org/fortiss/tooling/base/annotation/.ratings @@ -1,3 +1,3 @@ -AnnotationEntry.java d5f58056645ef5336d94c1030b26fab83c571c55 YELLOW +AnnotationEntry.java 50d8790560ed60ba534b9d84a42f985e8f3e92a4 YELLOW AnnotationValueService.java 01fc46fb381854b16ce78779217ffc7c29036c14 GREEN IAnnotationValueService.java 81ff274a7b2d4c58e7b8485db857eb83f99710d0 GREEN diff --git a/org.fortiss.tooling.base/src/org/fortiss/tooling/base/annotation/AnnotationEntry.java b/org.fortiss.tooling.base/src/org/fortiss/tooling/base/annotation/AnnotationEntry.java index d5f58056645ef5336d94c1030b26fab83c571c55..50d8790560ed60ba534b9d84a42f985e8f3e92a4 100644 --- a/org.fortiss.tooling.base/src/org/fortiss/tooling/base/annotation/AnnotationEntry.java +++ b/org.fortiss.tooling.base/src/org/fortiss/tooling/base/annotation/AnnotationEntry.java @@ -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;