Name[] n = new Name[index?ninds:nsyms];
int j = 0;
for(int i=0;i<defined.length;i++){
if( defined[i] == 0 )
continue;
Name tn = Name.get(i);
if(tn==null)continue;
if( tn.isIndex() != index )
continue;
n[j++] = tn; am getting error here
}
for(int i=1;i<n.length;i++){
Name tn = n[i];
if(tn==null)continue;
String t = n[i].getSortKey();
j = i - 1;
while( j >= 0 && n[j].getSortKey().compareTo(t) > 0 ){
n[j+1] = n[j];
--j;
}
n[++j] = tn;
}
return n;
}