Commit 2d46ffc2 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

parallel asynchronous access to the method could crash it

parent 3a3933b2
......@@ -98,11 +98,11 @@ public final class ElementUtils {
Reflections reflections = new Reflections("lcsb.mapviewer.model.map");
Set<Class<? extends BioEntity>> classes = reflections.getSubTypesOf(BioEntity.class);
annotatedObjectTree = new ClassTreeNode(BioEntity.class);
annotatedObjectTree.setData(false);
ClassTreeNode result = new ClassTreeNode(BioEntity.class);
result.setData(false);
Map<Class<?>, ClassTreeNode> map = new LinkedHashMap<>();
map.put(Object.class, annotatedObjectTree);
map.put(Object.class, result);
for (Class<? extends BioEntity> class1 : classes) {
if (map.get(class1) == null) {
ClassTreeNode node = new ClassTreeNode(class1);
......@@ -138,7 +138,7 @@ public final class ElementUtils {
for (ClassTreeNode node : map.values()) {
Collections.sort(node.getChildren(), new ClassTreeNodeNameComparator());
}
annotatedObjectTree = result;
}
return annotatedObjectTree;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment