Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite652435

Browse files
committed
issue: 修复isMatch方法终态判断的问题
1 parent3a8d5f8 commite652435

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

‎squirrel-foundation/src/main/java/org/squirrelframework/foundation/fsm/impl/TransitionImpl.java‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,9 @@ public void accept(Visitor visitor) {
220220

221221
@Override
222222
publicbooleanisMatch(SfromState,StoState,Eevent,intpriority) {
223-
if(toState==null && !getTargetState().isFinalState())
223+
if(toState==null)
224224
returnfalse;
225-
if(toState!=null && !getTargetState().isFinalState() &&
226-
!getTargetState().getStateId().equals(toState))
225+
if(toState!=null && !getTargetState().getStateId().equals(toState))
227226
returnfalse;
228227
if(!getEvent().equals(event))
229228
returnfalse;

‎squirrel-foundation/src/test/java/org/squirrelframework/foundation/fsm/issue/NormalStateMachineInit.java‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,19 @@
55

66
importjava.util.*;
77

8+
importstaticorg.junit.Assert.assertNotNull;
9+
810

911
publicclassNormalStateMachineInit {
1012

1113

1214
/**
13-
* 定义终态、相同的event下、使用了mvel表达式且没有命名,在checkConflictTransitions方法中会认为使用了相同的Transition,抛异常
15+
* 问题:定义终态、相同的event下、使用了mvel表达式且没有命名,在checkConflictTransitions方法中会认为使用了相同的Transition,抛异常。
16+
* 修复:isMatch方法去掉终态的判断
1417
* @see org.squirrelframework.foundation.fsm.impl.StateImpl#checkConflictTransitions
1518
* @see org.squirrelframework.foundation.fsm.impl.TransitionImpl#isMatch(S, S, E, int)
1619
*/
17-
@Test(expected =Exception.class)
20+
@Test
1821
publicvoidinitSignUpStateMachine() {
1922

2023
StateMachineBuilder<SignupStateMachine,SignUpStatusEnum,BusinessEventEnum,Map>builder =
@@ -47,6 +50,7 @@ public void initSignUpStateMachine() {
4750

4851
// 初始化状态机对象
4952
SignupStateMachinesignupStateMachine =builder.newStateMachine(SignUpStatusEnum.START);
53+
assertNotNull(signupStateMachine);
5054
}
5155

5256
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp