Fixing errors caused by classgroups without public names NIHVIVO-1682
This commit is contained in:
parent
06cd5380bc
commit
1be2747d14
1 changed files with 15 additions and 1 deletions
|
@ -145,6 +145,9 @@ public class VClassGroup extends LinkedList <VClass> implements Comparable<VClas
|
|||
/**
|
||||
* Sorts VClassGroup objects by group rank, then alphanumeric.
|
||||
* @author bdc34 modified by jc55, bjl23
|
||||
* @return a negative integer, zero, or a positive integer as the
|
||||
* first argument is less than, equal to, or greater than the
|
||||
* second.
|
||||
*/
|
||||
public int compareTo(VClassGroup o2) {
|
||||
Collator collator = Collator.getInstance();
|
||||
|
@ -154,7 +157,18 @@ public class VClassGroup extends LinkedList <VClass> implements Comparable<VClas
|
|||
}
|
||||
int diff = (this.getDisplayRank() - o2.getDisplayRank());
|
||||
if (diff == 0 ) {
|
||||
return collator.compare(this.getPublicName(),o2.getPublicName());
|
||||
|
||||
//put null public name classgrups at end of list
|
||||
if( this.getPublicName() == null ){
|
||||
if( o2.getPublicName() == null )
|
||||
return 0; //or maybe collator.compare(this.getURI(),o2.getURI()) ???
|
||||
else
|
||||
return 1;
|
||||
}else if ( o2.getPublicName() == null ){
|
||||
return -1;
|
||||
}else{
|
||||
return collator.compare(this.getPublicName(),o2.getPublicName());
|
||||
}
|
||||
}
|
||||
return diff;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue