Skip to content

Commit 337f78d

Browse files
authored
Merge pull request #608 from benjamin-confino/checkstyle
Fix all checkstyle errors
2 parents b1c3bce + fbcbb6e commit 337f78d

File tree

17 files changed

+40
-32
lines changed

17 files changed

+40
-32
lines changed

api/src/main/java/org/eclipse/microprofile/openapi/models/PathItem.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ default PathItem description(String description) {
120120
* definition of a GET operation
121121
* @return the current PathItem instance
122122
**/
123+
@SuppressWarnings("checkstyle:methodname")
123124
default PathItem GET(Operation get) {
124125
setGET(get);
125126
return this;
@@ -147,6 +148,7 @@ default PathItem GET(Operation get) {
147148
* definition of a PUT operation
148149
* @return the current PathItem instance
149150
**/
151+
@SuppressWarnings("checkstyle:methodname")
150152
default PathItem PUT(Operation put) {
151153
setPUT(put);
152154
return this;
@@ -174,6 +176,7 @@ default PathItem PUT(Operation put) {
174176
* definition of a PUT operation
175177
* @return the current PathItem instance
176178
**/
179+
@SuppressWarnings("checkstyle:methodname")
177180
default PathItem POST(Operation post) {
178181
setPOST(post);
179182
return this;
@@ -201,6 +204,7 @@ default PathItem POST(Operation post) {
201204
* definition of a DELETE operation
202205
* @return the current PathItem instance
203206
**/
207+
@SuppressWarnings("checkstyle:methodname")
204208
default PathItem DELETE(Operation delete) {
205209
setDELETE(delete);
206210
return this;
@@ -228,6 +232,7 @@ default PathItem DELETE(Operation delete) {
228232
* definition of an OPTIONS operation
229233
* @return the current PathItem instance
230234
**/
235+
@SuppressWarnings("checkstyle:methodname")
231236
default PathItem OPTIONS(Operation options) {
232237
setOPTIONS(options);
233238
return this;
@@ -255,6 +260,7 @@ default PathItem OPTIONS(Operation options) {
255260
* definition of a HEAD operation
256261
* @return the current PathItem instance
257262
**/
263+
@SuppressWarnings("checkstyle:methodname")
258264
default PathItem HEAD(Operation head) {
259265
setHEAD(head);
260266
return this;
@@ -282,6 +288,7 @@ default PathItem HEAD(Operation head) {
282288
* definition of a PATCH operation
283289
* @return the current PathItem instance
284290
**/
291+
@SuppressWarnings("checkstyle:methodname")
285292
default PathItem PATCH(Operation patch) {
286293
setPATCH(patch);
287294
return this;
@@ -309,6 +316,7 @@ default PathItem PATCH(Operation patch) {
309316
* definition of a TRACE operation
310317
* @return the current PathItem instance
311318
**/
319+
@SuppressWarnings("checkstyle:methodname")
312320
default PathItem TRACE(Operation trace) {
313321
setTRACE(trace);
314322
return this;
@@ -420,4 +428,4 @@ default PathItem parameters(List<Parameter> parameters) {
420428
**/
421429
void removeParameter(Parameter parameter);
422430

423-
}
431+
}

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<parent>
2020
<groupId>org.eclipse.microprofile</groupId>
2121
<artifactId>microprofile-parent</artifactId>
22-
<version>2.8</version>
22+
<version>2.9-RC1</version>
2323
</parent>
2424

2525
<groupId>org.eclipse.microprofile.openapi</groupId>

tck/src/main/java/org/eclipse/microprofile/openapi/apps/airlines/data/UserData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import org.eclipse.microprofile.openapi.apps.airlines.model.User;
2020

2121
public class UserData {
22-
static List<User> users = new ArrayList<User>();
22+
static private List<User> users = new ArrayList<User>();
2323

2424
static {
2525
users.add(createUser(1, "Bob1", "pswd", "Bob", "Smith", "male", 12,

tck/src/main/java/org/eclipse/microprofile/openapi/apps/airlines/resources/AirlinesResource.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ public static Airline getRandomAirline() {
7070
@Extension(name = "x-boolean-property", value = "true", parseValue = true),
7171
@Extension(name = "x-number-property", value = "117", parseValue = true),
7272
@Extension(name = "x-object-property",
73-
value = "{ \"property-1\" : \"value-1\", \"property-2\" : \"value-2\", \"property-3\" : { \"prop-3-1\" : 17, \"prop-3-2\" : true } }",
73+
value = "{ \"property-1\" : \"value-1\", \"property-2\" : \"value-2\","
74+
+ " \"property-3\" : { \"prop-3-1\" : 17, \"prop-3-2\" : true } }",
7475
parseValue = true),
7576
@Extension(name = "x-string-array-property", value = "[ \"one\", \"two\", \"three\" ]", parseValue = true),
7677
@Extension(name = "x-object-array-property",

tck/src/main/java/org/eclipse/microprofile/openapi/apps/petstore/data/PetData.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
import org.eclipse.microprofile.openapi.apps.petstore.model.Tag;
2424

2525
public class PetData {
26-
static List<Pet> pets = new ArrayList<Pet>();
27-
static List<Category> categories = new ArrayList<Category>();
26+
static private List<Pet> pets = new ArrayList<Pet>();
27+
static private List<Category> categories = new ArrayList<Category>();
2828

2929
static {
3030
categories.add(createCategory(1, "Dogs"));

tck/src/main/java/org/eclipse/microprofile/openapi/apps/petstore/data/StoreData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import org.eclipse.microprofile.openapi.apps.petstore.model.Order;
2121

2222
public class StoreData {
23-
static List<Order> orders = new ArrayList<Order>();
23+
private static List<Order> orders = new ArrayList<Order>();
2424

2525
static {
2626
orders.add(createOrder(1, 1, 2, new Date(), "placed"));

tck/src/main/java/org/eclipse/microprofile/openapi/apps/petstore/data/UserData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import org.eclipse.microprofile.openapi.apps.petstore.model.User;
2020

2121
public class UserData {
22-
static List<User> users = new ArrayList<User>();
22+
private static List<User> users = new ArrayList<User>();
2323

2424
static {
2525
users.add(createUser(1, "user1", "first name 1", "last name 1",

tck/src/main/java/org/eclipse/microprofile/openapi/apps/petstore/model/ApiResponse.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ public class ApiResponse {
2323
public static final int OK = 4;
2424
public static final int TOO_BUSY = 5;
2525

26-
int code;
27-
String type;
28-
String message;
26+
private int code;
27+
private String type;
28+
private String message;
2929

3030
public ApiResponse() {
3131
}

tck/src/main/java/org/eclipse/microprofile/openapi/apps/petstore/model/Cat.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
@XmlRootElement(name = "Cat")
1919
public class Cat extends Pet {
2020

21-
String catBreed;
21+
private String catBreed;
2222

2323
public String getCatBreed() {
2424
return catBreed;

tck/src/main/java/org/eclipse/microprofile/openapi/apps/petstore/model/Dog.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
@XmlRootElement(name = "Dog")
1919
public class Dog extends Pet {
2020

21-
String dogBreed;
21+
private String dogBreed;
2222

2323
public String getDogBreed() {
2424
return dogBreed;

tck/src/main/java/org/eclipse/microprofile/openapi/apps/petstore/model/Lizard.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
@XmlRootElement(name = "Lizard")
1919
public class Lizard extends Pet {
2020

21-
String lizardBreed;
21+
private String lizardBreed;
2222

2323
public String getLizardBreed() {
2424
return lizardBreed;

tck/src/main/java/org/eclipse/microprofile/openapi/apps/petstore/resource/PetResource.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
})
7878
public class PetResource {
7979

80-
static PetData petData = new PetData();
80+
static private PetData petData = new PetData();
8181

8282
@GET
8383
@Path("/{petId}")
@@ -168,6 +168,7 @@ public Response deletePet(
168168
@APIResponse(responseCode = "400", description = "Invalid input",
169169
content = @Content(mediaType = "application/json",
170170
schema = @Schema(implementation = ApiResponse.class)))
171+
@SuppressWarnings("checkstyle:linelength")
171172
@RequestBody(name = "pet",
172173
content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class),
173174
examples = @ExampleObject(ref = "http://example.org/petapi-examples/openapi.json#/components/examples/pet-example")),
@@ -203,7 +204,8 @@ public Response updatePet(
203204
@Produces("application/json")
204205
@Callback(name = "tagsCallback", callbackUrlExpression = "http://petstoreapp.com/pet",
205206
operations = @CallbackOperation(method = "GET", summary = "Finds Pets by tags",
206-
description = "Find Pets by tags; Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.",
207+
description = "Find Pets by tags; Muliple tags can be provided with comma seperated strings. "
208+
+ "Use tag1, tag2, tag3 for testing.",
207209
responses = {
208210
@APIResponse(responseCode = "400",
209211
description = "Invalid tag value",

tck/src/main/java/org/eclipse/microprofile/openapi/apps/petstore/resource/PetStoreResource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@
5959
@Extension(name = "x-mp-type1", value = "true")
6060
@Extension(name = "x-mp-type2", value = "false")
6161
public class PetStoreResource {
62-
static StoreData storeData = new StoreData();
63-
static PetData petData = new PetData();
62+
static private StoreData storeData = new StoreData();
63+
static private PetData petData = new PetData();
6464

6565
@GET
6666
@Path("/inventory")

tck/src/main/java/org/eclipse/microprofile/openapi/apps/petstore/resource/UserResource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
scheme = "bearer", bearerFormat = "JWT")
5858
})
5959
public class UserResource {
60-
static UserData userData = new UserData();
60+
private static UserData userData = new UserData();
6161

6262
@POST
6363
@APIResponse(description = "successful operation")

tck/src/main/java/org/eclipse/microprofile/openapi/reader/MyOASModelReaderImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
public class MyOASModelReaderImpl implements OASModelReader {
5858

5959
@Override
60+
@SuppressWarnings("checkstyle:methodlength")
6061
public OpenAPI buildModel() {
6162
return OASFactory.createObject(OpenAPI.class)
6263
.info(OASFactory.createObject(Info.class)

tck/src/main/java/org/eclipse/microprofile/openapi/tck/ModelConstructionTest.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1930,10 +1930,8 @@ private Map<String, Property> collectProperties(Class<?> clazz) {
19301930
p.addBuilder(m);
19311931
}
19321932
}
1933-
}
1934-
// Possible setter method
1935-
else if (returnType == Void.TYPE) {
1936-
if (name.startsWith("set") && parameterCount == 1) {
1933+
} else if (returnType == Void.TYPE) {
1934+
if (name.startsWith("set") && parameterCount == 1) { // Possible setter method
19371935
name = Introspector.decapitalize(name.substring(3));
19381936
type = m.getParameterTypes()[0];
19391937
p = properties.get(name);
@@ -1945,10 +1943,8 @@ else if (returnType == Void.TYPE) {
19451943
p.addSetter(m);
19461944
}
19471945
}
1948-
}
1949-
// Possible getter method
1950-
else {
1951-
if (name.startsWith("get") && parameterCount == 0) {
1946+
} else {
1947+
if (name.startsWith("get") && parameterCount == 0) { // Possible getter method
19521948
name = Introspector.decapitalize(name.substring(3));
19531949
type = returnType;
19541950
p = properties.get(name);

tck/src/main/java/org/eclipse/microprofile/openapi/tck/PetStoreAppTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -288,16 +288,16 @@ public void testAPIResponseSchemaDefaultResponseCode(String type) {
288288
public void testExtensionPlacement(String type) {
289289
ValidatableResponse vr = callEndpoint(type);
290290

291-
final String X_OPERATION_EXT = "x-operation-ext";
292-
final String TEST_OPERATION_EXT = "test-operation-ext";
291+
final String xOperationExt = "x-operation-ext";
292+
final String testOperationExt = "test-operation-ext";
293293
String opPath = "paths.'/store/inventory'.get";
294294

295-
vr.body(opPath, hasEntry(equalTo(X_OPERATION_EXT), equalTo(TEST_OPERATION_EXT)));
295+
vr.body(opPath, hasEntry(equalTo(xOperationExt), equalTo(testOperationExt)));
296296

297297
vr.body(opPath + ".responses", hasEntry(equalTo("x-responses-ext"), equalTo("test-responses-ext")));
298-
vr.body(opPath + ".responses.'200'", not(hasKey(X_OPERATION_EXT)));
298+
vr.body(opPath + ".responses.'200'", not(hasKey(xOperationExt)));
299299
vr.body(opPath + ".responses.'200'", hasEntry(equalTo("x-response-ext"), equalTo("test-response-ext")));
300-
vr.body(opPath + ".responses.'500'", not(hasKey(X_OPERATION_EXT)));
300+
vr.body(opPath + ".responses.'500'", not(hasKey(xOperationExt)));
301301
vr.body(opPath + ".responses.'503'.content.'application/json'",
302302
hasEntry(equalTo("x-notavailable-ext"), equalTo("true")));
303303
vr.body(opPath + ".responses.'503'.content.'application/xml'",

0 commit comments

Comments
 (0)