Fixed bug in compareTo

This commit is contained in:
Luca Frosini 2023-01-24 19:52:34 +01:00
parent ce0ddaedd6
commit 8035828d49
1 changed files with 13 additions and 3 deletions

View File

@ -262,9 +262,19 @@ public final class PropertyDefinitionImpl implements PropertyDefinition {
return ret;
}
ret = regexp.compareTo(o.regexp);
if(ret != 0) {
return ret;
if(regexp==null && o.regexp!=null) {
return -1;
}
if(o.regexp==null && regexp!=null) {
return -1;
}
if(!(regexp==null && o.regexp==null)) {
ret = regexp.compareTo(o.regexp);
if(ret != 0) {
return ret;
}
}
return propertyTypeName.toString().compareTo(o.propertyTypeName.toString());