Skip to content

Commit 0898f6e

Browse files
committed
Upgrade to Checkstyle 8.1 and fix violations
1 parent c4a3fcd commit 0898f6e

File tree

6 files changed

+17
-14
lines changed

6 files changed

+17
-14
lines changed

Diff for: build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jacoco {
9696

9797
checkstyle {
9898
configFile = file("${rootDir}/src/checkstyle/checkstyle.xml")
99-
toolVersion = "8.0"
99+
toolVersion = "8.1"
100100
}
101101

102102
dependencies {

Diff for: src/checkstyle/checkstyle.xml

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
</module>
6868
<module name="MultipleVariableDeclarations" />
6969
<module name="RequireThis">
70+
<property name="validateOnlyOverlapping" value="false" />
7071
<property name="checkMethods" value="false" />
7172
</module>
7273
<module name="OneStatementPerLine" />

Diff for: src/main/java/org/springframework/integration/aws/metadata/DynamoDbMetaDataStore.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public void setWriteCapacity(Long writeCapacity) {
110110
public void afterPropertiesSet() throws Exception {
111111
try {
112112
this.table.describe();
113-
createTableLatch.countDown();
113+
this.createTableLatch.countDown();
114114
return;
115115
}
116116
catch (ResourceNotFoundException e) {
@@ -197,7 +197,6 @@ public void put(String key, String value) {
197197
public String get(String key) {
198198
Assert.hasText(key, "'key' must not be empty.");
199199

200-
201200
awaitForActive();
202201

203202
Item item = this.table.getItem(KEY, key);

Diff for: src/test/java/org/springframework/integration/aws/KinesisLocalRunning.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,13 @@ public Statement apply(Statement base, Description description) {
9595

9696

9797
return new Statement() {
98+
99+
@Override
98100
public void evaluate() throws Throwable {
99101
try {
100102
base.evaluate();
101-
} finally {
103+
}
104+
finally {
102105
System.clearProperty(SDKGlobalConfiguration.AWS_CBOR_DISABLE_SYSTEM_PROPERTY);
103106
}
104107

Diff for: src/test/java/org/springframework/integration/aws/inbound/SnsInboundChannelAdapterTests.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016 the original author or authors.
2+
* Copyright 2016-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -96,7 +96,7 @@ public void testSubscriptionConfirmation() throws Exception {
9696
.content(StreamUtils.copyToByteArray(this.subscriptionConfirmation.getInputStream())))
9797
.andExpect(status().isNoContent());
9898

99-
Message<?> receive = inputChannel.receive(10000);
99+
Message<?> receive = this.inputChannel.receive(10000);
100100
assertThat(receive).isNotNull();
101101
assertThat(receive.getHeaders().containsKey(AwsHeaders.SNS_MESSAGE_TYPE)).isTrue();
102102
assertThat(receive.getHeaders().get(AwsHeaders.SNS_MESSAGE_TYPE)).isEqualTo("SubscriptionConfirmation");
@@ -121,7 +121,7 @@ public void testNotification() throws Exception {
121121
.content(StreamUtils.copyToByteArray(this.notificationMessage.getInputStream())))
122122
.andExpect(status().isNoContent());
123123

124-
Message<?> receive = inputChannel.receive(10000);
124+
Message<?> receive = this.inputChannel.receive(10000);
125125
assertThat(receive).isNotNull();
126126
Map<String, String> payload = (Map<String, String>) receive.getPayload();
127127

@@ -138,7 +138,7 @@ public void testUnsubscribe() throws Exception {
138138
.content(StreamUtils.copyToByteArray(this.unsubscribeConfirmation.getInputStream())))
139139
.andExpect(status().isNoContent());
140140

141-
Message<?> receive = inputChannel.receive(10000);
141+
Message<?> receive = this.inputChannel.receive(10000);
142142
assertThat(receive).isNotNull();
143143
assertThat(receive.getHeaders().containsKey(AwsHeaders.SNS_MESSAGE_TYPE)).isTrue();
144144
assertThat(receive.getHeaders().get(AwsHeaders.SNS_MESSAGE_TYPE)).isEqualTo("UnsubscribeConfirmation");

Diff for: src/test/java/org/springframework/integration/aws/metadata/DynamoDbMetadataStoreTests.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,13 @@ public void testGetFromStore() {
107107

108108
@Test
109109
public void testPutIfAbsent() throws Exception {
110-
String fileID = store.get(file1);
110+
String fileID = store.get(this.file1);
111111
assertThat(fileID).describedAs("Get First time, Value must not exist").isNull();
112112

113-
fileID = store.putIfAbsent(file1, file1Id);
113+
fileID = store.putIfAbsent(this.file1, this.file1Id);
114114
assertThat(fileID).describedAs("Insert First time, Value must return null").isNull();
115115

116-
fileID = store.putIfAbsent(file1, "56789");
116+
fileID = store.putIfAbsent(this.file1, "56789");
117117
assertThat(fileID).describedAs("Key Already Exists - Insertion Failed, ol value must be returned").isNotNull();
118118
assertThat(fileID).describedAs("The Old Value must be equal to returned").isEqualTo(this.file1Id);
119119

@@ -138,16 +138,16 @@ public void testRemove() throws Exception {
138138

139139
@Test
140140
public void testReplace() throws Exception {
141-
boolean removedValue = store.replace(file1, file1Id, "4567");
141+
boolean removedValue = store.replace(this.file1, this.file1Id, "4567");
142142
assertThat(removedValue).isFalse();
143143

144144
String fileID = store.get(this.file1);
145145
assertThat(fileID).isNull();
146146

147-
fileID = store.putIfAbsent(this.file1, file1Id);
147+
fileID = store.putIfAbsent(this.file1, this.file1Id);
148148
assertThat(fileID).isNull();
149149

150-
removedValue = store.replace(this.file1, file1Id, "4567");
150+
removedValue = store.replace(this.file1, this.file1Id, "4567");
151151
assertThat(removedValue).isTrue();
152152

153153
fileID = store.get(this.file1);

0 commit comments

Comments
 (0)