Skip to content

Commit 21c51ca

Browse files
authored
Merge pull request #102 from tsurdilo/formatplus
formatting and stylecheck enforce
2 parents 98a829e + f8b3ece commit 21c51ca

File tree

81 files changed

+559
-433
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+559
-433
lines changed

api/pom.xml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,46 @@
112112
</execution>
113113
</executions>
114114
</plugin>
115+
<plugin>
116+
<groupId>org.apache.maven.plugins</groupId>
117+
<artifactId>maven-checkstyle-plugin</artifactId>
118+
<configuration>
119+
<checkstyleRules>
120+
<module name="Checker">
121+
<module name="RegexpHeader">
122+
<property name="header" value="${checkstyle.header.template}"/>
123+
<property name="fileExtensions" value="${checkstyle.header.extensions}"/>
124+
</module>
125+
<module name="TreeWalker">
126+
<module name="RegexpSinglelineJava">
127+
<property name="format" value="@author"/>
128+
<property name="message" value="No @author tag allowed"/>
129+
</module>
130+
</module>
131+
</module>
132+
</checkstyleRules>
133+
<outputFile>${project.build.directory}/checkstyle.log</outputFile>
134+
<includeTestSourceDirectory>true</includeTestSourceDirectory>
135+
<includeResources>true</includeResources>
136+
<includeTestResources>true</includeTestResources>
137+
<consoleOutput>false</consoleOutput>
138+
<failsOnError>false</failsOnError>
139+
<logViolationsToConsole>${checkstyle.logViolationsToConsole}</logViolationsToConsole>
140+
<failOnViolation>${checkstyle.failOnViolation}</failOnViolation>
141+
<sourceDirectories>
142+
<sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
143+
<sourceDirectory>${project.build.testSourceDirectory}</sourceDirectory>
144+
</sourceDirectories>
145+
</configuration>
146+
<executions>
147+
<execution>
148+
<phase>compile</phase>
149+
<goals>
150+
<goal>check</goal>
151+
</goals>
152+
</execution>
153+
</executions>
154+
</plugin>
115155
</plugins>
116156
</build>
117157
</project>

api/src/main/java/io/serverlessworkflow/api/deserializers/CronDeserializer.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
/*
22
* Copyright 2020-Present The Serverless Workflow Specification Authors
3-
* <p>
3+
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
7-
* <p>
7+
*
88
* http://www.apache.org/licenses/LICENSE-2.0
9-
* <p>
9+
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
15-
*
1615
*/
1716
package io.serverlessworkflow.api.deserializers;
1817

@@ -47,7 +46,7 @@ public CronDeserializer(WorkflowPropertySource context) {
4746

4847
@Override
4948
public Cron deserialize(JsonParser jp,
50-
DeserializationContext ctxt) throws IOException {
49+
DeserializationContext ctxt) throws IOException {
5150

5251
JsonNode node = jp.getCodec().readTree(jp);
5352

@@ -57,11 +56,11 @@ public Cron deserialize(JsonParser jp,
5756
cron.setExpression(node.asText());
5857
return cron;
5958
} else {
60-
if(node.get("expression") != null) {
59+
if (node.get("expression") != null) {
6160
cron.setExpression(node.get("expression").asText());
6261
}
6362

64-
if(node.get("validUntil") != null) {
63+
if (node.get("validUntil") != null) {
6564
cron.setValidUntil(node.get("validUntil").asText());
6665
}
6766

api/src/main/java/io/serverlessworkflow/api/deserializers/DataInputSchemaDeserializer.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
/*
22
* Copyright 2020-Present The Serverless Workflow Specification Authors
3-
* <p>
3+
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
7-
* <p>
7+
*
88
* http://www.apache.org/licenses/LICENSE-2.0
9-
* <p>
9+
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
15-
*
1615
*/
1716
package io.serverlessworkflow.api.deserializers;
1817

@@ -22,6 +21,7 @@
2221
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
2322
import io.serverlessworkflow.api.datainputschema.DataInputSchema;
2423
import io.serverlessworkflow.api.interfaces.WorkflowPropertySource;
24+
2525
import java.io.IOException;
2626

2727
public class DataInputSchemaDeserializer extends StdDeserializer<DataInputSchema> {

api/src/main/java/io/serverlessworkflow/api/deserializers/DefaultStateTypeDeserializer.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
/*
22
* Copyright 2020-Present The Serverless Workflow Specification Authors
3-
* <p>
3+
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
7-
* <p>
7+
*
88
* http://www.apache.org/licenses/LICENSE-2.0
9-
* <p>
9+
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
15-
*
1615
*/
1716
package io.serverlessworkflow.api.deserializers;
1817

api/src/main/java/io/serverlessworkflow/api/deserializers/EndDefinitionDeserializer.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
/*
22
* Copyright 2020-Present The Serverless Workflow Specification Authors
3-
* <p>
3+
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
7-
* <p>
7+
*
88
* http://www.apache.org/licenses/LICENSE-2.0
9-
* <p>
9+
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
15-
*
1615
*/
1716
package io.serverlessworkflow.api.deserializers;
1817

@@ -52,7 +51,7 @@ public EndDefinitionDeserializer(WorkflowPropertySource context) {
5251

5352
@Override
5453
public End deserialize(JsonParser jp,
55-
DeserializationContext ctxt) throws IOException {
54+
DeserializationContext ctxt) throws IOException {
5655

5756
ObjectMapper mapper = (ObjectMapper) jp.getCodec();
5857
JsonNode node = jp.getCodec().readTree(jp);
@@ -65,21 +64,21 @@ public End deserialize(JsonParser jp,
6564
end.setTerminate(false);
6665
return node.asBoolean() ? end : null;
6766
} else {
68-
if(node.get("produceEvents") != null) {
69-
List<ProduceEvent> produceEvents= new ArrayList<>();
67+
if (node.get("produceEvents") != null) {
68+
List<ProduceEvent> produceEvents = new ArrayList<>();
7069
for (final JsonNode nodeEle : node.get("produceEvents")) {
7170
produceEvents.add(mapper.treeToValue(nodeEle, ProduceEvent.class));
7271
}
7372
end.setProduceEvents(produceEvents);
7473
}
7574

76-
if(node.get("terminate") != null) {
75+
if (node.get("terminate") != null) {
7776
end.setTerminate(node.get("terminate").asBoolean());
7877
} else {
7978
end.setTerminate(false);
8079
}
8180

82-
if(node.get("compensate") != null) {
81+
if (node.get("compensate") != null) {
8382
end.setCompensate(node.get("compensate").asBoolean());
8483
} else {
8584
end.setCompensate(false);

api/src/main/java/io/serverlessworkflow/api/deserializers/EventDefinitionKindDeserializer.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
/*
22
* Copyright 2020-Present The Serverless Workflow Specification Authors
3-
* <p>
3+
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
7-
* <p>
7+
*
88
* http://www.apache.org/licenses/LICENSE-2.0
9-
* <p>
9+
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
15-
*
1615
*/
1716
package io.serverlessworkflow.api.deserializers;
1817

api/src/main/java/io/serverlessworkflow/api/deserializers/EventsDeserializer.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
/*
22
* Copyright 2020-Present The Serverless Workflow Specification Authors
3-
* <p>
3+
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
7-
* <p>
7+
*
88
* http://www.apache.org/licenses/LICENSE-2.0
9-
* <p>
9+
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
15-
*
1615
*/
1716
package io.serverlessworkflow.api.deserializers;
1817

api/src/main/java/io/serverlessworkflow/api/deserializers/ExtensionDeserializer.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
/*
22
* Copyright 2020-Present The Serverless Workflow Specification Authors
3-
* <p>
3+
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
7-
* <p>
7+
*
88
* http://www.apache.org/licenses/LICENSE-2.0
9-
* <p>
9+
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
15-
*
1615
*/
1716
package io.serverlessworkflow.api.deserializers;
1817

api/src/main/java/io/serverlessworkflow/api/deserializers/FunctionDefinitionTypeDeserializer.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
/*
22
* Copyright 2020-Present The Serverless Workflow Specification Authors
3-
* <p>
3+
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
7-
* <p>
7+
*
88
* http://www.apache.org/licenses/LICENSE-2.0
9-
* <p>
9+
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
15-
*
1615
*/
1716
package io.serverlessworkflow.api.deserializers;
1817

@@ -48,7 +47,7 @@ public FunctionDefinitionTypeDeserializer(Class<?> vc) {
4847

4948
@Override
5049
public FunctionDefinition.Type deserialize(JsonParser jp,
51-
DeserializationContext ctxt) throws IOException {
50+
DeserializationContext ctxt) throws IOException {
5251

5352
String value = jp.getText();
5453
if (context != null) {

api/src/main/java/io/serverlessworkflow/api/deserializers/FunctionRefDeserializer.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
/*
22
* Copyright 2020-Present The Serverless Workflow Specification Authors
3-
* <p>
3+
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
7-
* <p>
7+
*
88
* http://www.apache.org/licenses/LICENSE-2.0
9-
* <p>
9+
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
15-
*
1615
*/
1716
package io.serverlessworkflow.api.deserializers;
1817

@@ -48,7 +47,7 @@ public FunctionRefDeserializer(WorkflowPropertySource context) {
4847

4948
@Override
5049
public FunctionRef deserialize(JsonParser jp,
51-
DeserializationContext ctxt) throws IOException {
50+
DeserializationContext ctxt) throws IOException {
5251

5352
ObjectMapper mapper = (ObjectMapper) jp.getCodec();
5453
JsonNode node = jp.getCodec().readTree(jp);
@@ -60,11 +59,11 @@ public FunctionRef deserialize(JsonParser jp,
6059
functionRef.setArguments(null);
6160
return functionRef;
6261
} else {
63-
if(node.get("arguments") != null) {
62+
if (node.get("arguments") != null) {
6463
functionRef.setArguments(mapper.treeToValue(node.get("arguments"), JsonNode.class));
6564
}
6665

67-
if(node.get("refName") != null) {
66+
if (node.get("refName") != null) {
6867
functionRef.setRefName(node.get("refName").asText());
6968
}
7069

0 commit comments

Comments
 (0)