Skip to content
Snippets Groups Projects
Commit 882156c0 authored by Christian Wulf's avatar Christian Wulf
Browse files

refactored Stage

parent 9640e66f
No related branches found
No related tags found
No related merge requests found
...@@ -34,16 +34,16 @@ public abstract class Stage { // NOPMD (should not start with "Abstract" ...@@ -34,16 +34,16 @@ public abstract class Stage { // NOPMD (should not start with "Abstract"
} }
private String createId() { private String createId() {
int instances = 0;
String simpleName = this.getClass().getSimpleName(); String simpleName = this.getClass().getSimpleName();
if (INSTANCES_COUNTER.containsKey(simpleName)) { Integer numInstances = INSTANCES_COUNTER.get(simpleName);
instances = INSTANCES_COUNTER.get(simpleName); if (null == numInstances) {
numInstances = 0;
} }
String id = simpleName + "-" + instances; String newId = simpleName + "-" + numInstances;
INSTANCES_COUNTER.put(simpleName, ++instances); INSTANCES_COUNTER.put(simpleName, ++numInstances);
return id; return newId;
} }
// public abstract Stage getParentStage(); // public abstract Stage getParentStage();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment