Skip to content

Commit 3beed0d

Browse files
authored
NIFI-15405 Added Checkstyle indentation and comments indentation rules (#10710)
Signed-off-by: David Handermann <exceptionfactory@apache.org>
1 parent 5699759 commit 3beed0d

242 files changed

Lines changed: 8584 additions & 8860 deletions

File tree

Some content is hidden

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

‎c2/c2-client-bundle/c2-client-http/src/main/java/org/apache/nifi/c2/client/http/url/LegacyC2UrlProvider.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ public String getCallbackUrl(String absoluteUrl, String relativeUrl) {
4949
return Optional.ofNullable(absoluteUrl)
5050
.filter(StringUtils::isNotBlank)
5151
.orElseThrow( () -> {
52-
LOG.error("Provided absolute url was empty or null. Relative urls are not supported with this configuration");
53-
throw new IllegalArgumentException("Provided absolute url was empty or null. Relative C2 urls are not supported with this configuration");
52+
LOG.error("Provided absolute url was empty or null. Relative urls are not supported with this configuration");
53+
throw new IllegalArgumentException("Provided absolute url was empty or null. Relative C2 urls are not supported with this configuration");
5454
});
5555
}
5656
}

‎c2/c2-client-bundle/c2-client-service/src/main/java/org/apache/nifi/c2/client/service/C2HeartbeatManager.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ private void processResponse(C2HeartbeatResponse response) {
7272
ofNullable(response.getRequestedOperations())
7373
.filter(not(List::isEmpty))
7474
.ifPresentOrElse(operations -> {
75-
LOGGER.info("Received {} operations from the C2 server", operations.size());
76-
operations.forEach(c2OperationManager::add);
77-
},
75+
LOGGER.info("Received {} operations from the C2 server", operations.size());
76+
operations.forEach(c2OperationManager::add);
77+
},
7878
() -> LOGGER.debug("No operations received from the C2 server")
7979
);
8080
}

‎c2/c2-client-bundle/c2-client-service/src/main/java/org/apache/nifi/c2/client/service/operation/StartFlowOperationHandler.java‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ public C2OperationAck handle(C2Operation operation) {
6464

6565
C2OperationState resultState = operationState(
6666
operationState,
67-
switch (operationState) {
68-
case NOT_APPLIED -> NOT_APPLIED_DETAILS;
69-
case FULLY_APPLIED -> FULLY_APPLIED_DETAILS;
70-
case PARTIALLY_APPLIED -> PARTIALLY_APPLIED_DETAILS;
71-
default -> UNEXPECTED_DETAILS;
72-
}
67+
switch (operationState) {
68+
case NOT_APPLIED -> NOT_APPLIED_DETAILS;
69+
case FULLY_APPLIED -> FULLY_APPLIED_DETAILS;
70+
case PARTIALLY_APPLIED -> PARTIALLY_APPLIED_DETAILS;
71+
default -> UNEXPECTED_DETAILS;
72+
}
7373
);
7474

7575
return operationAck(operationId, resultState);

‎c2/c2-client-bundle/c2-client-service/src/main/java/org/apache/nifi/c2/client/service/operation/StopFlowOperationHandler.java‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ public C2OperationAck handle(C2Operation operation) {
6464

6565
C2OperationState resultState = operationState(
6666
operationState,
67-
switch (operationState) {
68-
case NOT_APPLIED -> NOT_APPLIED_DETAILS;
69-
case FULLY_APPLIED -> FULLY_APPLIED_DETAILS;
70-
case PARTIALLY_APPLIED -> PARTIALLY_APPLIED_DETAILS;
71-
default -> UNEXPECTED_DETAILS;
72-
}
67+
switch (operationState) {
68+
case NOT_APPLIED -> NOT_APPLIED_DETAILS;
69+
case FULLY_APPLIED -> FULLY_APPLIED_DETAILS;
70+
case PARTIALLY_APPLIED -> PARTIALLY_APPLIED_DETAILS;
71+
default -> UNEXPECTED_DETAILS;
72+
}
7373
);
7474

7575
return operationAck(operationId, resultState);

‎c2/c2-client-bundle/c2-client-service/src/main/java/org/apache/nifi/c2/client/service/operation/SyncResourceOperationHandler.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public C2OperationAck handle(C2Operation operation) {
9898

9999
List<ResourceItem> resourceItems;
100100
try {
101-
resourceItems = getOperationArg(operation, RESOURCE_LIST_FIELD, new TypeReference<>() { }, c2Serializer);
101+
resourceItems = getOperationArg(operation, RESOURCE_LIST_FIELD, new TypeReference<>() { }, c2Serializer);
102102

103103
} catch (Exception e) {
104104
LOG.error("Resource item list could not be constructed from C2 request");

‎checkstyle.xml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,14 @@
8787
<property name="allowedAnnotations" value="Override,Test,BeforeClass,AfterClass,Before,After"/>
8888
</module>
8989
<module name="SingleLineJavadoc"/>
90+
<module name="Indentation">
91+
<property name="basicOffset" value="4"/>
92+
<property name="braceAdjustment" value="0"/>
93+
<property name="caseIndent" value="4"/>
94+
<property name="throwsIndent" value="4"/>
95+
<property name="lineWrappingIndentation" value="4"/>
96+
<property name="arrayInitIndent" value="8"/>
97+
</module>
98+
<module name="CommentsIndentation"/>
9099
</module>
91100
</module>

‎minifi/minifi-bootstrap/src/main/java/org/apache/nifi/minifi/bootstrap/command/CommandRunnerFactory.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ public CommandRunnerFactory(MiNiFiCommandSender miNiFiCommandSender, CurrentPort
7878
public CommandRunner getRunner(BootstrapCommand command) {
7979
CommandRunner commandRunner = switch (command) {
8080
case START, RUN ->
81-
new StartRunner(currentPortProvider, bootstrapFileProvider, periodicStatusReporterManager, miNiFiStdLogHandler, miNiFiParameters,
82-
bootstrapConfigFile, runMiNiFi, miNiFiExecCommandProvider, configurationChangeListener);
81+
new StartRunner(currentPortProvider, bootstrapFileProvider, periodicStatusReporterManager, miNiFiStdLogHandler, miNiFiParameters,
82+
bootstrapConfigFile, runMiNiFi, miNiFiExecCommandProvider, configurationChangeListener);
8383
case STOP ->
84-
new StopRunner(bootstrapFileProvider, miNiFiParameters, miNiFiCommandSender, currentPortProvider, gracefulShutdownParameterProvider, processUtils);
84+
new StopRunner(bootstrapFileProvider, miNiFiParameters, miNiFiCommandSender, currentPortProvider, gracefulShutdownParameterProvider, processUtils);
8585
case STATUS -> new StatusRunner(miNiFiParameters, miNiFiStatusProvider);
8686
case RESTART -> new CompositeCommandRunner(getRestartServices());
8787
case DUMP -> new DumpRunner(miNiFiCommandSender, currentPortProvider);

‎minifi/minifi-commons/minifi-commons-framework/src/main/java/org/apache/nifi/minifi/commons/service/StandardFlowPropertyAssetReferenceResolverService.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public void resolveAssetReferenceProperties(VersionedDataflow flow) {
4949
component.getProperties().entrySet().stream()
5050
.filter(e -> isAssetReference(e.getValue()))
5151
.forEach(entry -> entry.setValue(getAssetAbsolutePathOrThrowIllegalStateException(entry.getValue())));
52-
});
52+
});
5353
}
5454

5555
private boolean isAssetReference(String value) {

‎minifi/minifi-commons/minifi-commons-framework/src/test/java/org/apache/nifi/minifi/commons/service/StandardFlowPropertyEncryptorTest.java‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -309,12 +309,11 @@ private void assertSensitiveFlowComponentPropertiesAreEncoded(VersionedDataflow
309309
.map(VersionedConfigurableExtension::getProperties)
310310
.flatMap(properties -> properties.entrySet().stream())
311311
.forEach(propertyEntry -> {
312-
if (propertyEntry.getKey().startsWith(SENSITIVE_PROPERTY_NAME_PREFIX)) {
313-
assertTrue(propertyEntry.getValue().startsWith(FlowSerializer.ENC_PREFIX));
314-
} else {
315-
assertFalse(propertyEntry.getValue().startsWith(FlowSerializer.ENC_PREFIX));
316-
}
312+
if (propertyEntry.getKey().startsWith(SENSITIVE_PROPERTY_NAME_PREFIX)) {
313+
assertTrue(propertyEntry.getValue().startsWith(FlowSerializer.ENC_PREFIX));
314+
} else {
315+
assertFalse(propertyEntry.getValue().startsWith(FlowSerializer.ENC_PREFIX));
317316
}
318-
);
317+
});
319318
}
320319
}

‎minifi/minifi-nar-bundles/minifi-framework-bundle/minifi-framework/minifi-framework-core/src/main/java/org/apache/nifi/minifi/c2/command/AgentPropertyValidationContext.java‎

Lines changed: 79 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -29,83 +29,83 @@
2929

3030
public class AgentPropertyValidationContext implements ValidationContext {
3131

32-
@Override
33-
public boolean isExpressionLanguageSupported(String propertyName) {
34-
return false;
35-
}
36-
37-
@Override
38-
public Map<PropertyDescriptor, String> getProperties() {
39-
throw new UnsupportedOperationException();
40-
}
41-
42-
@Override
43-
public Map<String, String> getAllProperties() {
44-
throw new UnsupportedOperationException();
45-
}
46-
47-
@Override
48-
public ControllerServiceLookup getControllerServiceLookup() {
49-
throw new UnsupportedOperationException();
50-
}
51-
52-
@Override
53-
public ValidationContext getControllerServiceValidationContext(ControllerService controllerService) {
54-
throw new UnsupportedOperationException();
55-
}
56-
57-
@Override
58-
public ExpressionLanguageCompiler newExpressionLanguageCompiler() {
59-
throw new UnsupportedOperationException();
60-
}
61-
62-
@Override
63-
public PropertyValue newPropertyValue(String value) {
64-
throw new UnsupportedOperationException();
65-
}
66-
67-
@Override
68-
public String getAnnotationData() {
69-
throw new UnsupportedOperationException();
70-
}
71-
72-
@Override
73-
public boolean isValidationRequired(ControllerService service) {
74-
throw new UnsupportedOperationException();
75-
}
76-
77-
@Override
78-
public boolean isExpressionLanguagePresent(String value) {
79-
throw new UnsupportedOperationException();
80-
}
81-
82-
@Override
83-
public String getProcessGroupIdentifier() {
84-
throw new UnsupportedOperationException();
85-
}
86-
87-
@Override
88-
public Collection<String> getReferencedParameters(String propertyName) {
89-
throw new UnsupportedOperationException();
90-
}
91-
92-
@Override
93-
public boolean isParameterDefined(String parameterName) {
94-
throw new UnsupportedOperationException();
95-
}
96-
97-
@Override
98-
public boolean isParameterSet(String parameterName) {
99-
throw new UnsupportedOperationException();
100-
}
101-
102-
@Override
103-
public boolean isDependencySatisfied(PropertyDescriptor propertyDescriptor, Function<String, PropertyDescriptor> propertyDescriptorLookup) {
104-
throw new UnsupportedOperationException();
105-
}
106-
107-
@Override
108-
public PropertyValue getProperty(PropertyDescriptor descriptor) {
109-
throw new UnsupportedOperationException();
110-
}
32+
@Override
33+
public boolean isExpressionLanguageSupported(String propertyName) {
34+
return false;
35+
}
36+
37+
@Override
38+
public Map<PropertyDescriptor, String> getProperties() {
39+
throw new UnsupportedOperationException();
40+
}
41+
42+
@Override
43+
public Map<String, String> getAllProperties() {
44+
throw new UnsupportedOperationException();
45+
}
46+
47+
@Override
48+
public ControllerServiceLookup getControllerServiceLookup() {
49+
throw new UnsupportedOperationException();
50+
}
51+
52+
@Override
53+
public ValidationContext getControllerServiceValidationContext(ControllerService controllerService) {
54+
throw new UnsupportedOperationException();
55+
}
56+
57+
@Override
58+
public ExpressionLanguageCompiler newExpressionLanguageCompiler() {
59+
throw new UnsupportedOperationException();
60+
}
61+
62+
@Override
63+
public PropertyValue newPropertyValue(String value) {
64+
throw new UnsupportedOperationException();
65+
}
66+
67+
@Override
68+
public String getAnnotationData() {
69+
throw new UnsupportedOperationException();
70+
}
71+
72+
@Override
73+
public boolean isValidationRequired(ControllerService service) {
74+
throw new UnsupportedOperationException();
75+
}
76+
77+
@Override
78+
public boolean isExpressionLanguagePresent(String value) {
79+
throw new UnsupportedOperationException();
80+
}
81+
82+
@Override
83+
public String getProcessGroupIdentifier() {
84+
throw new UnsupportedOperationException();
85+
}
86+
87+
@Override
88+
public Collection<String> getReferencedParameters(String propertyName) {
89+
throw new UnsupportedOperationException();
90+
}
91+
92+
@Override
93+
public boolean isParameterDefined(String parameterName) {
94+
throw new UnsupportedOperationException();
95+
}
96+
97+
@Override
98+
public boolean isParameterSet(String parameterName) {
99+
throw new UnsupportedOperationException();
100+
}
101+
102+
@Override
103+
public boolean isDependencySatisfied(PropertyDescriptor propertyDescriptor, Function<String, PropertyDescriptor> propertyDescriptorLookup) {
104+
throw new UnsupportedOperationException();
105+
}
106+
107+
@Override
108+
public PropertyValue getProperty(PropertyDescriptor descriptor) {
109+
throw new UnsupportedOperationException();
110+
}
111111
}

0 commit comments

Comments
 (0)