-
Notifications
You must be signed in to change notification settings - Fork 319
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
Add SCXML language module #1030
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smjonas, there are a few issues you need to resolve.
languages/scxml/src/main/java/de/jplag/scxml/ScxmlTokenType.java
Outdated
Show resolved
Hide resolved
* its type is stored. This can be used to "peek" at a list of token types that are extracted when visiting a | ||
* statechart. | ||
*/ | ||
public class PeekAdapter extends ScxmlParserAdapter { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You extend the parser adapter. Thus this class is still functionally a full parser adapter. The name and comment, however, do not reflect that. Could you elaborate on the design here?
...es/scxml/src/main/java/de/jplag/scxml/parser/model/executable_content/ExecutableContent.java
Outdated
Show resolved
Hide resolved
languages/scxml/src/main/java/de/jplag/scxml/sorting/SortingStrategy.java
Outdated
Show resolved
Hide resolved
languages/scxml/src/main/java/de/jplag/scxml/util/AbstractScxmlVisitor.java
Outdated
Show resolved
Hide resolved
languages/scxml/src/test/java/de/jplag/scxml/ScxmlParserTest.java
Outdated
Show resolved
Hide resolved
@smjonas, please also fix the build error and apply spotless. If there are any issues, let me know. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally the tests build (javadoc) needs to be fixed :)
@smjonas after you implemented our feedback, take a look at the code smells detected by Sonar and fix them! 👍 |
c81dc82
to
6304ce9
Compare
@tsaglam The remaining detected code smell seems to be a false-positive as the explicit constructor performs additional checks |
Maybe sonarlint is just complaining about the redundancy of the parameters. In records you can omit the parameters (and brackets) of the default constructor. E.g., https://www.baeldung.com/java-records-custom-constructor (3.) |
I tried to change it to /**
* Constructs a new state.
* @throws IllegalArgumentException if {@code transitions} or {@code substates} is null
*/
public State {
if (transitions == null) {
throw new IllegalArgumentException("State.transitions must not be null");
}
if (substates == null) {
throw new IllegalArgumentException("State.substates must not be null");
}
updateTimedTransitions();
} but that won't work because /**
* Constructs a new state.
* @throws IllegalArgumentException if {@code transitions} or {@code substates} is null
*/
public State(String id, List<Transition> transitions, List<State> substates, List<Action> actions, boolean initial, boolean parallel) {
if (transitions == null) {
throw new IllegalArgumentException("State.transitions must not be null");
}
if (substates == null) {
throw new IllegalArgumentException("State.substates must not be null");
}
this.id = id;
this.transitions = transitions;
this.substates = substates;
this.actions = actions;
this.initial = initial;
this.parallel = parallel;
updateTimedTransitions();
} ). |
Kudos, SonarCloud Quality Gate passed! |
Seems to be false positive. I'll mark it that way. |
Adds support for statecharts defined in the SCXML format.