Skip to content

Commit a270d53

Browse files
committed
Minor Fixes
1 parent 0167b62 commit a270d53

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

client/src/webview/renderers/diagram.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export function renderStateMachineView(sm: StateMachine, diagram: string): strin
1010
<p><strong>States:</strong> ${sm.states.join(', ')}</p>
1111
<p><strong>Initial state:</strong> ${sm.initial}</p>
1212
<p><strong>Number of states:</strong> ${sm.states.length}</p>
13-
<p><strong>Number of transitions:</strong> ${sm.transitions.length}</p>
13+
<p><strong>Number of transitions:</strong> ${sm.transitions.length + 1}</p>
1414
</div>
1515
</div>
1616
`;

server/src/main/java/fsm/StateMachineParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ private static List<StateMachineTransition> getTransitions(CtAnnotation<?> ann,
218218
String to = ann.getValueAsString("to");
219219

220220
// if has from but not to, to is the same as from (self-loop)
221-
if (from != null && to == null) {
221+
if (!from.isEmpty() && to.isEmpty()) {
222222
to = from;
223223
}
224224

@@ -227,7 +227,7 @@ private static List<StateMachineTransition> getTransitions(CtAnnotation<?> ann,
227227
List<String> toStates = parseStateExpression(to, states);
228228

229229
// if no from states, use all states
230-
if (fromStates.isEmpty() && to != null) {
230+
if (fromStates.isEmpty()) {
231231
fromStates = new ArrayList<>(states);
232232
}
233233

0 commit comments

Comments
 (0)