Skip to content

Commit 7e47d78

Browse files
committed
Update Google Checkstyle to latest version
The wasn't updated to the latest Google Checkstyle in years. Fix all violations.
1 parent ef41934 commit 7e47d78

39 files changed

+432
-177
lines changed

etc/checkstyle.xml

Lines changed: 290 additions & 55 deletions
Large diffs are not rendered by default.

server/src/main/java/com/adobe/testing/s3mock/BucketController.java

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ public BucketController(BucketService bucketService) {
8181
this.bucketService = bucketService;
8282
}
8383

84-
//================================================================================================
84+
// ===============================================================================================
8585
// /
86-
//================================================================================================
86+
// ===============================================================================================
8787

8888
/**
8989
* <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBuckets.html">API Reference</a>.
@@ -108,9 +108,9 @@ public ResponseEntity<ListAllMyBucketsResult> listBuckets(
108108
return ResponseEntity.ok(listAllMyBucketsResult);
109109
}
110110

111-
//================================================================================================
111+
// ===============================================================================================
112112
// /{bucketName:.+}
113-
//================================================================================================
113+
// ===============================================================================================
114114

115115
/**
116116
* Create a bucket if the name matches a simplified version of the bucket naming rules.
@@ -119,9 +119,9 @@ public ResponseEntity<ListAllMyBucketsResult> listBuckets(
119119
*/
120120
@PutMapping(
121121
value = {
122-
//AWS SDK V2 pattern
122+
// AWS SDK V2 pattern
123123
"/{bucketName:.+}",
124-
//AWS SDK V1 pattern
124+
// AWS SDK V1 pattern
125125
"/{bucketName:.+}/"
126126
},
127127
params = {
@@ -157,9 +157,9 @@ public ResponseEntity<Void> createBucket(
157157
*/
158158
@RequestMapping(
159159
value = {
160-
//AWS SDK V2 pattern
160+
// AWS SDK V2 pattern
161161
"/{bucketName:.+}",
162-
//AWS SDK V1 pattern
162+
// AWS SDK V1 pattern
163163
"/{bucketName:.+}/"
164164
},
165165
method = RequestMethod.HEAD
@@ -179,9 +179,9 @@ public ResponseEntity<Void> headBucket(@PathVariable final String bucketName) {
179179
*/
180180
@DeleteMapping(
181181
value = {
182-
//AWS SDK V2 pattern
182+
// AWS SDK V2 pattern
183183
"/{bucketName:.+}",
184-
//AWS SDK V1 pattern
184+
// AWS SDK V1 pattern
185185
"/{bucketName:.+}/"
186186
},
187187
params = {
@@ -201,9 +201,9 @@ public ResponseEntity<Void> deleteBucket(@PathVariable String bucketName) {
201201
*/
202202
@GetMapping(
203203
value = {
204-
//AWS SDK V2 pattern
204+
// AWS SDK V2 pattern
205205
"/{bucketName:.+}",
206-
//AWS SDK V1 pattern
206+
// AWS SDK V1 pattern
207207
"/{bucketName:.+}/"
208208
},
209209
params = {
@@ -224,9 +224,9 @@ public ResponseEntity<VersioningConfiguration> getVersioningConfiguration(@PathV
224224
*/
225225
@PutMapping(
226226
value = {
227-
//AWS SDK V2 pattern
227+
// AWS SDK V2 pattern
228228
"/{bucketName:.+}",
229-
//AWS SDK V1 pattern
229+
// AWS SDK V1 pattern
230230
"/{bucketName:.+}/"
231231
},
232232
params = {
@@ -248,9 +248,9 @@ public ResponseEntity<Void> putVersioningConfiguration(
248248
*/
249249
@GetMapping(
250250
value = {
251-
//AWS SDK V2 pattern
251+
// AWS SDK V2 pattern
252252
"/{bucketName:.+}",
253-
//AWS SDK V1 pattern
253+
// AWS SDK V1 pattern
254254
"/{bucketName:.+}/"
255255
},
256256
params = {
@@ -271,9 +271,9 @@ public ResponseEntity<ObjectLockConfiguration> getObjectLockConfiguration(@PathV
271271
*/
272272
@PutMapping(
273273
value = {
274-
//AWS SDK V2 pattern
274+
// AWS SDK V2 pattern
275275
"/{bucketName:.+}",
276-
//AWS SDK V1 pattern
276+
// AWS SDK V1 pattern
277277
"/{bucketName:.+}/"
278278
},
279279
params = {
@@ -294,9 +294,9 @@ public ResponseEntity<Void> putObjectLockConfiguration(
294294
*/
295295
@GetMapping(
296296
value = {
297-
//AWS SDK V2 pattern
297+
// AWS SDK V2 pattern
298298
"/{bucketName:.+}",
299-
//AWS SDK V1 pattern
299+
// AWS SDK V1 pattern
300300
"/{bucketName:.+}/"
301301
},
302302
params = {
@@ -317,9 +317,9 @@ public ResponseEntity<BucketLifecycleConfiguration> getBucketLifecycleConfigurat
317317
*/
318318
@PutMapping(
319319
value = {
320-
//AWS SDK V2 pattern
320+
// AWS SDK V2 pattern
321321
"/{bucketName:.+}",
322-
//AWS SDK V1 pattern
322+
// AWS SDK V1 pattern
323323
"/{bucketName:.+}/"
324324
},
325325
params = {
@@ -340,9 +340,9 @@ public ResponseEntity<Void> putBucketLifecycleConfiguration(
340340
*/
341341
@DeleteMapping(
342342
value = {
343-
//AWS SDK V2 pattern
343+
// AWS SDK V2 pattern
344344
"/{bucketName:.+}",
345-
//AWS SDK V1 pattern
345+
// AWS SDK V1 pattern
346346
"/{bucketName:.+}/"
347347
},
348348
params = {
@@ -380,9 +380,9 @@ public ResponseEntity<LocationConstraint> getBucketLocation(@PathVariable String
380380
*/
381381
@GetMapping(
382382
value = {
383-
//AWS SDK V2 pattern
383+
// AWS SDK V2 pattern
384384
"/{bucketName:.+}",
385-
//AWS SDK V1 pattern
385+
// AWS SDK V1 pattern
386386
"/{bucketName:.+}/"
387387
},
388388
params = {
@@ -419,9 +419,9 @@ public ResponseEntity<ListBucketResult> listObjects(
419419
*/
420420
@GetMapping(
421421
value = {
422-
//AWS SDK V2 pattern
422+
// AWS SDK V2 pattern
423423
"/{bucketName:.+}",
424-
//AWS SDK V1 pattern
424+
// AWS SDK V1 pattern
425425
"/{bucketName:.+}/"
426426
},
427427
params = {
@@ -455,9 +455,9 @@ public ResponseEntity<ListBucketResultV2> listObjectsV2(
455455
*/
456456
@GetMapping(
457457
value = {
458-
//AWS SDK V2 pattern
458+
// AWS SDK V2 pattern
459459
"/{bucketName:.+}",
460-
//AWS SDK V1 pattern
460+
// AWS SDK V1 pattern
461461
"/{bucketName:.+}/"
462462
},
463463
params = {

server/src/main/java/com/adobe/testing/s3mock/MultipartController.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,18 +110,18 @@ public MultipartController(BucketService bucketService, ObjectService objectServ
110110
this.multipartService = multipartService;
111111
}
112112

113-
//================================================================================================
113+
// ===============================================================================================
114114
// /{bucketName:.+}
115-
//================================================================================================
115+
// ===============================================================================================
116116

117117
/**
118118
* <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html">API Reference</a>.
119119
*/
120120
@GetMapping(
121121
value = {
122-
//AWS SDK V2 pattern
122+
// AWS SDK V2 pattern
123123
"/{bucketName:.+}",
124-
//AWS SDK V1 pattern
124+
// AWS SDK V1 pattern
125125
"/{bucketName:.+}/"
126126
},
127127
params = {
@@ -152,9 +152,9 @@ public ResponseEntity<ListMultipartUploadsResult> listMultipartUploads(
152152
return ResponseEntity.ok(result);
153153
}
154154

155-
//================================================================================================
155+
// ===============================================================================================
156156
// /{bucketName:.+}/{*key}
157-
//================================================================================================
157+
// ===============================================================================================
158158

159159
/**
160160
* <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html">API Reference</a>.
@@ -256,7 +256,7 @@ public ResponseEntity<Void> uploadPart(
256256
multipartService.verifyChecksum(tempFile, checksum, checksumAlgorithm);
257257
}
258258

259-
//persist checksum per part
259+
// persist checksum per part
260260
var etag = multipartService.putPart(bucketName,
261261
key.key(),
262262
uploadId,
@@ -358,7 +358,7 @@ public ResponseEntity<InitiateMultipartUploadResult> createMultipartUpload(
358358
bucketService.verifyBucketExists(bucketName);
359359

360360
try {
361-
//workaround for AWS CRT-based S3 client: Consume (and discard) body in Initiate Multipart Upload request
361+
// workaround for AWS CRT-based S3 client: Consume (and discard) body in Initiate Multipart Upload request
362362
IOUtils.consume(inputStream);
363363
} catch (IOException e) {
364364
throw BAD_REQUEST_CONTENT;

server/src/main/java/com/adobe/testing/s3mock/ObjectController.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -150,18 +150,18 @@ public ObjectController(BucketService bucketService, ObjectService objectService
150150
this.objectService = objectService;
151151
}
152152

153-
//================================================================================================
153+
// ===============================================================================================
154154
// /{bucketName:.+}
155-
//================================================================================================
155+
// ===============================================================================================
156156

157157
/**
158158
* <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjects.html">API Reference</a>.
159159
*/
160160
@PostMapping(
161161
value = {
162-
//AWS SDK V2 pattern
162+
// AWS SDK V2 pattern
163163
"/{bucketName:.+}",
164-
//AWS SDK V1 pattern
164+
// AWS SDK V1 pattern
165165
"/{bucketName:.+}/"
166166
},
167167
params = {
@@ -183,9 +183,9 @@ public ResponseEntity<DeleteResult> deleteObjects(
183183
*/
184184
@PostMapping(
185185
value = {
186-
//AWS SDK V2 pattern
186+
// AWS SDK V2 pattern
187187
"/{bucketName:.+}",
188-
//AWS SDK V1 pattern
188+
// AWS SDK V1 pattern
189189
"/{bucketName:.+}/"
190190
},
191191
params = {
@@ -254,9 +254,9 @@ public ResponseEntity<Void> postObject(
254254
.build();
255255
}
256256

257-
//================================================================================================
257+
// ===============================================================================================
258258
// /{bucketName:.+}/{*key}
259-
//================================================================================================
259+
// ===============================================================================================
260260

261261
/**
262262
* <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html">API Reference</a>.
@@ -325,7 +325,7 @@ public ResponseEntity<Void> deleteObject(
325325
try {
326326
s3ObjectMetadata = objectService.verifyObjectExists(bucketName, key.key(), versionId);
327327
} catch (S3Exception e) {
328-
//ignore NO_SUCH_KEY
328+
// ignore NO_SUCH_KEY
329329
}
330330

331331
objectService.verifyObjectMatching(match, matchLastModifiedTime, matchSize, s3ObjectMetadata);
@@ -345,7 +345,7 @@ public ResponseEntity<Void> deleteObject(
345345
try {
346346
objectService.verifyObjectExists(bucketName, key.key(), versionId);
347347
} catch (S3Exception e) {
348-
//ignore all other exceptions here
348+
// ignore all other exceptions here
349349
if (e == NO_SUCH_KEY_DELETE_MARKER) {
350350
h.set(X_AMZ_DELETE_MARKER, "true");
351351
}
@@ -739,16 +739,16 @@ public ResponseEntity<GetObjectAttributesOutput> getObjectAttributes(
739739
@RequestParam(value = VERSION_ID, required = false) @Nullable String versionId) {
740740
var bucket = bucketService.verifyBucketExists(bucketName);
741741

742-
//this is for either an object request, or a parts request.
742+
// this is for either an object request, or a parts request.
743743

744744
var s3ObjectMetadata = objectService.verifyObjectExists(bucketName, key.key(), versionId);
745745
objectService.verifyObjectMatching(match, noneMatch,
746746
ifModifiedSince, ifUnmodifiedSince, s3ObjectMetadata);
747-
//S3Mock stores the etag with the additional quotation marks needed in the headers. This
747+
// S3Mock stores the etag with the additional quotation marks needed in the headers. This
748748
// response does not use eTag as a header, so it must not contain the quotation marks.
749749
var etag = s3ObjectMetadata.etag().replace("\"", "");
750750
var objectSize = Long.parseLong(s3ObjectMetadata.size());
751-
//in object attributes, S3 returns STANDARD, in all other APIs it returns null...
751+
// in object attributes, S3 returns STANDARD, in all other APIs it returns null...
752752
var storageClass = s3ObjectMetadata.storageClass() == null
753753
? STANDARD
754754
: s3ObjectMetadata.storageClass();
@@ -757,7 +757,7 @@ public ResponseEntity<GetObjectAttributesOutput> getObjectAttributes(
757757
objectAttributes.contains(ObjectAttributes.ETAG.toString())
758758
? etag
759759
: null,
760-
null, //parts not supported right now
760+
null, // parts not supported right now
761761
objectAttributes.contains(ObjectAttributes.OBJECT_SIZE.toString())
762762
? objectSize
763763
: null,
@@ -918,7 +918,7 @@ public ResponseEntity<CopyObjectResult> copyObject(
918918
userMetadata,
919919
storageClass);
920920

921-
//return expiration
921+
// return expiration
922922

923923
if (copyS3ObjectMetadata == null) {
924924
return ResponseEntity

server/src/main/java/com/adobe/testing/s3mock/dto/AccessControlPolicy.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ public class AccessControlPolicy {
3737
@JsonProperty("Grant")
3838
@JacksonXmlElementWrapper(localName = "AccessControlList") List<Grant> accessControlList;
3939
@JsonProperty("Owner") Owner owner;
40-
//workaround for adding xmlns attribute to root element only.
40+
// workaround for adding xmlns attribute to root element only.
4141
@JacksonXmlProperty(isAttribute = true, localName = "xmlns") String xmlns;
4242

4343
public AccessControlPolicy() {
44-
//needed by Jackson
44+
// needed by Jackson
4545
}
4646

4747
public AccessControlPolicy(Owner owner, List<Grant> accessControlList, String xmlns) {

server/src/main/java/com/adobe/testing/s3mock/dto/BucketLifecycleConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
public record BucketLifecycleConfiguration(
3333
@JacksonXmlElementWrapper(useWrapping = false)
3434
@JsonProperty("Rule") List<LifecycleRule> rules,
35-
//workaround for adding xmlns attribute to root element only.
35+
// workaround for adding xmlns attribute to root element only.
3636
@JacksonXmlProperty(isAttribute = true, localName = "xmlns") String xmlns
3737
) {
3838
public BucketLifecycleConfiguration {

server/src/main/java/com/adobe/testing/s3mock/dto/CompleteMultipartUploadResult.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public record CompleteMultipartUploadResult(
4040
@JsonProperty("ETag") String etag,
4141
@JsonProperty("Key") String key,
4242
@JsonProperty("Location") String location,
43-
//workaround for adding xmlns attribute to root element only.
43+
// workaround for adding xmlns attribute to root element only.
4444
@JacksonXmlProperty(isAttribute = true, localName = "xmlns") String xmlns,
4545
@JsonIgnore MultipartUploadInfo multipartUploadInfo,
4646
@JsonIgnore String versionId,

server/src/main/java/com/adobe/testing/s3mock/dto/CopyObjectResult.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
public record CopyObjectResult(
3333
@JsonProperty("ETag") String etag,
3434
@JsonProperty("LastModified") String lastModified,
35-
//workaround for adding xmlns attribute to root element only.
35+
// workaround for adding xmlns attribute to root element only.
3636
@JacksonXmlProperty(isAttribute = true, localName = "xmlns") String xmlns
3737
) {
3838
public CopyObjectResult {

0 commit comments

Comments
 (0)