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.
|
* Sorts VClassGroup objects by group rank, then alphanumeric.
|
||||||
* @author bdc34 modified by jc55, bjl23
|
* @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) {
|
public int compareTo(VClassGroup o2) {
|
||||||
Collator collator = Collator.getInstance();
|
Collator collator = Collator.getInstance();
|
||||||
|
@ -154,8 +157,19 @@ public class VClassGroup extends LinkedList <VClass> implements Comparable<VClas
|
||||||
}
|
}
|
||||||
int diff = (this.getDisplayRank() - o2.getDisplayRank());
|
int diff = (this.getDisplayRank() - o2.getDisplayRank());
|
||||||
if (diff == 0 ) {
|
if (diff == 0 ) {
|
||||||
|
|
||||||
|
//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 collator.compare(this.getPublicName(),o2.getPublicName());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return diff;
|
return diff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue