fix bug with duplicate value in getResourceNames()
This commit is contained in:
parent
56205ec963
commit
1d4f1e9d90
|
@ -37,9 +37,11 @@ import java.io.IOException;
|
|||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipInputStream;
|
||||
|
||||
|
@ -560,13 +562,12 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon
|
|||
|
||||
@Override
|
||||
public List<String> getResourceNames() {
|
||||
List<String> result = new ArrayList<String>();
|
||||
Set<String> result = new HashSet<String>();
|
||||
for (StructureDefinition sd : listStructures()) {
|
||||
if (sd.getKind() == StructureDefinitionKind.RESOURCE && sd.getDerivation() == TypeDerivationRule.SPECIALIZATION)
|
||||
result.add(sd.getName());
|
||||
}
|
||||
Collections.sort(result);
|
||||
return result;
|
||||
return Utilities.sorted(result);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1297,7 +1297,7 @@ public class Utilities {
|
|||
return id.matches("[A-Za-z0-9\\-\\.]{1,64}");
|
||||
}
|
||||
|
||||
public static List<String> sorted(Set<String> set) {
|
||||
public static List<String> sorted(Collection<String> set) {
|
||||
List<String> list = new ArrayList<>();
|
||||
list.addAll(set);
|
||||
Collections.sort(list);
|
||||
|
|
Loading…
Reference in New Issue