Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize: add StateType Enum #6891

Open
wants to merge 17 commits into
base: 2.x
Choose a base branch
from

Conversation

MaoMaoandSnail
Copy link
Contributor

  • I have registered the PR changes.

Ⅰ. Describe what this PR did

optimize: computeIfAbsent get twice
optimize: createProcessorController code order
optimize: add StateType Enum

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import java.util.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

Copy link

codecov bot commented Oct 23, 2024

Codecov Report

Attention: Patch coverage is 92.10526% with 3 lines in your changes missing coverage. Please review.

Project coverage is 52.62%. Comparing base (dbe095a) to head (95090e8).

Files with missing lines Patch % Lines
.../apache/seata/saga/statelang/domain/StateType.java 88.88% 1 Missing and 1 partial ⚠️
...saga/statelang/domain/impl/LoopStartStateImpl.java 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##                2.x    #6891   +/-   ##
=========================================
  Coverage     52.61%   52.62%           
- Complexity     6579     6580    +1     
=========================================
  Files          1126     1127    +1     
  Lines         39928    39947   +19     
  Branches       4680     4683    +3     
=========================================
+ Hits          21010    21023   +13     
- Misses        16916    16918    +2     
- Partials       2002     2006    +4     
Files with missing lines Coverage Δ
...ta/saga/statelang/domain/impl/ChoiceStateImpl.java 89.47% <100.00%> (ø)
...omain/impl/CompensateSubStateMachineStateImpl.java 100.00% <100.00%> (ø)
...lang/domain/impl/CompensationTriggerStateImpl.java 100.00% <100.00%> (ø)
...a/saga/statelang/domain/impl/FailEndStateImpl.java 100.00% <100.00%> (ø)
...aga/statelang/domain/impl/ScriptTaskStateImpl.java 100.00% <100.00%> (ø)
...ga/statelang/domain/impl/ServiceTaskStateImpl.java 75.00% <100.00%> (ø)
...aga/statelang/domain/impl/SubStateMachineImpl.java 100.00% <100.00%> (ø)
...aga/statelang/domain/impl/SucceedEndStateImpl.java 100.00% <100.00%> (ø)
...eata/saga/statelang/parser/StateParserFactory.java 91.66% <100.00%> (ø)
...saga/statelang/parser/utils/StateMachineUtils.java 92.30% <100.00%> (+0.64%) ⬆️
... and 3 more

... and 4 files with indirect coverage changes

}

TaskStateRouter taskStateRouter = new TaskStateRouter();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So many getValues are not very elegant, it is recommended to centralize them in the method.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants