private String[] getDisplayedFeatureGroups()
{
String[] gps = null;
+ ArrayList<String> _gps = new ArrayList<String>();
if (fr != null)
{
if (fr.featureGroups != null)
{
Iterator en = fr.featureGroups.keySet().iterator();
- gps = new String[fr.featureColours.size()];
int g = 0;
boolean valid = false;
while (en.hasNext())
if (on != null && on.booleanValue())
{
valid = true;
- gps[g++] = gp;
+ _gps.add(gp);
}
}
- while (g < gps.length)
- {
- gps[g++] = null;
- }
if (!valid)
{
return null;
+ } else {
+ gps = new String[_gps.size()];
+ _gps.toArray(gps);
}
}
}