Skip to content

Commit 7245eba

Browse files
author
Pascal Dal Farra
committed
chore: keep hiddenTransitions sorted + fix getArrowLength
1 parent 42ccaa4 commit 7245eba

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

spring-statemachine-uml/src/main/java/org/springframework/statemachine/plantuml/PlantUmlWriterParameters.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
import java.util.HashMap;
2525
import java.util.Map;
26+
import java.util.TreeMap;
2627
import java.util.TreeSet;
2728
import java.util.stream.Collectors;
2829

@@ -188,21 +189,18 @@ String getDirection(S source, S target) {
188189
}
189190

190191
String getArrowLength(S source, S target) {
191-
if(source == null) {
192-
return Arrow.DEFAULT.getLengthAsString();
193-
}
194192
return getArrow(source, target).getLengthAsString();
195193
}
196194

197195
/**
198-
* Map of ( Connection(sourceSate, targetState) -> Direction )
196+
* Map of <code>Connection(sourceSate, targetState) -> Direction</code>
199197
* Used to add EXTRA HIDDEN arrows, which are just helping with diagram layout.<BR/>
200-
* This is typically useful to 'force' the position of a state comparing to another, EVEN IF THESE TWO STATES AR NOT CONNECTED in the statemachine :-)<BR/>
198+
* This is typically useful to position a State relative to another, EVEN IF THESE TWO STATES AR NOT CONNECTED in the statemachine :-)<BR/>
201199
* <p>
202200
* exemple:
203201
* S1 -left[hidden]-> S2
204202
*/
205-
private final Map<Connection<S>, Direction> additionalHiddenTransitions = new HashMap<>();
203+
private final Map<Connection<S>, Direction> additionalHiddenTransitions = new TreeMap<>();
206204

207205
/**
208206
* Add EXTRA HIDDEN transitions to align states WIHTOUT connecting them.<BR/>

0 commit comments

Comments
 (0)