From c5b25b16ad1ac5e43bf7aabce9db3e1c60ac09b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20C=C3=B4t=C3=A9?= Date: Thu, 1 Jun 2017 10:04:31 -0400 Subject: [PATCH 1/8] Removals of most of the warnings found by lint --- .../languages/AbstractJavaCodegen.java | 22 ++++++++++++--- .../languages/JavaPlayFrameworkCodegen.java | 2 +- .../newApiInterface.mustache | 3 ++- .../resources/JavaPlayFramework/pojo.mustache | 4 +-- .../JavaPlayFramework/swaggerUtils.mustache | 27 ++++++++++++------- .../app/apimodels/Category.java | 4 +-- .../app/apimodels/ModelApiResponse.java | 6 ++--- .../app/apimodels/Order.java | 12 ++++----- .../app/apimodels/Pet.java | 20 +++++++------- .../app/apimodels/Tag.java | 4 +-- .../app/apimodels/User.java | 16 +++++------ .../PetApiControllerImpInterface.java | 3 ++- .../StoreApiControllerImpInterface.java | 3 ++- .../UserApiControllerImpInterface.java | 3 ++- .../app/swagger/SwaggerUtils.java | 27 ++++++++++++------- 15 files changed, 96 insertions(+), 60 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java index 4ec6bf31202..d8a728618a2 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java @@ -595,19 +595,33 @@ public String toDefaultValue(Property p) { if (ap.getItems() == null) { return null; } - return String.format(pattern, getTypeDeclaration(ap.getItems())); + + String typeDeclaration = getTypeDeclaration(ap.getItems()); + Boolean java8 = (Boolean)additionalProperties.get("java8"); + if (java8 != null && java8) { + typeDeclaration = ""; + } + + return String.format(pattern, typeDeclaration); } else if (p instanceof MapProperty) { final MapProperty ap = (MapProperty) p; final String pattern; if (fullJavaUtil) { - pattern = "new java.util.HashMap()"; + pattern = "new java.util.HashMap<%s>()"; } else { - pattern = "new HashMap()"; + pattern = "new HashMap<%s>()"; } if (ap.getAdditionalProperties() == null) { return null; } - return String.format(pattern, getTypeDeclaration(ap.getAdditionalProperties())); + + String typeDeclaration = String.format("String, %s", getTypeDeclaration(ap.getAdditionalProperties())); + Boolean java8 = (Boolean)additionalProperties.get("java8"); + if (java8 != null && java8) { + typeDeclaration = ""; + } + + return String.format(pattern, typeDeclaration); } else if (p instanceof IntegerProperty) { IntegerProperty dp = (IntegerProperty) p; if (dp.getDefault() != null) { diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaPlayFrameworkCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaPlayFrameworkCodegen.java index 3577bd43fd1..d523fcd9fd6 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaPlayFrameworkCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaPlayFrameworkCodegen.java @@ -49,7 +49,7 @@ public JavaPlayFrameworkCodegen() { additionalProperties.put(CONFIG_PACKAGE, configPackage); additionalProperties.put(BASE_PACKAGE, basePackage); - + additionalProperties.put("java8", true); additionalProperties.put("jackson", "true"); cliOptions.add(new CliOption(TITLE, "server title name or client service name")); diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApiInterface.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApiInterface.mustache index 37800943816..177e7851f45 100644 --- a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApiInterface.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApiInterface.mustache @@ -13,7 +13,8 @@ import javax.validation.constraints.*; {{/useBeanValidation}} {{#operations}} -public interface {{classname}}ControllerImpInterface { +@SuppressWarnings("RedundantThrows") +interface {{classname}}ControllerImpInterface { {{#operation}} {{>returnTypes}} {{operationId}}({{#allParams}}{{>pathParams}}{{>queryParams}}{{>bodyParams}}{{>formParams}}{{>headerParams}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) {{#handleExceptions}}throws Exception{{/handleExceptions}}; diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pojo.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pojo.mustache index 1811924571a..17a4bccbbae 100644 --- a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pojo.mustache @@ -43,7 +43,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali this.{{name}} = {{{defaultValue}}}; } {{/required}} - this.{{name}}.add({{name}}Item); + {{name}}.add({{name}}Item); return this; } {{/isListContainer}} @@ -97,7 +97,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali return false; }{{#hasVars}} {{classname}} {{classVarName}} = ({{classname}}) o; - return {{#vars}}Objects.equals(this.{{name}}, {{classVarName}}.{{name}}){{#hasMore}} && + return {{#vars}}Objects.equals({{name}}, {{classVarName}}.{{name}}){{#hasMore}} && {{/hasMore}}{{/vars}}{{#parent}} && super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}} return true;{{/hasVars}} diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/swaggerUtils.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/swaggerUtils.mustache index 9a732b2933f..e1e03cb69d2 100644 --- a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/swaggerUtils.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/swaggerUtils.mustache @@ -28,7 +28,7 @@ public class SwaggerUtils { // preconditions if (name == null || name.isEmpty() || value == null) return params; - Collection valueCollection = null; + Collection valueCollection; if (value instanceof Collection) { valueCollection = (Collection) value; } else { @@ -54,14 +54,23 @@ public class SwaggerUtils { String delimiter = ","; - if (collectionFormat.equals("csv")) { - delimiter = ","; - } else if (collectionFormat.equals("ssv")) { - delimiter = " "; - } else if (collectionFormat.equals("tsv")) { - delimiter = "\t"; - } else if (collectionFormat.equals("pipes")) { - delimiter = "|"; + switch(collectionFormat) { + case "csv": { + delimiter = ","; + break; + } + case "ssv": { + delimiter = " "; + break; + } + case "tsv": { + delimiter = "\t"; + break; + } + case "pipes": { + delimiter = "|"; + break; + } } StringBuilder sb = new StringBuilder() ; diff --git a/samples/server/petstore/java-play-framework/app/apimodels/Category.java b/samples/server/petstore/java-play-framework/app/apimodels/Category.java index 8b09b2b59c9..afba57a5c32 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/Category.java @@ -58,8 +58,8 @@ public boolean equals(java.lang.Object o) { return false; } Category category = (Category) o; - return Objects.equals(this.id, category.id) && - Objects.equals(this.name, category.name); + return Objects.equals(id, category.id) && + Objects.equals(name, category.name); } @Override diff --git a/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java index 0e81aa6a8b4..6bc1f48e869 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java @@ -78,9 +78,9 @@ public boolean equals(java.lang.Object o) { return false; } ModelApiResponse _apiResponse = (ModelApiResponse) o; - return Objects.equals(this.code, _apiResponse.code) && - Objects.equals(this.type, _apiResponse.type) && - Objects.equals(this.message, _apiResponse.message); + return Objects.equals(code, _apiResponse.code) && + Objects.equals(type, _apiResponse.type) && + Objects.equals(message, _apiResponse.message); } @Override diff --git a/samples/server/petstore/java-play-framework/app/apimodels/Order.java b/samples/server/petstore/java-play-framework/app/apimodels/Order.java index 215c194e848..d3ac9a1fd66 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/Order.java @@ -172,12 +172,12 @@ public boolean equals(java.lang.Object o) { return false; } Order order = (Order) o; - return Objects.equals(this.id, order.id) && - Objects.equals(this.petId, order.petId) && - Objects.equals(this.quantity, order.quantity) && - Objects.equals(this.shipDate, order.shipDate) && - Objects.equals(this.status, order.status) && - Objects.equals(this.complete, order.complete); + return Objects.equals(id, order.id) && + Objects.equals(petId, order.petId) && + Objects.equals(quantity, order.quantity) && + Objects.equals(shipDate, order.shipDate) && + Objects.equals(status, order.status) && + Objects.equals(complete, order.complete); } @Override diff --git a/samples/server/petstore/java-play-framework/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework/app/apimodels/Pet.java index f8d73f2f837..5b490741a63 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/Pet.java @@ -22,7 +22,7 @@ public class Pet { private String name = null; @JsonProperty("photoUrls") - private List photoUrls = new ArrayList(); + private List photoUrls = new ArrayList<>(); @JsonProperty("tags") private List tags = null; @@ -121,7 +121,7 @@ public Pet photoUrls(List photoUrls) { } public Pet addPhotoUrlsItem(String photoUrlsItem) { - this.photoUrls.add(photoUrlsItem); + photoUrls.add(photoUrlsItem); return this; } @@ -145,9 +145,9 @@ public Pet tags(List tags) { public Pet addTagsItem(Tag tagsItem) { if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } - this.tags.add(tagsItem); + tags.add(tagsItem); return this; } @@ -190,12 +190,12 @@ public boolean equals(java.lang.Object o) { return false; } Pet pet = (Pet) o; - return Objects.equals(this.id, pet.id) && - Objects.equals(this.category, pet.category) && - Objects.equals(this.name, pet.name) && - Objects.equals(this.photoUrls, pet.photoUrls) && - Objects.equals(this.tags, pet.tags) && - Objects.equals(this.status, pet.status); + return Objects.equals(id, pet.id) && + Objects.equals(category, pet.category) && + Objects.equals(name, pet.name) && + Objects.equals(photoUrls, pet.photoUrls) && + Objects.equals(tags, pet.tags) && + Objects.equals(status, pet.status); } @Override diff --git a/samples/server/petstore/java-play-framework/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework/app/apimodels/Tag.java index 78d4f08bb29..b8f4177829b 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/Tag.java @@ -58,8 +58,8 @@ public boolean equals(java.lang.Object o) { return false; } Tag tag = (Tag) o; - return Objects.equals(this.id, tag.id) && - Objects.equals(this.name, tag.name); + return Objects.equals(id, tag.id) && + Objects.equals(name, tag.name); } @Override diff --git a/samples/server/petstore/java-play-framework/app/apimodels/User.java b/samples/server/petstore/java-play-framework/app/apimodels/User.java index d3146c80ff9..3e50fcd1e3f 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/User.java @@ -178,14 +178,14 @@ public boolean equals(java.lang.Object o) { return false; } User user = (User) o; - return Objects.equals(this.id, user.id) && - Objects.equals(this.username, user.username) && - Objects.equals(this.firstName, user.firstName) && - Objects.equals(this.lastName, user.lastName) && - Objects.equals(this.email, user.email) && - Objects.equals(this.password, user.password) && - Objects.equals(this.phone, user.phone) && - Objects.equals(this.userStatus, user.userStatus); + return Objects.equals(id, user.id) && + Objects.equals(username, user.username) && + Objects.equals(firstName, user.firstName) && + Objects.equals(lastName, user.lastName) && + Objects.equals(email, user.email) && + Objects.equals(password, user.password) && + Objects.equals(phone, user.phone) && + Objects.equals(userStatus, user.userStatus); } @Override diff --git a/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImpInterface.java index df027c27920..9ad4dcb3013 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImpInterface.java @@ -11,7 +11,8 @@ import javax.validation.constraints.*; -public interface PetApiControllerImpInterface { +@SuppressWarnings("RedundantThrows") +interface PetApiControllerImpInterface { void addPet(Pet body) throws Exception; void deletePet(Long petId, String apiKey) throws Exception; diff --git a/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImpInterface.java b/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImpInterface.java index 766a29c4f17..967298f7e67 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImpInterface.java @@ -10,7 +10,8 @@ import javax.validation.constraints.*; -public interface StoreApiControllerImpInterface { +@SuppressWarnings("RedundantThrows") +interface StoreApiControllerImpInterface { void deleteOrder(String orderId) throws Exception; Map getInventory() throws Exception; diff --git a/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImpInterface.java index 474905c2b2e..00b7778296f 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImpInterface.java @@ -10,7 +10,8 @@ import javax.validation.constraints.*; -public interface UserApiControllerImpInterface { +@SuppressWarnings("RedundantThrows") +interface UserApiControllerImpInterface { void createUser(User body) throws Exception; void createUsersWithArrayInput(List body) throws Exception; diff --git a/samples/server/petstore/java-play-framework/app/swagger/SwaggerUtils.java b/samples/server/petstore/java-play-framework/app/swagger/SwaggerUtils.java index 1c9660906b3..7ade84e85d5 100644 --- a/samples/server/petstore/java-play-framework/app/swagger/SwaggerUtils.java +++ b/samples/server/petstore/java-play-framework/app/swagger/SwaggerUtils.java @@ -26,7 +26,7 @@ public static Map parameterToPairs(String collectionFormat, Stri // preconditions if (name == null || name.isEmpty() || value == null) return params; - Collection valueCollection = null; + Collection valueCollection; if (value instanceof Collection) { valueCollection = (Collection) value; } else { @@ -52,14 +52,23 @@ public static Map parameterToPairs(String collectionFormat, Stri String delimiter = ","; - if (collectionFormat.equals("csv")) { - delimiter = ","; - } else if (collectionFormat.equals("ssv")) { - delimiter = " "; - } else if (collectionFormat.equals("tsv")) { - delimiter = "\t"; - } else if (collectionFormat.equals("pipes")) { - delimiter = "|"; + switch(collectionFormat) { + case "csv": { + delimiter = ","; + break; + } + case "ssv": { + delimiter = " "; + break; + } + case "tsv": { + delimiter = "\t"; + break; + } + case "pipes": { + delimiter = "|"; + break; + } } StringBuilder sb = new StringBuilder() ; From 9e0ddde6b98d7f8e7be768f5b83947a842a0d161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20C=C3=B4t=C3=A9?= Date: Thu, 1 Jun 2017 10:41:38 -0400 Subject: [PATCH 2/8] Removals of most of the warnings found by lint (PART 2) --- .../main/resources/JavaPlayFramework/conversionBegin.mustache | 2 +- .../main/resources/JavaPlayFramework/conversionEnd.mustache | 2 +- .../src/main/resources/JavaPlayFramework/pojo.mustache | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/conversionBegin.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/conversionBegin.mustache index 1f030198921..ffba5dcdd13 100644 --- a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/conversionBegin.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/conversionBegin.mustache @@ -1 +1 @@ -{{#isBoolean}}Boolean.valueOf({{/isBoolean}}{{#isInteger}}Integer.parseInt({{/isInteger}}{{#isDouble}}Double.parseDouble({{/isDouble}}{{#isLong}}Long.parseLong({{/isLong}}{{#isFloat}}Float.parseFloat({{/isFloat}}{{#isString}}(String){{/isString}} \ No newline at end of file +{{#isBoolean}}Boolean.valueOf({{/isBoolean}}{{#isInteger}}Integer.parseInt({{/isInteger}}{{#isDouble}}Double.parseDouble({{/isDouble}}{{#isLong}}Long.parseLong({{/isLong}}{{#isFloat}}Float.parseFloat({{/isFloat}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/conversionEnd.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/conversionEnd.mustache index 3686f93ac6a..7a3d1c2e18d 100644 --- a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/conversionEnd.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/conversionEnd.mustache @@ -1 +1 @@ -{{#isBoolean}}){{/isBoolean}}{{#isInteger}}){{/isInteger}}{{#isDouble}}){{/isDouble}}{{#isLong}}){{/isLong}}{{#isFloat}}){{/isFloat}}{{#isString}}{{/isString}} \ No newline at end of file +{{#isBoolean}}){{/isBoolean}}{{#isInteger}}){{/isInteger}}{{#isDouble}}){{/isDouble}}{{#isLong}}){{/isLong}}{{#isFloat}}){{/isFloat}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pojo.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pojo.mustache index 17a4bccbbae..b4807d8fdee 100644 --- a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pojo.mustache @@ -39,8 +39,8 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { {{^required}} - if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + if ({{name}} == null) { + {{name}} = {{{defaultValue}}}; } {{/required}} {{name}}.add({{name}}Item); From 1782e72e790dcb0ae3a93c78e0ba8a14a728c433 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20C=C3=B4t=C3=A9?= Date: Thu, 1 Jun 2017 11:02:09 -0400 Subject: [PATCH 3/8] Removals of most of the warnings found by lint (PART 3) --- .../src/main/resources/JavaPlayFramework/enumClass.mustache | 2 +- .../src/main/resources/JavaPlayFramework/pojo.mustache | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/enumClass.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/enumClass.mustache index c5c3143cb94..5d5086497d9 100644 --- a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/enumClass.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/enumClass.mustache @@ -20,7 +20,7 @@ {{/allowableValues}} {{/gson}} - private {{{datatype}}} value; + private final {{{datatype}}} value; {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{datatype}}} value) { this.value = value; diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pojo.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pojo.mustache index b4807d8fdee..b9a1371d6b5 100644 --- a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pojo.mustache @@ -2,6 +2,7 @@ * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} */ {{>generatedAnnotation}} +@SuppressWarnings("UnusedReturnValue") public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { {{#vars}} {{#isEnum}} @@ -108,6 +109,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali return Objects.hash({{#vars}}{{name}}{{#hasMore}}, {{/hasMore}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); From eefaa8ffb3ff200cb032a2d278ec1d479207b6b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20C=C3=B4t=C3=A9?= Date: Thu, 1 Jun 2017 11:28:47 -0400 Subject: [PATCH 4/8] Removals of most of the warnings found by lint (PART 4) --- .../resources/JavaPlayFramework/enumOuterClass.mustache | 2 +- .../java-play-framework/app/apimodels/Category.java | 2 ++ .../app/apimodels/ModelApiResponse.java | 2 ++ .../petstore/java-play-framework/app/apimodels/Order.java | 4 +++- .../petstore/java-play-framework/app/apimodels/Pet.java | 8 +++++--- .../petstore/java-play-framework/app/apimodels/Tag.java | 2 ++ .../petstore/java-play-framework/app/apimodels/User.java | 2 ++ .../app/controllers/PetApiController.java | 8 ++++---- .../app/controllers/UserApiController.java | 4 ++-- 9 files changed, 23 insertions(+), 11 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/enumOuterClass.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/enumOuterClass.mustache index 76c2cbf5a76..4bd1206fd55 100644 --- a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/enumOuterClass.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/enumOuterClass.mustache @@ -18,7 +18,7 @@ public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}} {{/gson}} - private {{{dataType}}} value; + private final {{{dataType}}} value; {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; diff --git a/samples/server/petstore/java-play-framework/app/apimodels/Category.java b/samples/server/petstore/java-play-framework/app/apimodels/Category.java index afba57a5c32..ac522e5295e 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/Category.java @@ -7,6 +7,7 @@ * A category for a pet */ +@SuppressWarnings("UnusedReturnValue") public class Category { @JsonProperty("id") private Long id = null; @@ -67,6 +68,7 @@ public int hashCode() { return Objects.hash(id, name); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java index 6bc1f48e869..f2f77b3ff3f 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java @@ -7,6 +7,7 @@ * Describes the result of uploading an image resource */ +@SuppressWarnings("UnusedReturnValue") public class ModelApiResponse { @JsonProperty("code") private Integer code = null; @@ -88,6 +89,7 @@ public int hashCode() { return Objects.hash(code, type, message); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework/app/apimodels/Order.java b/samples/server/petstore/java-play-framework/app/apimodels/Order.java index d3ac9a1fd66..2af01487e0f 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/Order.java @@ -8,6 +8,7 @@ * An order for a pets from the pet store */ +@SuppressWarnings("UnusedReturnValue") public class Order { @JsonProperty("id") private Long id = null; @@ -31,7 +32,7 @@ public enum StatusEnum { DELIVERED("delivered"); - private String value; + private final String value; StatusEnum(String value) { this.value = value; @@ -185,6 +186,7 @@ public int hashCode() { return Objects.hash(id, petId, quantity, shipDate, status, complete); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework/app/apimodels/Pet.java index 5b490741a63..9cd41910072 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/Pet.java @@ -11,6 +11,7 @@ * A pet for sale in the pet store */ +@SuppressWarnings("UnusedReturnValue") public class Pet { @JsonProperty("id") private Long id = null; @@ -37,7 +38,7 @@ public enum StatusEnum { SOLD("sold"); - private String value; + private final String value; StatusEnum(String value) { this.value = value; @@ -144,8 +145,8 @@ public Pet tags(List tags) { } public Pet addTagsItem(Tag tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList<>(); + if (tags == null) { + tags = new ArrayList<>(); } tags.add(tagsItem); return this; @@ -203,6 +204,7 @@ public int hashCode() { return Objects.hash(id, category, name, photoUrls, tags, status); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework/app/apimodels/Tag.java index b8f4177829b..2576e180f73 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/Tag.java @@ -7,6 +7,7 @@ * A tag for a pet */ +@SuppressWarnings("UnusedReturnValue") public class Tag { @JsonProperty("id") private Long id = null; @@ -67,6 +68,7 @@ public int hashCode() { return Objects.hash(id, name); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework/app/apimodels/User.java b/samples/server/petstore/java-play-framework/app/apimodels/User.java index 3e50fcd1e3f..0479896e3e5 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/User.java @@ -7,6 +7,7 @@ * A User who is purchasing from the pet store */ +@SuppressWarnings("UnusedReturnValue") public class User { @JsonProperty("id") private Long id = null; @@ -193,6 +194,7 @@ public int hashCode() { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java index 27f3d446ff1..24af8a33960 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java @@ -50,7 +50,7 @@ public Result deletePet(Long petId) throws Exception { String valueapiKey = request().getHeader("api_key"); String apiKey; if (valueapiKey != null) { - apiKey = (String)valueapiKey; + apiKey = valueapiKey; } else { apiKey = ""; @@ -113,7 +113,7 @@ public Result updatePetWithForm(Long petId) throws Exception { String valuename = ((String[]) request().body().asMultipartFormData().asFormUrlEncoded().get("name"))[0]; String name; if (valuename != null) { - name = (String)valuename; + name = valuename; } else { name = ""; @@ -121,7 +121,7 @@ public Result updatePetWithForm(Long petId) throws Exception { String valuestatus = ((String[]) request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0]; String status; if (valuestatus != null) { - status = (String)valuestatus; + status = valuestatus; } else { status = ""; @@ -136,7 +136,7 @@ public Result uploadFile(Long petId) throws Exception { String valueadditionalMetadata = ((String[]) request().body().asMultipartFormData().asFormUrlEncoded().get("additionalMetadata"))[0]; String additionalMetadata; if (valueadditionalMetadata != null) { - additionalMetadata = (String)valueadditionalMetadata; + additionalMetadata = valueadditionalMetadata; } else { additionalMetadata = ""; diff --git a/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java index 22425261cb7..2e401ec8f95 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java @@ -88,12 +88,12 @@ public Result loginUser() throws Exception { String valueusername = request().getQueryString("username"); String username; - username = (String)valueusername; + username = valueusername; String valuepassword = request().getQueryString("password"); String password; - password = (String)valuepassword; + password = valuepassword; String obj = imp.loginUser(username, password); JsonNode result = mapper.valueToTree(obj); From 89aec684b0041e2dedbb01de2bf0c9e10aa91792 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20C=C3=B4t=C3=A9?= Date: Fri, 2 Jun 2017 13:00:37 -0400 Subject: [PATCH 5/8] Removals of most of the warnings found by lint (PART 5) --- .../src/main/resources/JavaPlayFramework/model.mustache | 4 ---- .../resources/JavaPlayFramework/newApiController.mustache | 2 ++ .../src/main/resources/JavaPlayFramework/pojo.mustache | 6 +++++- .../java-play-framework/app/apimodels/Category.java | 4 ++-- .../java-play-framework/app/apimodels/ModelApiResponse.java | 4 ++-- .../petstore/java-play-framework/app/apimodels/Order.java | 6 +++--- .../petstore/java-play-framework/app/apimodels/Pet.java | 6 +++--- .../petstore/java-play-framework/app/apimodels/Tag.java | 4 ++-- .../petstore/java-play-framework/app/apimodels/User.java | 4 ++-- .../app/controllers/PetApiController.java | 1 - .../app/controllers/StoreApiController.java | 1 - .../app/controllers/UserApiController.java | 1 - 12 files changed, 21 insertions(+), 22 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/model.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/model.mustache index 4b37d4c35d7..aa5569b13b4 100644 --- a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/model.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/model.mustache @@ -1,15 +1,11 @@ package {{package}}; -import java.util.Objects; {{#imports}}import {{import}}; {{/imports}} {{#serializableModel}} import java.io.Serializable; {{/serializableModel}} -{{#useBeanValidation}} -import javax.validation.constraints.*; import com.fasterxml.jackson.annotation.*; -{{/useBeanValidation}} {{#models}} {{#model}} {{#isEnum}} diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApiController.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApiController.mustache index 8dd279077a3..497f6625e78 100644 --- a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApiController.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApiController.mustache @@ -11,7 +11,9 @@ import java.util.ArrayList; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; +{{^handleExceptions}} import java.io.IOException; +{{/handleExceptions}} import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pojo.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pojo.mustache index b9a1371d6b5..c7ce1c4dadb 100644 --- a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pojo.mustache @@ -1,8 +1,12 @@ +import java.util.Objects; +{{#useBeanValidation}} +import javax.validation.constraints.*; +{{/useBeanValidation}} /** * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} */ {{>generatedAnnotation}} -@SuppressWarnings("UnusedReturnValue") +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { {{#vars}} {{#isEnum}} diff --git a/samples/server/petstore/java-play-framework/app/apimodels/Category.java b/samples/server/petstore/java-play-framework/app/apimodels/Category.java index ac522e5295e..ce8ad55537a 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/Category.java @@ -1,13 +1,13 @@ package apimodels; +import com.fasterxml.jackson.annotation.*; import java.util.Objects; import javax.validation.constraints.*; -import com.fasterxml.jackson.annotation.*; /** * A category for a pet */ -@SuppressWarnings("UnusedReturnValue") +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java index f2f77b3ff3f..78bc3402e33 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java @@ -1,13 +1,13 @@ package apimodels; +import com.fasterxml.jackson.annotation.*; import java.util.Objects; import javax.validation.constraints.*; -import com.fasterxml.jackson.annotation.*; /** * Describes the result of uploading an image resource */ -@SuppressWarnings("UnusedReturnValue") +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") private Integer code = null; diff --git a/samples/server/petstore/java-play-framework/app/apimodels/Order.java b/samples/server/petstore/java-play-framework/app/apimodels/Order.java index 2af01487e0f..9676569e9fc 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/Order.java @@ -1,14 +1,14 @@ package apimodels; -import java.util.Objects; import java.time.OffsetDateTime; -import javax.validation.constraints.*; import com.fasterxml.jackson.annotation.*; +import java.util.Objects; +import javax.validation.constraints.*; /** * An order for a pets from the pet store */ -@SuppressWarnings("UnusedReturnValue") +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/java-play-framework/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework/app/apimodels/Pet.java index 9cd41910072..4232e5c4405 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/Pet.java @@ -1,17 +1,17 @@ package apimodels; -import java.util.Objects; import apimodels.Category; import apimodels.Tag; import java.util.ArrayList; import java.util.List; -import javax.validation.constraints.*; import com.fasterxml.jackson.annotation.*; +import java.util.Objects; +import javax.validation.constraints.*; /** * A pet for sale in the pet store */ -@SuppressWarnings("UnusedReturnValue") +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/java-play-framework/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework/app/apimodels/Tag.java index 2576e180f73..5af86e49da0 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/Tag.java @@ -1,13 +1,13 @@ package apimodels; +import com.fasterxml.jackson.annotation.*; import java.util.Objects; import javax.validation.constraints.*; -import com.fasterxml.jackson.annotation.*; /** * A tag for a pet */ -@SuppressWarnings("UnusedReturnValue") +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/java-play-framework/app/apimodels/User.java b/samples/server/petstore/java-play-framework/app/apimodels/User.java index 0479896e3e5..6fb39fe41e7 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/User.java @@ -1,13 +1,13 @@ package apimodels; +import com.fasterxml.jackson.annotation.*; import java.util.Objects; import javax.validation.constraints.*; -import com.fasterxml.jackson.annotation.*; /** * A User who is purchasing from the pet store */ -@SuppressWarnings("UnusedReturnValue") +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java index 24af8a33960..01e507b7a50 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java @@ -12,7 +12,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; -import java.io.IOException; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; diff --git a/samples/server/petstore/java-play-framework/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework/app/controllers/StoreApiController.java index bb8e157cf73..c93dabcbc6b 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework/app/controllers/StoreApiController.java @@ -11,7 +11,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; -import java.io.IOException; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; diff --git a/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java index 2e401ec8f95..0d6a95c8501 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java @@ -11,7 +11,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; -import java.io.IOException; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; From 9169d34d0731718ee98cd0978daec32cef61877a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20C=C3=B4t=C3=A9?= Date: Tue, 11 Jul 2017 10:37:11 -0400 Subject: [PATCH 6/8] Fix conversion error --- .../codegen/languages/AbstractJavaCodegen.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java index d8a728618a2..5a2fd666476 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java @@ -597,9 +597,12 @@ public String toDefaultValue(Property p) { } String typeDeclaration = getTypeDeclaration(ap.getItems()); - Boolean java8 = (Boolean)additionalProperties.get("java8"); - if (java8 != null && java8) { - typeDeclaration = ""; + Object java8obj = additionalProperties.get("java8"); + if (java8obj != null) { + Boolean java8 = Boolean.valueOf(java8obj.toString()); + if (java8 != null && java8) { + typeDeclaration = ""; + } } return String.format(pattern, typeDeclaration); @@ -616,9 +619,12 @@ public String toDefaultValue(Property p) { } String typeDeclaration = String.format("String, %s", getTypeDeclaration(ap.getAdditionalProperties())); - Boolean java8 = (Boolean)additionalProperties.get("java8"); - if (java8 != null && java8) { - typeDeclaration = ""; + Object java8obj = additionalProperties.get("java8"); + if (java8obj != null) { + Boolean java8 = Boolean.valueOf(java8obj.toString()); + if (java8 != null && java8) { + typeDeclaration = ""; + } } return String.format(pattern, typeDeclaration); From c415692f8ba2034a5b53d15bdd3eb4bbbb62bad4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20C=C3=B4t=C3=A9?= Date: Wed, 9 Aug 2017 12:49:52 -0400 Subject: [PATCH 7/8] Removal of unnecessary import. Other will need more complex login in the generator itself (not in the mustache files) --- .../JavaPlayFramework/model.mustache | 1 - .../newApiInterface.mustache | 2 +- .../app/apimodels/Category.java | 1 - .../app/apimodels/ModelApiResponse.java | 1 - .../app/apimodels/Order.java | 1 - .../app/apimodels/Pet.java | 1 - .../app/apimodels/Tag.java | 1 - .../app/apimodels/User.java | 1 - .../logs/application.log | 1 - .../apimodels/AdditionalPropertiesClass.java | 12 ++++---- .../app/apimodels/Animal.java | 8 +++-- .../app/apimodels/AnimalFarm.java | 4 ++- .../apimodels/ArrayOfArrayOfNumberOnly.java | 12 ++++---- .../app/apimodels/ArrayOfNumberOnly.java | 12 ++++---- .../app/apimodels/ArrayTest.java | 28 +++++++++-------- .../app/apimodels/Capitalization.java | 16 +++++----- .../app/apimodels/Cat.java | 6 ++-- .../app/apimodels/Category.java | 8 +++-- .../app/apimodels/ClassModel.java | 6 ++-- .../app/apimodels/Client.java | 6 ++-- .../app/apimodels/Dog.java | 6 ++-- .../app/apimodels/EnumArrays.java | 18 ++++++----- .../app/apimodels/EnumClass.java | 4 +-- .../app/apimodels/EnumTest.java | 18 ++++++----- .../app/apimodels/FormatTest.java | 30 ++++++++++--------- .../app/apimodels/HasOnlyReadOnly.java | 8 +++-- .../app/apimodels/MapTest.java | 14 +++++---- ...ropertiesAndAdditionalPropertiesClass.java | 12 ++++---- .../app/apimodels/Model200Response.java | 8 +++-- .../app/apimodels/ModelApiResponse.java | 10 ++++--- .../app/apimodels/ModelReturn.java | 6 ++-- .../app/apimodels/Name.java | 12 ++++---- .../app/apimodels/NumberOnly.java | 6 ++-- .../app/apimodels/Order.java | 18 ++++++----- .../app/apimodels/OuterComposite.java | 10 ++++--- .../app/apimodels/OuterEnum.java | 4 +-- .../app/apimodels/Pet.java | 28 +++++++++-------- .../app/apimodels/ReadOnlyFirst.java | 8 +++-- .../app/apimodels/SpecialModelName.java | 6 ++-- .../app/apimodels/Tag.java | 8 +++-- .../app/apimodels/User.java | 20 +++++++------ .../app/controllers/FakeApiController.java | 21 +++++++------ .../FakeApiControllerImpInterface.java | 1 + .../FakeClassnameTags123ApiController.java | 1 - ...snameTags123ApiControllerImpInterface.java | 1 + .../app/controllers/PetApiController.java | 9 +++--- .../PetApiControllerImpInterface.java | 1 + .../app/controllers/StoreApiController.java | 1 - .../StoreApiControllerImpInterface.java | 1 + .../app/controllers/UserApiController.java | 5 ++-- .../UserApiControllerImpInterface.java | 1 + .../app/apimodels/Category.java | 1 - .../app/apimodels/ModelApiResponse.java | 1 - .../app/apimodels/Order.java | 1 - .../app/apimodels/Pet.java | 1 - .../app/apimodels/Tag.java | 1 - .../app/apimodels/User.java | 1 - .../PetApiControllerImpInterface.java | 2 +- .../StoreApiControllerImpInterface.java | 2 +- .../UserApiControllerImpInterface.java | 2 +- .../logs/application.log | 1 - .../app/apimodels/Category.java | 1 - .../app/apimodels/ModelApiResponse.java | 1 - .../app/apimodels/Order.java | 1 - .../app/apimodels/Pet.java | 1 - .../app/apimodels/Tag.java | 1 - .../app/apimodels/User.java | 1 - .../PetApiControllerImpInterface.java | 2 +- .../StoreApiControllerImpInterface.java | 2 +- .../UserApiControllerImpInterface.java | 2 +- .../logs/application.log | 1 - .../app/apimodels/Category.java | 1 - .../app/apimodels/ModelApiResponse.java | 1 - .../app/apimodels/Order.java | 1 - .../app/apimodels/Pet.java | 1 - .../app/apimodels/Tag.java | 1 - .../app/apimodels/User.java | 1 - .../logs/application.log | 2 +- .../app/apimodels/Category.java | 1 - .../app/apimodels/ModelApiResponse.java | 1 - .../app/apimodels/Order.java | 1 - .../app/apimodels/Pet.java | 1 - .../app/apimodels/Tag.java | 1 - .../app/apimodels/User.java | 1 - .../PetApiControllerImpInterface.java | 2 +- .../StoreApiControllerImpInterface.java | 2 +- .../UserApiControllerImpInterface.java | 2 +- .../logs/application.log | 1 - .../app/apimodels/Category.java | 1 - .../app/apimodels/ModelApiResponse.java | 1 - .../app/apimodels/Order.java | 1 - .../app/apimodels/Pet.java | 1 - .../app/apimodels/Tag.java | 1 - .../app/apimodels/User.java | 1 - .../PetApiControllerImpInterface.java | 2 +- .../StoreApiControllerImpInterface.java | 2 +- .../UserApiControllerImpInterface.java | 2 +- .../logs/application.log | 1 - .../app/apimodels/Category.java | 1 - .../app/apimodels/ModelApiResponse.java | 1 - .../app/apimodels/Order.java | 1 - .../app/apimodels/Pet.java | 1 - .../app/apimodels/Tag.java | 1 - .../app/apimodels/User.java | 1 - .../PetApiControllerImpInterface.java | 2 +- .../StoreApiControllerImpInterface.java | 2 +- .../UserApiControllerImpInterface.java | 2 +- .../java-play-framework/logs/application.log | 1 - 108 files changed, 252 insertions(+), 245 deletions(-) delete mode 100644 samples/server/petstore/java-play-framework-controller-only/logs/application.log delete mode 100644 samples/server/petstore/java-play-framework-no-bean-validation/logs/application.log delete mode 100644 samples/server/petstore/java-play-framework-no-exception-handling/logs/application.log delete mode 100644 samples/server/petstore/java-play-framework-no-swagger-ui/logs/application.log delete mode 100644 samples/server/petstore/java-play-framework-no-wrap-calls/logs/application.log delete mode 100644 samples/server/petstore/java-play-framework/logs/application.log diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/model.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/model.mustache index adff24bf6bc..2f149aac0a1 100644 --- a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/model.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/model.mustache @@ -8,7 +8,6 @@ import java.io.Serializable; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; {{#models}} {{#model}} {{#isEnum}} diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApiInterface.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApiInterface.mustache index 177e7851f45..918ee1f85b1 100644 --- a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApiInterface.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApiInterface.mustache @@ -14,7 +14,7 @@ import javax.validation.constraints.*; {{#operations}} @SuppressWarnings("RedundantThrows") -interface {{classname}}ControllerImpInterface { +public interface {{classname}}ControllerImpInterface { {{#operation}} {{>returnTypes}} {{operationId}}({{#allParams}}{{>pathParams}}{{>queryParams}}{{>bodyParams}}{{>formParams}}{{>headerParams}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) {{#handleExceptions}}throws Exception{{/handleExceptions}}; diff --git a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Category.java index 452f72c802e..fb9207f4b5d 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Category.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/ModelApiResponse.java index 58de708c32a..05911012313 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/ModelApiResponse.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Order.java index cf4aae16778..987ef07d460 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Order.java @@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Pet.java index 97eb5f88ed6..430bbe805ce 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Pet.java @@ -7,7 +7,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Tag.java index e4bdd6b7ffe..709fef2cf11 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Tag.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/User.java b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/User.java index 4b9eeed77ae..ba41fb76f80 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/User.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework-controller-only/logs/application.log b/samples/server/petstore/java-play-framework-controller-only/logs/application.log deleted file mode 100644 index c5049f8787d..00000000000 --- a/samples/server/petstore/java-play-framework-controller-only/logs/application.log +++ /dev/null @@ -1 +0,0 @@ -2017-08-08 12:56:15,882 [INFO] from play.api.Play in ForkJoinPool-1-worker-1 - Application started (Dev) diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesClass.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesClass.java index afcee2d951d..7ad3b29d780 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesClass.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesClass.java @@ -1,17 +1,18 @@ package apimodels; -import java.util.Objects; import java.util.HashMap; import java.util.List; import java.util.Map; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; +import java.util.Objects; import javax.validation.constraints.*; /** * AdditionalPropertiesClass */ +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class AdditionalPropertiesClass { @JsonProperty("map_property") private Map mapProperty = null; @@ -26,7 +27,7 @@ public AdditionalPropertiesClass mapProperty(Map mapProperty) { public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { if (this.mapProperty == null) { - this.mapProperty = new HashMap(); + this.mapProperty = new HashMap<>(); } this.mapProperty.put(key, mapPropertyItem); return this; @@ -51,7 +52,7 @@ public AdditionalPropertiesClass mapOfMapProperty(Map mapOfMapPropertyItem) { if (this.mapOfMapProperty == null) { - this.mapOfMapProperty = new HashMap>(); + this.mapOfMapProperty = new HashMap<>(); } this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; @@ -80,8 +81,8 @@ public boolean equals(java.lang.Object o) { return false; } AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(this.mapProperty, additionalPropertiesClass.mapProperty) && - Objects.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty); + return Objects.equals(mapProperty, additionalPropertiesClass.mapProperty) && + Objects.equals(mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty); } @Override @@ -89,6 +90,7 @@ public int hashCode() { return Objects.hash(mapProperty, mapOfMapProperty); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Animal.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Animal.java index badb26dee82..0b52bbf6382 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Animal.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Animal.java @@ -1,16 +1,17 @@ package apimodels; -import java.util.Objects; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; +import java.util.Objects; import javax.validation.constraints.*; /** * Animal */ +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Animal { @JsonProperty("className") private String className = null; @@ -63,8 +64,8 @@ public boolean equals(java.lang.Object o) { return false; } Animal animal = (Animal) o; - return Objects.equals(this.className, animal.className) && - Objects.equals(this.color, animal.color); + return Objects.equals(className, animal.className) && + Objects.equals(color, animal.color); } @Override @@ -72,6 +73,7 @@ public int hashCode() { return Objects.hash(className, color); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AnimalFarm.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AnimalFarm.java index 443063f6caa..44f4227ba5d 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AnimalFarm.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AnimalFarm.java @@ -1,17 +1,18 @@ package apimodels; -import java.util.Objects; import apimodels.Animal; import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; +import java.util.Objects; import javax.validation.constraints.*; /** * AnimalFarm */ +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class AnimalFarm extends ArrayList { @Override @@ -30,6 +31,7 @@ public int hashCode() { return Objects.hash(super.hashCode()); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayOfArrayOfNumberOnly.java index 9c70c34ed79..19f3a4841b4 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayOfArrayOfNumberOnly.java @@ -1,17 +1,18 @@ package apimodels; -import java.util.Objects; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; +import java.util.Objects; import javax.validation.constraints.*; /** * ArrayOfArrayOfNumberOnly */ +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ArrayOfArrayOfNumberOnly { @JsonProperty("ArrayArrayNumber") private List> arrayArrayNumber = null; @@ -22,10 +23,10 @@ public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArr } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { - if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList>(); + if (arrayArrayNumber == null) { + arrayArrayNumber = new ArrayList<>(); } - this.arrayArrayNumber.add(arrayArrayNumberItem); + arrayArrayNumber.add(arrayArrayNumberItem); return this; } @@ -52,7 +53,7 @@ public boolean equals(java.lang.Object o) { return false; } ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; - return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); + return Objects.equals(arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); } @Override @@ -60,6 +61,7 @@ public int hashCode() { return Objects.hash(arrayArrayNumber); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayOfNumberOnly.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayOfNumberOnly.java index 38bd0a065ef..4d232db89ef 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayOfNumberOnly.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayOfNumberOnly.java @@ -1,17 +1,18 @@ package apimodels; -import java.util.Objects; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; +import java.util.Objects; import javax.validation.constraints.*; /** * ArrayOfNumberOnly */ +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ArrayOfNumberOnly { @JsonProperty("ArrayNumber") private List arrayNumber = null; @@ -22,10 +23,10 @@ public ArrayOfNumberOnly arrayNumber(List arrayNumber) { } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { - if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList(); + if (arrayNumber == null) { + arrayNumber = new ArrayList<>(); } - this.arrayNumber.add(arrayNumberItem); + arrayNumber.add(arrayNumberItem); return this; } @@ -52,7 +53,7 @@ public boolean equals(java.lang.Object o) { return false; } ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; - return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); + return Objects.equals(arrayNumber, arrayOfNumberOnly.arrayNumber); } @Override @@ -60,6 +61,7 @@ public int hashCode() { return Objects.hash(arrayNumber); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayTest.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayTest.java index 1ef6f579e95..3fc13073c1a 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayTest.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayTest.java @@ -1,17 +1,18 @@ package apimodels; -import java.util.Objects; import apimodels.ReadOnlyFirst; import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; +import java.util.Objects; import javax.validation.constraints.*; /** * ArrayTest */ +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ArrayTest { @JsonProperty("array_of_string") private List arrayOfString = null; @@ -28,10 +29,10 @@ public ArrayTest arrayOfString(List arrayOfString) { } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { - if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList(); + if (arrayOfString == null) { + arrayOfString = new ArrayList<>(); } - this.arrayOfString.add(arrayOfStringItem); + arrayOfString.add(arrayOfStringItem); return this; } @@ -53,10 +54,10 @@ public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { - if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList>(); + if (arrayArrayOfInteger == null) { + arrayArrayOfInteger = new ArrayList<>(); } - this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); + arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } @@ -79,10 +80,10 @@ public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { - if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList>(); + if (arrayArrayOfModel == null) { + arrayArrayOfModel = new ArrayList<>(); } - this.arrayArrayOfModel.add(arrayArrayOfModelItem); + arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } @@ -109,9 +110,9 @@ public boolean equals(java.lang.Object o) { return false; } ArrayTest arrayTest = (ArrayTest) o; - return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && - Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && - Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); + return Objects.equals(arrayOfString, arrayTest.arrayOfString) && + Objects.equals(arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && + Objects.equals(arrayArrayOfModel, arrayTest.arrayArrayOfModel); } @Override @@ -119,6 +120,7 @@ public int hashCode() { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Capitalization.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Capitalization.java index b69203972be..1469630f874 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Capitalization.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Capitalization.java @@ -1,14 +1,15 @@ package apimodels; -import java.util.Objects; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; +import java.util.Objects; import javax.validation.constraints.*; /** * Capitalization */ +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Capitalization { @JsonProperty("smallCamel") private String smallCamel = null; @@ -140,12 +141,12 @@ public boolean equals(java.lang.Object o) { return false; } Capitalization capitalization = (Capitalization) o; - return Objects.equals(this.smallCamel, capitalization.smallCamel) && - Objects.equals(this.capitalCamel, capitalization.capitalCamel) && - Objects.equals(this.smallSnake, capitalization.smallSnake) && - Objects.equals(this.capitalSnake, capitalization.capitalSnake) && - Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && - Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); + return Objects.equals(smallCamel, capitalization.smallCamel) && + Objects.equals(capitalCamel, capitalization.capitalCamel) && + Objects.equals(smallSnake, capitalization.smallSnake) && + Objects.equals(capitalSnake, capitalization.capitalSnake) && + Objects.equals(scAETHFlowPoints, capitalization.scAETHFlowPoints) && + Objects.equals(ATT_NAME, capitalization.ATT_NAME); } @Override @@ -153,6 +154,7 @@ public int hashCode() { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Cat.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Cat.java index d7885f9326d..ad587a0540e 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Cat.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Cat.java @@ -1,15 +1,16 @@ package apimodels; -import java.util.Objects; import apimodels.Animal; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; +import java.util.Objects; import javax.validation.constraints.*; /** * Cat */ +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Cat extends Animal { @JsonProperty("declawed") private Boolean declawed = null; @@ -41,7 +42,7 @@ public boolean equals(java.lang.Object o) { return false; } Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && + return Objects.equals(declawed, cat.declawed) && super.equals(o); } @@ -50,6 +51,7 @@ public int hashCode() { return Objects.hash(declawed, super.hashCode()); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Category.java index ec77f1f7eda..572cd6ef3d2 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Category.java @@ -1,14 +1,15 @@ package apimodels; -import java.util.Objects; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; +import java.util.Objects; import javax.validation.constraints.*; /** * Category */ +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") private Long id = null; @@ -60,8 +61,8 @@ public boolean equals(java.lang.Object o) { return false; } Category category = (Category) o; - return Objects.equals(this.id, category.id) && - Objects.equals(this.name, category.name); + return Objects.equals(id, category.id) && + Objects.equals(name, category.name); } @Override @@ -69,6 +70,7 @@ public int hashCode() { return Objects.hash(id, name); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ClassModel.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ClassModel.java index e41801ae212..37313d2860b 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ClassModel.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ClassModel.java @@ -1,14 +1,15 @@ package apimodels; -import java.util.Objects; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; +import java.util.Objects; import javax.validation.constraints.*; /** * Model for testing model with \"_class\" property */ +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ClassModel { @JsonProperty("_class") private String propertyClass = null; @@ -40,7 +41,7 @@ public boolean equals(java.lang.Object o) { return false; } ClassModel classModel = (ClassModel) o; - return Objects.equals(this.propertyClass, classModel.propertyClass); + return Objects.equals(propertyClass, classModel.propertyClass); } @Override @@ -48,6 +49,7 @@ public int hashCode() { return Objects.hash(propertyClass); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Client.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Client.java index ddc948e3f02..8e4618db6b6 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Client.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Client.java @@ -1,14 +1,15 @@ package apimodels; -import java.util.Objects; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; +import java.util.Objects; import javax.validation.constraints.*; /** * Client */ +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Client { @JsonProperty("client") private String client = null; @@ -40,7 +41,7 @@ public boolean equals(java.lang.Object o) { return false; } Client client = (Client) o; - return Objects.equals(this.client, client.client); + return Objects.equals(client, client.client); } @Override @@ -48,6 +49,7 @@ public int hashCode() { return Objects.hash(client); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Dog.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Dog.java index 5beffde3c70..bd7ad700daa 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Dog.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Dog.java @@ -1,15 +1,16 @@ package apimodels; -import java.util.Objects; import apimodels.Animal; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; +import java.util.Objects; import javax.validation.constraints.*; /** * Dog */ +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Dog extends Animal { @JsonProperty("breed") private String breed = null; @@ -41,7 +42,7 @@ public boolean equals(java.lang.Object o) { return false; } Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && + return Objects.equals(breed, dog.breed) && super.equals(o); } @@ -50,6 +51,7 @@ public int hashCode() { return Objects.hash(breed, super.hashCode()); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumArrays.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumArrays.java index 4f9f61cdc6a..a8f126b5124 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumArrays.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumArrays.java @@ -1,16 +1,17 @@ package apimodels; -import java.util.Objects; import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; +import java.util.Objects; import javax.validation.constraints.*; /** * EnumArrays */ +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class EnumArrays { /** * Gets or Sets justSymbol @@ -20,7 +21,7 @@ public enum JustSymbolEnum { DOLLAR("$"); - private String value; + private final String value; JustSymbolEnum(String value) { this.value = value; @@ -54,7 +55,7 @@ public enum ArrayEnumEnum { CRAB("crab"); - private String value; + private final String value; ArrayEnumEnum(String value) { this.value = value; @@ -103,10 +104,10 @@ public EnumArrays arrayEnum(List arrayEnum) { } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { - if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList(); + if (arrayEnum == null) { + arrayEnum = new ArrayList<>(); } - this.arrayEnum.add(arrayEnumItem); + arrayEnum.add(arrayEnumItem); return this; } @@ -132,8 +133,8 @@ public boolean equals(java.lang.Object o) { return false; } EnumArrays enumArrays = (EnumArrays) o; - return Objects.equals(this.justSymbol, enumArrays.justSymbol) && - Objects.equals(this.arrayEnum, enumArrays.arrayEnum); + return Objects.equals(justSymbol, enumArrays.justSymbol) && + Objects.equals(arrayEnum, enumArrays.arrayEnum); } @Override @@ -141,6 +142,7 @@ public int hashCode() { return Objects.hash(justSymbol, arrayEnum); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumClass.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumClass.java index 36f9f81ad15..c0f2b0ad97e 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumClass.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumClass.java @@ -1,10 +1,8 @@ package apimodels; -import java.util.Objects; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import com.fasterxml.jackson.annotation.JsonCreator; /** @@ -18,7 +16,7 @@ public enum EnumClass { _XYZ_("(xyz)"); - private String value; + private final String value; EnumClass(String value) { this.value = value; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java index c36dae6158d..165a4b02a0e 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java @@ -1,15 +1,16 @@ package apimodels; -import java.util.Objects; import apimodels.OuterEnum; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; +import java.util.Objects; import javax.validation.constraints.*; /** * EnumTest */ +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class EnumTest { /** * Gets or Sets enumString @@ -21,7 +22,7 @@ public enum EnumStringEnum { EMPTY(""); - private String value; + private final String value; EnumStringEnum(String value) { this.value = value; @@ -55,7 +56,7 @@ public enum EnumIntegerEnum { NUMBER_MINUS_1(-1); - private Integer value; + private final Integer value; EnumIntegerEnum(Integer value) { this.value = value; @@ -89,7 +90,7 @@ public enum EnumNumberEnum { NUMBER_MINUS_1_DOT_2(-1.2); - private Double value; + private final Double value; EnumNumberEnum(Double value) { this.value = value; @@ -197,10 +198,10 @@ public boolean equals(java.lang.Object o) { return false; } EnumTest enumTest = (EnumTest) o; - return Objects.equals(this.enumString, enumTest.enumString) && - Objects.equals(this.enumInteger, enumTest.enumInteger) && - Objects.equals(this.enumNumber, enumTest.enumNumber) && - Objects.equals(this.outerEnum, enumTest.outerEnum); + return Objects.equals(enumString, enumTest.enumString) && + Objects.equals(enumInteger, enumTest.enumInteger) && + Objects.equals(enumNumber, enumTest.enumNumber) && + Objects.equals(outerEnum, enumTest.outerEnum); } @Override @@ -208,6 +209,7 @@ public int hashCode() { return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FormatTest.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FormatTest.java index 786822e16cb..b3293abc73b 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FormatTest.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FormatTest.java @@ -1,6 +1,5 @@ package apimodels; -import java.util.Objects; import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; @@ -8,11 +7,13 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; +import java.util.Objects; import javax.validation.constraints.*; /** * FormatTest */ +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class FormatTest { @JsonProperty("integer") private Integer integer = null; @@ -315,19 +316,19 @@ public boolean equals(java.lang.Object o) { return false; } FormatTest formatTest = (FormatTest) o; - return Objects.equals(this.integer, formatTest.integer) && - Objects.equals(this.int32, formatTest.int32) && - Objects.equals(this.int64, formatTest.int64) && - Objects.equals(this.number, formatTest.number) && - Objects.equals(this._float, formatTest._float) && - Objects.equals(this._double, formatTest._double) && - Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && - Objects.equals(this.date, formatTest.date) && - Objects.equals(this.dateTime, formatTest.dateTime) && - Objects.equals(this.uuid, formatTest.uuid) && - Objects.equals(this.password, formatTest.password); + return Objects.equals(integer, formatTest.integer) && + Objects.equals(int32, formatTest.int32) && + Objects.equals(int64, formatTest.int64) && + Objects.equals(number, formatTest.number) && + Objects.equals(_float, formatTest._float) && + Objects.equals(_double, formatTest._double) && + Objects.equals(string, formatTest.string) && + Objects.equals(_byte, formatTest._byte) && + Objects.equals(binary, formatTest.binary) && + Objects.equals(date, formatTest.date) && + Objects.equals(dateTime, formatTest.dateTime) && + Objects.equals(uuid, formatTest.uuid) && + Objects.equals(password, formatTest.password); } @Override @@ -335,6 +336,7 @@ public int hashCode() { return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/HasOnlyReadOnly.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/HasOnlyReadOnly.java index f20c9dc7d79..bc1644d165c 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/HasOnlyReadOnly.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/HasOnlyReadOnly.java @@ -1,14 +1,15 @@ package apimodels; -import java.util.Objects; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; +import java.util.Objects; import javax.validation.constraints.*; /** * HasOnlyReadOnly */ +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class HasOnlyReadOnly { @JsonProperty("bar") private String bar = null; @@ -60,8 +61,8 @@ public boolean equals(java.lang.Object o) { return false; } HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; - return Objects.equals(this.bar, hasOnlyReadOnly.bar) && - Objects.equals(this.foo, hasOnlyReadOnly.foo); + return Objects.equals(bar, hasOnlyReadOnly.bar) && + Objects.equals(foo, hasOnlyReadOnly.foo); } @Override @@ -69,6 +70,7 @@ public int hashCode() { return Objects.hash(bar, foo); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MapTest.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MapTest.java index aeadde88370..3d8ced1fc41 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MapTest.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MapTest.java @@ -1,17 +1,18 @@ package apimodels; -import java.util.Objects; import java.util.HashMap; import java.util.List; import java.util.Map; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; +import java.util.Objects; import javax.validation.constraints.*; /** * MapTest */ +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class MapTest { @JsonProperty("map_map_of_string") private Map> mapMapOfString = null; @@ -24,7 +25,7 @@ public enum InnerEnum { LOWER("lower"); - private String value; + private final String value; InnerEnum(String value) { this.value = value; @@ -57,7 +58,7 @@ public MapTest mapMapOfString(Map> mapMapOfString) { public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap>(); + this.mapMapOfString = new HashMap<>(); } this.mapMapOfString.put(key, mapMapOfStringItem); return this; @@ -83,7 +84,7 @@ public MapTest mapOfEnumString(Map mapOfEnumString) { public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap(); + this.mapOfEnumString = new HashMap<>(); } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; @@ -111,8 +112,8 @@ public boolean equals(java.lang.Object o) { return false; } MapTest mapTest = (MapTest) o; - return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString); + return Objects.equals(mapMapOfString, mapTest.mapMapOfString) && + Objects.equals(mapOfEnumString, mapTest.mapOfEnumString); } @Override @@ -120,6 +121,7 @@ public int hashCode() { return Objects.hash(mapMapOfString, mapOfEnumString); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MixedPropertiesAndAdditionalPropertiesClass.java index 1802cfd1b8a..3d8314f1e1c 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MixedPropertiesAndAdditionalPropertiesClass.java @@ -1,6 +1,5 @@ package apimodels; -import java.util.Objects; import apimodels.Animal; import java.time.OffsetDateTime; import java.util.HashMap; @@ -10,11 +9,13 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; +import java.util.Objects; import javax.validation.constraints.*; /** * MixedPropertiesAndAdditionalPropertiesClass */ +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("uuid") private UUID uuid = null; @@ -68,7 +69,7 @@ public MixedPropertiesAndAdditionalPropertiesClass map(Map map) public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { if (this.map == null) { - this.map = new HashMap(); + this.map = new HashMap<>(); } this.map.put(key, mapItem); return this; @@ -97,9 +98,9 @@ public boolean equals(java.lang.Object o) { return false; } MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; - return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && - Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && - Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); + return Objects.equals(uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && + Objects.equals(dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && + Objects.equals(map, mixedPropertiesAndAdditionalPropertiesClass.map); } @Override @@ -107,6 +108,7 @@ public int hashCode() { return Objects.hash(uuid, dateTime, map); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Model200Response.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Model200Response.java index e6f2523f4a3..7e63d2a2ab9 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Model200Response.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Model200Response.java @@ -1,14 +1,15 @@ package apimodels; -import java.util.Objects; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; +import java.util.Objects; import javax.validation.constraints.*; /** * Model for testing model name starting with number */ +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Model200Response { @JsonProperty("name") private Integer name = null; @@ -60,8 +61,8 @@ public boolean equals(java.lang.Object o) { return false; } Model200Response _200Response = (Model200Response) o; - return Objects.equals(this.name, _200Response.name) && - Objects.equals(this.propertyClass, _200Response.propertyClass); + return Objects.equals(name, _200Response.name) && + Objects.equals(propertyClass, _200Response.propertyClass); } @Override @@ -69,6 +70,7 @@ public int hashCode() { return Objects.hash(name, propertyClass); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelApiResponse.java index 9cc1771faf7..bdb4c3b1a35 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelApiResponse.java @@ -1,14 +1,15 @@ package apimodels; -import java.util.Objects; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; +import java.util.Objects; import javax.validation.constraints.*; /** * ModelApiResponse */ +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") private Integer code = null; @@ -80,9 +81,9 @@ public boolean equals(java.lang.Object o) { return false; } ModelApiResponse _apiResponse = (ModelApiResponse) o; - return Objects.equals(this.code, _apiResponse.code) && - Objects.equals(this.type, _apiResponse.type) && - Objects.equals(this.message, _apiResponse.message); + return Objects.equals(code, _apiResponse.code) && + Objects.equals(type, _apiResponse.type) && + Objects.equals(message, _apiResponse.message); } @Override @@ -90,6 +91,7 @@ public int hashCode() { return Objects.hash(code, type, message); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelReturn.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelReturn.java index ed822af5b34..cab65161aae 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelReturn.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelReturn.java @@ -1,14 +1,15 @@ package apimodels; -import java.util.Objects; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; +import java.util.Objects; import javax.validation.constraints.*; /** * Model for testing reserved words */ +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelReturn { @JsonProperty("return") private Integer _return = null; @@ -40,7 +41,7 @@ public boolean equals(java.lang.Object o) { return false; } ModelReturn _return = (ModelReturn) o; - return Objects.equals(this._return, _return._return); + return Objects.equals(_return, _return._return); } @Override @@ -48,6 +49,7 @@ public int hashCode() { return Objects.hash(_return); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Name.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Name.java index d14f6802a5c..94466b89fbf 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Name.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Name.java @@ -1,14 +1,15 @@ package apimodels; -import java.util.Objects; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; +import java.util.Objects; import javax.validation.constraints.*; /** * Model for testing model name same as property name */ +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Name { @JsonProperty("name") private Integer name = null; @@ -101,10 +102,10 @@ public boolean equals(java.lang.Object o) { return false; } Name name = (Name) o; - return Objects.equals(this.name, name.name) && - Objects.equals(this.snakeCase, name.snakeCase) && - Objects.equals(this.property, name.property) && - Objects.equals(this._123Number, name._123Number); + return Objects.equals(name, name.name) && + Objects.equals(snakeCase, name.snakeCase) && + Objects.equals(property, name.property) && + Objects.equals(_123Number, name._123Number); } @Override @@ -112,6 +113,7 @@ public int hashCode() { return Objects.hash(name, snakeCase, property, _123Number); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/NumberOnly.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/NumberOnly.java index 19c44d387b0..4c56adea5c6 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/NumberOnly.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/NumberOnly.java @@ -1,15 +1,16 @@ package apimodels; -import java.util.Objects; import java.math.BigDecimal; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; +import java.util.Objects; import javax.validation.constraints.*; /** * NumberOnly */ +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class NumberOnly { @JsonProperty("JustNumber") private BigDecimal justNumber = null; @@ -42,7 +43,7 @@ public boolean equals(java.lang.Object o) { return false; } NumberOnly numberOnly = (NumberOnly) o; - return Objects.equals(this.justNumber, numberOnly.justNumber); + return Objects.equals(justNumber, numberOnly.justNumber); } @Override @@ -50,6 +51,7 @@ public int hashCode() { return Objects.hash(justNumber); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Order.java index 0d42f4749b7..ba0144ec429 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Order.java @@ -1,15 +1,16 @@ package apimodels; -import java.util.Objects; import java.time.OffsetDateTime; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; +import java.util.Objects; import javax.validation.constraints.*; /** * Order */ +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") private Long id = null; @@ -33,7 +34,7 @@ public enum StatusEnum { DELIVERED("delivered"); - private String value; + private final String value; StatusEnum(String value) { this.value = value; @@ -175,12 +176,12 @@ public boolean equals(java.lang.Object o) { return false; } Order order = (Order) o; - return Objects.equals(this.id, order.id) && - Objects.equals(this.petId, order.petId) && - Objects.equals(this.quantity, order.quantity) && - Objects.equals(this.shipDate, order.shipDate) && - Objects.equals(this.status, order.status) && - Objects.equals(this.complete, order.complete); + return Objects.equals(id, order.id) && + Objects.equals(petId, order.petId) && + Objects.equals(quantity, order.quantity) && + Objects.equals(shipDate, order.shipDate) && + Objects.equals(status, order.status) && + Objects.equals(complete, order.complete); } @Override @@ -188,6 +189,7 @@ public int hashCode() { return Objects.hash(id, petId, quantity, shipDate, status, complete); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterComposite.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterComposite.java index 954202ade9c..78288a15e3b 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterComposite.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterComposite.java @@ -1,15 +1,16 @@ package apimodels; -import java.util.Objects; import java.math.BigDecimal; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; +import java.util.Objects; import javax.validation.constraints.*; /** * OuterComposite */ +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class OuterComposite { @JsonProperty("my_number") private BigDecimal myNumber = null; @@ -82,9 +83,9 @@ public boolean equals(java.lang.Object o) { return false; } OuterComposite outerComposite = (OuterComposite) o; - return Objects.equals(this.myNumber, outerComposite.myNumber) && - Objects.equals(this.myString, outerComposite.myString) && - Objects.equals(this.myBoolean, outerComposite.myBoolean); + return Objects.equals(myNumber, outerComposite.myNumber) && + Objects.equals(myString, outerComposite.myString) && + Objects.equals(myBoolean, outerComposite.myBoolean); } @Override @@ -92,6 +93,7 @@ public int hashCode() { return Objects.hash(myNumber, myString, myBoolean); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterEnum.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterEnum.java index 851f0792f70..f5026996917 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterEnum.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterEnum.java @@ -1,10 +1,8 @@ package apimodels; -import java.util.Objects; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import com.fasterxml.jackson.annotation.JsonCreator; /** @@ -18,7 +16,7 @@ public enum OuterEnum { DELIVERED("delivered"); - private String value; + private final String value; OuterEnum(String value) { this.value = value; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Pet.java index 8030c634419..d1abd7c48aa 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Pet.java @@ -1,6 +1,5 @@ package apimodels; -import java.util.Objects; import apimodels.Category; import apimodels.Tag; import java.util.ArrayList; @@ -8,11 +7,13 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; +import java.util.Objects; import javax.validation.constraints.*; /** * Pet */ +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") private Long id = null; @@ -24,7 +25,7 @@ public class Pet { private String name = null; @JsonProperty("photoUrls") - private List photoUrls = new ArrayList(); + private List photoUrls = new ArrayList<>(); @JsonProperty("tags") private List tags = null; @@ -39,7 +40,7 @@ public enum StatusEnum { SOLD("sold"); - private String value; + private final String value; StatusEnum(String value) { this.value = value; @@ -124,7 +125,7 @@ public Pet photoUrls(List photoUrls) { } public Pet addPhotoUrlsItem(String photoUrlsItem) { - this.photoUrls.add(photoUrlsItem); + photoUrls.add(photoUrlsItem); return this; } @@ -147,10 +148,10 @@ public Pet tags(List tags) { } public Pet addTagsItem(Tag tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList(); + if (tags == null) { + tags = new ArrayList<>(); } - this.tags.add(tagsItem); + tags.add(tagsItem); return this; } @@ -194,12 +195,12 @@ public boolean equals(java.lang.Object o) { return false; } Pet pet = (Pet) o; - return Objects.equals(this.id, pet.id) && - Objects.equals(this.category, pet.category) && - Objects.equals(this.name, pet.name) && - Objects.equals(this.photoUrls, pet.photoUrls) && - Objects.equals(this.tags, pet.tags) && - Objects.equals(this.status, pet.status); + return Objects.equals(id, pet.id) && + Objects.equals(category, pet.category) && + Objects.equals(name, pet.name) && + Objects.equals(photoUrls, pet.photoUrls) && + Objects.equals(tags, pet.tags) && + Objects.equals(status, pet.status); } @Override @@ -207,6 +208,7 @@ public int hashCode() { return Objects.hash(id, category, name, photoUrls, tags, status); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ReadOnlyFirst.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ReadOnlyFirst.java index 56f1d6993d8..1a3e4e7fcc2 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ReadOnlyFirst.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ReadOnlyFirst.java @@ -1,14 +1,15 @@ package apimodels; -import java.util.Objects; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; +import java.util.Objects; import javax.validation.constraints.*; /** * ReadOnlyFirst */ +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ReadOnlyFirst { @JsonProperty("bar") private String bar = null; @@ -60,8 +61,8 @@ public boolean equals(java.lang.Object o) { return false; } ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; - return Objects.equals(this.bar, readOnlyFirst.bar) && - Objects.equals(this.baz, readOnlyFirst.baz); + return Objects.equals(bar, readOnlyFirst.bar) && + Objects.equals(baz, readOnlyFirst.baz); } @Override @@ -69,6 +70,7 @@ public int hashCode() { return Objects.hash(bar, baz); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/SpecialModelName.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/SpecialModelName.java index 0916d0bf5d6..fa827dbd77f 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/SpecialModelName.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/SpecialModelName.java @@ -1,14 +1,15 @@ package apimodels; -import java.util.Objects; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; +import java.util.Objects; import javax.validation.constraints.*; /** * SpecialModelName */ +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class SpecialModelName { @JsonProperty("$special[property.name]") private Long specialPropertyName = null; @@ -40,7 +41,7 @@ public boolean equals(java.lang.Object o) { return false; } SpecialModelName specialModelName = (SpecialModelName) o; - return Objects.equals(this.specialPropertyName, specialModelName.specialPropertyName); + return Objects.equals(specialPropertyName, specialModelName.specialPropertyName); } @Override @@ -48,6 +49,7 @@ public int hashCode() { return Objects.hash(specialPropertyName); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Tag.java index 64c4cd72395..033f9d61bd7 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Tag.java @@ -1,14 +1,15 @@ package apimodels; -import java.util.Objects; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; +import java.util.Objects; import javax.validation.constraints.*; /** * Tag */ +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") private Long id = null; @@ -60,8 +61,8 @@ public boolean equals(java.lang.Object o) { return false; } Tag tag = (Tag) o; - return Objects.equals(this.id, tag.id) && - Objects.equals(this.name, tag.name); + return Objects.equals(id, tag.id) && + Objects.equals(name, tag.name); } @Override @@ -69,6 +70,7 @@ public int hashCode() { return Objects.hash(id, name); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/User.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/User.java index 2c2f38e222d..a479bb5e5f0 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/User.java @@ -1,14 +1,15 @@ package apimodels; -import java.util.Objects; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; +import java.util.Objects; import javax.validation.constraints.*; /** * User */ +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") private Long id = null; @@ -180,14 +181,14 @@ public boolean equals(java.lang.Object o) { return false; } User user = (User) o; - return Objects.equals(this.id, user.id) && - Objects.equals(this.username, user.username) && - Objects.equals(this.firstName, user.firstName) && - Objects.equals(this.lastName, user.lastName) && - Objects.equals(this.email, user.email) && - Objects.equals(this.password, user.password) && - Objects.equals(this.phone, user.phone) && - Objects.equals(this.userStatus, user.userStatus); + return Objects.equals(id, user.id) && + Objects.equals(username, user.username) && + Objects.equals(firstName, user.firstName) && + Objects.equals(lastName, user.lastName) && + Objects.equals(email, user.email) && + Objects.equals(password, user.password) && + Objects.equals(phone, user.phone) && + Objects.equals(userStatus, user.userStatus); } @Override @@ -195,6 +196,7 @@ public int hashCode() { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } + @SuppressWarnings("StringBufferReplaceableByString") @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java index 619bfad98b6..1629db78abc 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java @@ -15,7 +15,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; -import java.io.IOException; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; @@ -173,7 +172,7 @@ public Result testEndpointParameters() throws Exception { String valuestring = (request().body().asMultipartFormData().asFormUrlEncoded().get("string"))[0]; String string; if (valuestring != null) { - string = (String)valuestring; + string = valuestring; } else { string = null; @@ -181,12 +180,12 @@ public Result testEndpointParameters() throws Exception { String valuepatternWithoutDelimiter = (request().body().asMultipartFormData().asFormUrlEncoded().get("pattern_without_delimiter"))[0]; String patternWithoutDelimiter; - patternWithoutDelimiter = (String)valuepatternWithoutDelimiter; + patternWithoutDelimiter = valuepatternWithoutDelimiter; String value_byte = (request().body().asMultipartFormData().asFormUrlEncoded().get("byte"))[0]; byte[] _byte; - _byte = (String)value_byte; + _byte = value_byte; String valuebinary = (request().body().asMultipartFormData().asFormUrlEncoded().get("binary"))[0]; byte[] binary; @@ -215,7 +214,7 @@ public Result testEndpointParameters() throws Exception { String valuepassword = (request().body().asMultipartFormData().asFormUrlEncoded().get("password"))[0]; String password; if (valuepassword != null) { - password = (String)valuepassword; + password = valuepassword; } else { password = null; @@ -223,7 +222,7 @@ public Result testEndpointParameters() throws Exception { String valueparamCallback = (request().body().asMultipartFormData().asFormUrlEncoded().get("callback"))[0]; String paramCallback; if (valueparamCallback != null) { - paramCallback = (String)valueparamCallback; + paramCallback = valueparamCallback; } else { paramCallback = null; @@ -245,7 +244,7 @@ public Result testEnumParameters() throws Exception { String valueenumQueryString = request().getQueryString("enumQueryString"); String enumQueryString; if (valueenumQueryString != null) { - enumQueryString = (String)valueenumQueryString; + enumQueryString = valueenumQueryString; } else { enumQueryString = "-efg"; @@ -267,7 +266,7 @@ public Result testEnumParameters() throws Exception { String valueenumFormString = (request().body().asMultipartFormData().asFormUrlEncoded().get("enum_form_string"))[0]; String enumFormString; if (valueenumFormString != null) { - enumFormString = (String)valueenumFormString; + enumFormString = valueenumFormString; } else { enumFormString = "-efg"; @@ -289,7 +288,7 @@ public Result testEnumParameters() throws Exception { String valueenumHeaderString = request().getHeader("enum_header_string"); String enumHeaderString; if (valueenumHeaderString != null) { - enumHeaderString = (String)valueenumHeaderString; + enumHeaderString = valueenumHeaderString; } else { enumHeaderString = "-efg"; @@ -305,12 +304,12 @@ public Result testJsonFormData() throws Exception { String valueparam = (request().body().asMultipartFormData().asFormUrlEncoded().get("param"))[0]; String param; - param = (String)valueparam; + param = valueparam; String valueparam2 = (request().body().asMultipartFormData().asFormUrlEncoded().get("param2"))[0]; String param2; - param2 = (String)valueparam2; + param2 = valueparam2; imp.testJsonFormData(param, param2); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImpInterface.java index 09ee51bf0f7..210755319d2 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImpInterface.java @@ -13,6 +13,7 @@ import javax.validation.constraints.*; +@SuppressWarnings("RedundantThrows") public interface FakeApiControllerImpInterface { Boolean fakeOuterBooleanSerialize(Boolean body) throws Exception; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiController.java index cd902704e64..dac59371ba9 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiController.java @@ -11,7 +11,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; -import java.io.IOException; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiControllerImpInterface.java index f921b45bd14..8ea6e6598f1 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiControllerImpInterface.java @@ -9,6 +9,7 @@ import javax.validation.constraints.*; +@SuppressWarnings("RedundantThrows") public interface FakeClassnameTags123ApiControllerImpInterface { Client testClassname(Client body) throws Exception; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiController.java index 74731b82cdb..03b79d7f2e7 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiController.java @@ -13,7 +13,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; -import java.io.IOException; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; @@ -53,7 +52,7 @@ public Result deletePet(Long petId) throws Exception { String valueapiKey = request().getHeader("api_key"); String apiKey; if (valueapiKey != null) { - apiKey = (String)valueapiKey; + apiKey = valueapiKey; } else { apiKey = null; @@ -129,7 +128,7 @@ public Result updatePetWithForm(Long petId) throws Exception { String valuename = (request().body().asMultipartFormData().asFormUrlEncoded().get("name"))[0]; String name; if (valuename != null) { - name = (String)valuename; + name = valuename; } else { name = null; @@ -137,7 +136,7 @@ public Result updatePetWithForm(Long petId) throws Exception { String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0]; String status; if (valuestatus != null) { - status = (String)valuestatus; + status = valuestatus; } else { status = null; @@ -153,7 +152,7 @@ public Result uploadFile(Long petId) throws Exception { String valueadditionalMetadata = (request().body().asMultipartFormData().asFormUrlEncoded().get("additionalMetadata"))[0]; String additionalMetadata; if (valueadditionalMetadata != null) { - additionalMetadata = (String)valueadditionalMetadata; + additionalMetadata = valueadditionalMetadata; } else { additionalMetadata = null; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImpInterface.java index df027c27920..307c6c18cfb 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImpInterface.java @@ -11,6 +11,7 @@ import javax.validation.constraints.*; +@SuppressWarnings("RedundantThrows") public interface PetApiControllerImpInterface { void addPet(Pet body) throws Exception; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiController.java index 0be3ecc4276..5d5ae986166 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiController.java @@ -12,7 +12,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; -import java.io.IOException; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiControllerImpInterface.java index 766a29c4f17..b42e4d6d3d0 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiControllerImpInterface.java @@ -10,6 +10,7 @@ import javax.validation.constraints.*; +@SuppressWarnings("RedundantThrows") public interface StoreApiControllerImpInterface { void deleteOrder(String orderId) throws Exception; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java index eeab90cf178..9229d39a363 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java @@ -12,7 +12,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; -import java.io.IOException; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; @@ -102,12 +101,12 @@ public Result loginUser() throws Exception { String valueusername = request().getQueryString("username"); String username; - username = (String)valueusername; + username = valueusername; String valuepassword = request().getQueryString("password"); String password; - password = (String)valuepassword; + password = valuepassword; String obj = imp.loginUser(username, password); JsonNode result = mapper.valueToTree(obj); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImpInterface.java index 474905c2b2e..1290c84835f 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImpInterface.java @@ -10,6 +10,7 @@ import javax.validation.constraints.*; +@SuppressWarnings("RedundantThrows") public interface UserApiControllerImpInterface { void createUser(User body) throws Exception; diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Category.java index a6bcbd6b517..399a6f2646a 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Category.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; /** * A category for a pet diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/ModelApiResponse.java index 5931d724088..9b3b2fc7e92 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/ModelApiResponse.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; /** * Describes the result of uploading an image resource diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Order.java index 095ad0e06d5..873a6aebd25 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Order.java @@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; /** * An order for a pets from the pet store diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Pet.java index ecf722d5998..e6adacc5d5c 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Pet.java @@ -7,7 +7,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; /** * A pet for sale in the pet store diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Tag.java index fc7bc35400d..cc8a86828f0 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Tag.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; /** * A tag for a pet diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/User.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/User.java index 50645a682f3..5fc613edfbe 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/User.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; /** * A User who is purchasing from the pet store diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiControllerImpInterface.java index 38b7e94c872..144362644af 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiControllerImpInterface.java @@ -11,7 +11,7 @@ @SuppressWarnings("RedundantThrows") -interface PetApiControllerImpInterface { +public interface PetApiControllerImpInterface { void addPet(Pet body) throws Exception; void deletePet(Long petId, String apiKey) throws Exception; diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiControllerImpInterface.java index b49be6e002e..7a9c3fd82e8 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiControllerImpInterface.java @@ -10,7 +10,7 @@ @SuppressWarnings("RedundantThrows") -interface StoreApiControllerImpInterface { +public interface StoreApiControllerImpInterface { void deleteOrder(String orderId) throws Exception; Map getInventory() throws Exception; diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImpInterface.java index 4a018920f42..8c5a5ee0af6 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImpInterface.java @@ -10,7 +10,7 @@ @SuppressWarnings("RedundantThrows") -interface UserApiControllerImpInterface { +public interface UserApiControllerImpInterface { void createUser(User body) throws Exception; void createUsersWithArrayInput(List body) throws Exception; diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/logs/application.log b/samples/server/petstore/java-play-framework-no-bean-validation/logs/application.log deleted file mode 100644 index 2086ba3c321..00000000000 --- a/samples/server/petstore/java-play-framework-no-bean-validation/logs/application.log +++ /dev/null @@ -1 +0,0 @@ -2017-08-08 12:59:36,779 [INFO] from play.api.Play in ForkJoinPool-1-worker-1 - Application started (Dev) diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Category.java index 452f72c802e..fb9207f4b5d 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Category.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/ModelApiResponse.java index 58de708c32a..05911012313 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/ModelApiResponse.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Order.java index cf4aae16778..987ef07d460 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Order.java @@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Pet.java index 97eb5f88ed6..430bbe805ce 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Pet.java @@ -7,7 +7,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Tag.java index e4bdd6b7ffe..709fef2cf11 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Tag.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/User.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/User.java index 4b9eeed77ae..ba41fb76f80 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/User.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiControllerImpInterface.java index fe43f1290d5..6efc073d0f2 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiControllerImpInterface.java @@ -12,7 +12,7 @@ import javax.validation.constraints.*; @SuppressWarnings("RedundantThrows") -interface PetApiControllerImpInterface { +public interface PetApiControllerImpInterface { void addPet(Pet body) ; void deletePet(Long petId, String apiKey) ; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiControllerImpInterface.java index b4bac6451cb..70d313028c6 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiControllerImpInterface.java @@ -11,7 +11,7 @@ import javax.validation.constraints.*; @SuppressWarnings("RedundantThrows") -interface StoreApiControllerImpInterface { +public interface StoreApiControllerImpInterface { void deleteOrder(String orderId) ; Map getInventory() ; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImpInterface.java index da9448fa37c..c79d4b93820 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImpInterface.java @@ -11,7 +11,7 @@ import javax.validation.constraints.*; @SuppressWarnings("RedundantThrows") -interface UserApiControllerImpInterface { +public interface UserApiControllerImpInterface { void createUser(User body) ; void createUsersWithArrayInput(List body) ; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/logs/application.log b/samples/server/petstore/java-play-framework-no-exception-handling/logs/application.log deleted file mode 100644 index 469f563f571..00000000000 --- a/samples/server/petstore/java-play-framework-no-exception-handling/logs/application.log +++ /dev/null @@ -1 +0,0 @@ -2017-08-08 13:00:03,356 [INFO] from play.api.Play in ForkJoinPool-1-worker-1 - Application started (Dev) diff --git a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Category.java index 452f72c802e..fb9207f4b5d 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Category.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/ModelApiResponse.java index 58de708c32a..05911012313 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/ModelApiResponse.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Order.java index cf4aae16778..987ef07d460 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Order.java @@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Pet.java index 97eb5f88ed6..430bbe805ce 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Pet.java @@ -7,7 +7,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Tag.java index e4bdd6b7ffe..709fef2cf11 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Tag.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/User.java b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/User.java index 4b9eeed77ae..ba41fb76f80 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/User.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework-no-interface/logs/application.log b/samples/server/petstore/java-play-framework-no-interface/logs/application.log index d9c5849aa5e..029a73a780c 100644 --- a/samples/server/petstore/java-play-framework-no-interface/logs/application.log +++ b/samples/server/petstore/java-play-framework-no-interface/logs/application.log @@ -1 +1 @@ -2017-08-08 13:00:28,358 [INFO] from play.api.Play in ForkJoinPool-1-worker-1 - Application started (Dev) +2017-08-09 12:45:42,656 [INFO] from play.api.Play in ForkJoinPool-1-worker-1 - Application started (Dev) diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Category.java index 452f72c802e..fb9207f4b5d 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Category.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/ModelApiResponse.java index 58de708c32a..05911012313 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/ModelApiResponse.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Order.java index cf4aae16778..987ef07d460 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Order.java @@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Pet.java index 97eb5f88ed6..430bbe805ce 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Pet.java @@ -7,7 +7,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Tag.java index e4bdd6b7ffe..709fef2cf11 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Tag.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/User.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/User.java index 4b9eeed77ae..ba41fb76f80 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/User.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiControllerImpInterface.java index 9ad4dcb3013..307c6c18cfb 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiControllerImpInterface.java @@ -12,7 +12,7 @@ import javax.validation.constraints.*; @SuppressWarnings("RedundantThrows") -interface PetApiControllerImpInterface { +public interface PetApiControllerImpInterface { void addPet(Pet body) throws Exception; void deletePet(Long petId, String apiKey) throws Exception; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiControllerImpInterface.java index 967298f7e67..b42e4d6d3d0 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiControllerImpInterface.java @@ -11,7 +11,7 @@ import javax.validation.constraints.*; @SuppressWarnings("RedundantThrows") -interface StoreApiControllerImpInterface { +public interface StoreApiControllerImpInterface { void deleteOrder(String orderId) throws Exception; Map getInventory() throws Exception; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImpInterface.java index 00b7778296f..1290c84835f 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImpInterface.java @@ -11,7 +11,7 @@ import javax.validation.constraints.*; @SuppressWarnings("RedundantThrows") -interface UserApiControllerImpInterface { +public interface UserApiControllerImpInterface { void createUser(User body) throws Exception; void createUsersWithArrayInput(List body) throws Exception; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/logs/application.log b/samples/server/petstore/java-play-framework-no-swagger-ui/logs/application.log deleted file mode 100644 index 19636d85ca6..00000000000 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/logs/application.log +++ /dev/null @@ -1 +0,0 @@ -2017-08-08 13:00:54,728 [INFO] from play.api.Play in ForkJoinPool-1-worker-1 - Application started (Dev) diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Category.java index 452f72c802e..fb9207f4b5d 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Category.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/ModelApiResponse.java index 58de708c32a..05911012313 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/ModelApiResponse.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Order.java index cf4aae16778..987ef07d460 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Order.java @@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Pet.java index 97eb5f88ed6..430bbe805ce 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Pet.java @@ -7,7 +7,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Tag.java index e4bdd6b7ffe..709fef2cf11 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Tag.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/User.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/User.java index 4b9eeed77ae..ba41fb76f80 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/User.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiControllerImpInterface.java index 9ad4dcb3013..307c6c18cfb 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiControllerImpInterface.java @@ -12,7 +12,7 @@ import javax.validation.constraints.*; @SuppressWarnings("RedundantThrows") -interface PetApiControllerImpInterface { +public interface PetApiControllerImpInterface { void addPet(Pet body) throws Exception; void deletePet(Long petId, String apiKey) throws Exception; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiControllerImpInterface.java index 967298f7e67..b42e4d6d3d0 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiControllerImpInterface.java @@ -11,7 +11,7 @@ import javax.validation.constraints.*; @SuppressWarnings("RedundantThrows") -interface StoreApiControllerImpInterface { +public interface StoreApiControllerImpInterface { void deleteOrder(String orderId) throws Exception; Map getInventory() throws Exception; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImpInterface.java index 00b7778296f..1290c84835f 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImpInterface.java @@ -11,7 +11,7 @@ import javax.validation.constraints.*; @SuppressWarnings("RedundantThrows") -interface UserApiControllerImpInterface { +public interface UserApiControllerImpInterface { void createUser(User body) throws Exception; void createUsersWithArrayInput(List body) throws Exception; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/logs/application.log b/samples/server/petstore/java-play-framework-no-wrap-calls/logs/application.log deleted file mode 100644 index a99b01fe298..00000000000 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/logs/application.log +++ /dev/null @@ -1 +0,0 @@ -2017-08-08 13:01:23,306 [INFO] from play.api.Play in ForkJoinPool-1-worker-1 - Application started (Dev) diff --git a/samples/server/petstore/java-play-framework/app/apimodels/Category.java b/samples/server/petstore/java-play-framework/app/apimodels/Category.java index 452f72c802e..fb9207f4b5d 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/Category.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java index 58de708c32a..05911012313 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework/app/apimodels/Order.java b/samples/server/petstore/java-play-framework/app/apimodels/Order.java index cf4aae16778..987ef07d460 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/Order.java @@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework/app/apimodels/Pet.java index 97eb5f88ed6..430bbe805ce 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/Pet.java @@ -7,7 +7,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework/app/apimodels/Tag.java index e4bdd6b7ffe..709fef2cf11 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/Tag.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework/app/apimodels/User.java b/samples/server/petstore/java-play-framework/app/apimodels/User.java index 4b9eeed77ae..ba41fb76f80 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/User.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; -import javax.validation.constraints.*; import java.util.Objects; import javax.validation.constraints.*; /** diff --git a/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImpInterface.java index 9ad4dcb3013..307c6c18cfb 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImpInterface.java @@ -12,7 +12,7 @@ import javax.validation.constraints.*; @SuppressWarnings("RedundantThrows") -interface PetApiControllerImpInterface { +public interface PetApiControllerImpInterface { void addPet(Pet body) throws Exception; void deletePet(Long petId, String apiKey) throws Exception; diff --git a/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImpInterface.java b/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImpInterface.java index 967298f7e67..b42e4d6d3d0 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImpInterface.java @@ -11,7 +11,7 @@ import javax.validation.constraints.*; @SuppressWarnings("RedundantThrows") -interface StoreApiControllerImpInterface { +public interface StoreApiControllerImpInterface { void deleteOrder(String orderId) throws Exception; Map getInventory() throws Exception; diff --git a/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImpInterface.java index 00b7778296f..1290c84835f 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImpInterface.java @@ -11,7 +11,7 @@ import javax.validation.constraints.*; @SuppressWarnings("RedundantThrows") -interface UserApiControllerImpInterface { +public interface UserApiControllerImpInterface { void createUser(User body) throws Exception; void createUsersWithArrayInput(List body) throws Exception; diff --git a/samples/server/petstore/java-play-framework/logs/application.log b/samples/server/petstore/java-play-framework/logs/application.log deleted file mode 100644 index 91d83963048..00000000000 --- a/samples/server/petstore/java-play-framework/logs/application.log +++ /dev/null @@ -1 +0,0 @@ -2017-08-08 12:55:27,544 [INFO] from play.api.Play in ForkJoinPool-1-worker-1 - Application started (Dev) From 12393369e46c7d99fe8cbf78ba64929347e6eceb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20C=C3=B4t=C3=A9?= Date: Wed, 9 Aug 2017 15:36:47 -0400 Subject: [PATCH 8/8] Add missing imports + fix to the regex. Generation of the samples --- .../languages/JavaPlayFrameworkCodegen.java | 2 +- .../newApiController.mustache | 23 +++++++++++++++---- .../app/controllers/PetApiController.java | 9 +------- .../app/controllers/StoreApiController.java | 5 +--- .../app/controllers/UserApiController.java | 9 +------- .../app/controllers/FakeApiController.java | 17 +------------- .../FakeClassnameTags123ApiController.java | 3 +-- .../app/controllers/PetApiController.java | 19 ++------------- .../app/controllers/StoreApiController.java | 9 +------- .../app/controllers/UserApiController.java | 17 +------------- .../app/controllers/PetApiController.java | 19 ++------------- .../app/controllers/StoreApiController.java | 9 +------- .../app/controllers/UserApiController.java | 17 +------------- .../app/controllers/PetApiController.java | 19 ++------------- .../app/controllers/StoreApiController.java | 9 +------- .../app/controllers/UserApiController.java | 17 +------------- .../app/controllers/PetApiController.java | 19 ++------------- .../app/controllers/StoreApiController.java | 9 +------- .../app/controllers/UserApiController.java | 17 +------------- .../app/controllers/PetApiController.java | 19 ++------------- .../app/controllers/StoreApiController.java | 9 +------- .../app/controllers/UserApiController.java | 17 +------------- .../app/controllers/PetApiController.java | 19 ++------------- .../app/controllers/StoreApiController.java | 9 +------- .../app/controllers/UserApiController.java | 17 +------------- .../app/controllers/PetApiController.java | 19 ++------------- .../app/controllers/StoreApiController.java | 9 +------- .../app/controllers/UserApiController.java | 17 +------------- 28 files changed, 52 insertions(+), 331 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaPlayFrameworkCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaPlayFrameworkCodegen.java index 055d467c908..452bfdd29e9 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaPlayFrameworkCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaPlayFrameworkCodegen.java @@ -263,7 +263,7 @@ public Map postProcessOperations(Map objs) { } } - Pattern pathVariableMatcher = Pattern.compile("\\{(.+)}"); + Pattern pathVariableMatcher = Pattern.compile("\\{([^}]+)}"); Matcher match = pathVariableMatcher.matcher(operation.path); while (match.find()) { String completeMatch = match.group(); diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApiController.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApiController.mustache index 5b17e820216..518d3ea5f9f 100644 --- a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApiController.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/newApiController.mustache @@ -12,6 +12,7 @@ import java.util.ArrayList; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; +import java.io.File; {{^handleExceptions}} import java.io.IOException; {{/handleExceptions}} @@ -92,7 +93,8 @@ public class {{classname}}Controller extends Controller { {{#formParams}} {{^notFile}} {{{dataType}}} {{paramName}} = request().body().asMultipartFormData().getFile("{{baseName}}"); - {{#required}}if (({{paramName}} == null || ((File) {{paramName}}.getFile()).length() == 0)) { + {{#required}} + if (({{paramName}} == null || ((File) {{paramName}}.getFile()).length() == 0)) { throw new RuntimeException("File cannot be empty"); } {{/required}} @@ -150,10 +152,21 @@ public class {{classname}}Controller extends Controller { entry.getValue().validate(); } {{/isMapContainer}}{{^returnContainer}}obj.validate();{{/returnContainer}}{{/useBeanValidation}}{{/returnTypeIsPrimitive}}{{/isResponseFile}}{{/returnType}} - {{#returnType}}{{^isResponseFile}}JsonNode result = mapper.valueToTree(obj); - return ok(result);{{/isResponseFile}}{{#isResponseFile}}return ok(obj);{{/isResponseFile}}{{/returnType}} - {{^returnType}}return ok();{{/returnType}}{{/controllerOnly}} - {{#controllerOnly}}return ok();{{/controllerOnly}} + {{#returnType}} + {{^isResponseFile}}JsonNode result = mapper.valueToTree(obj); + return ok(result); + {{/isResponseFile}} + {{#isResponseFile}} + return ok(obj); + {{/isResponseFile}} + {{/returnType}} + {{^returnType}} + return ok(); + {{/returnType}} + {{/controllerOnly}} + {{#controllerOnly}} + return ok(); + {{/controllerOnly}} } {{/operation}} } diff --git a/samples/server/petstore/java-play-framework-controller-only/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-controller-only/app/controllers/PetApiController.java index a8cc73ec54e..57c67da82ac 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/controllers/PetApiController.java @@ -13,6 +13,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; +import java.io.File; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; @@ -39,7 +40,6 @@ public Result addPet() throws Exception { body = mapper.readValue(nodebody.toString(), Pet.class); body.validate(); - return ok(); } @@ -53,7 +53,6 @@ public Result deletePet(Long petId) throws Exception { } else { apiKey = null; } - return ok(); } @@ -65,7 +64,6 @@ public Result findPetsByStatus() throws Exception { //noinspection UseBulkOperation status.add(curParam); } - return ok(); } @@ -77,13 +75,11 @@ public Result findPetsByTags() throws Exception { //noinspection UseBulkOperation tags.add(curParam); } - return ok(); } @ApiAction public Result getPetById(Long petId) throws Exception { - return ok(); } @@ -95,7 +91,6 @@ public Result updatePet() throws Exception { body = mapper.readValue(nodebody.toString(), Pet.class); body.validate(); - return ok(); } @@ -117,7 +112,6 @@ public Result updatePetWithForm(Long petId) throws Exception { } else { status = null; } - return ok(); } @@ -132,7 +126,6 @@ public Result uploadFile(Long petId) throws Exception { additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); - return ok(); } } diff --git a/samples/server/petstore/java-play-framework-controller-only/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-controller-only/app/controllers/StoreApiController.java index 77e2dab59a2..566bf84526c 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/controllers/StoreApiController.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; +import java.io.File; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; @@ -32,19 +33,16 @@ private StoreApiController() { @ApiAction public Result deleteOrder(String orderId) throws Exception { - return ok(); } @ApiAction public Result getInventory() throws Exception { - return ok(); } @ApiAction public Result getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { - return ok(); } @@ -56,7 +54,6 @@ public Result placeOrder() throws Exception { body = mapper.readValue(nodebody.toString(), Order.class); body.validate(); - return ok(); } } diff --git a/samples/server/petstore/java-play-framework-controller-only/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-controller-only/app/controllers/UserApiController.java index 26dd60b363f..7d93808f3af 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/controllers/UserApiController.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; +import java.io.File; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; @@ -38,7 +39,6 @@ public Result createUser() throws Exception { body = mapper.readValue(nodebody.toString(), User.class); body.validate(); - return ok(); } @@ -52,7 +52,6 @@ public Result createUsersWithArrayInput() throws Exception { curItem.validate(); } - return ok(); } @@ -66,19 +65,16 @@ public Result createUsersWithListInput() throws Exception { curItem.validate(); } - return ok(); } @ApiAction public Result deleteUser(String username) throws Exception { - return ok(); } @ApiAction public Result getUserByName(String username) throws Exception { - return ok(); } @@ -94,13 +90,11 @@ public Result loginUser() throws Exception { password = valuepassword; - return ok(); } @ApiAction public Result logoutUser() throws Exception { - return ok(); } @@ -112,7 +106,6 @@ public Result updateUser(String username) throws Exception { body = mapper.readValue(nodebody.toString(), User.class); body.validate(); - return ok(); } } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java index 1629db78abc..dfa826fb7e6 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java @@ -15,6 +15,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; +import java.io.File; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; @@ -49,8 +50,6 @@ public Result fakeOuterBooleanSerialize() throws Exception { Boolean obj = imp.fakeOuterBooleanSerialize(body); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -68,8 +67,6 @@ public Result fakeOuterCompositeSerialize() throws Exception { obj.validate(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -87,8 +84,6 @@ public Result fakeOuterNumberSerialize() throws Exception { obj.validate(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -105,8 +100,6 @@ public Result fakeOuterStringSerialize() throws Exception { String obj = imp.fakeOuterStringSerialize(body); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -121,8 +114,6 @@ public Result testClientModel() throws Exception { obj.validate(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -228,9 +219,7 @@ public Result testEndpointParameters() throws Exception { paramCallback = null; } imp.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); - return ok(); - } @ApiAction @@ -294,9 +283,7 @@ public Result testEnumParameters() throws Exception { enumHeaderString = "-efg"; } imp.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); - return ok(); - } @ApiAction @@ -312,8 +299,6 @@ public Result testJsonFormData() throws Exception { param2 = valueparam2; imp.testJsonFormData(param, param2); - return ok(); - } } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiController.java index dac59371ba9..2a2716d673b 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiController.java @@ -11,6 +11,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; +import java.io.File; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; @@ -43,7 +44,5 @@ public Result testClassname() throws Exception { obj.validate(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiController.java index 03b79d7f2e7..6ea11161da1 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiController.java @@ -13,6 +13,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; +import java.io.File; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; @@ -42,9 +43,7 @@ public Result addPet() throws Exception { body.validate(); imp.addPet(body); - return ok(); - } @ApiAction @@ -58,9 +57,7 @@ public Result deletePet(Long petId) throws Exception { apiKey = null; } imp.deletePet(petId, apiKey); - return ok(); - } @ApiAction @@ -77,8 +74,6 @@ public Result findPetsByStatus() throws Exception { } JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -95,8 +90,6 @@ public Result findPetsByTags() throws Exception { } JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -105,8 +98,6 @@ public Result getPetById(Long petId) throws Exception { obj.validate(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -118,9 +109,7 @@ public Result updatePet() throws Exception { body.validate(); imp.updatePet(body); - return ok(); - } @ApiAction @@ -142,9 +131,7 @@ public Result updatePetWithForm(Long petId) throws Exception { status = null; } imp.updatePetWithForm(petId, name, status); - return ok(); - } @ApiAction @@ -158,11 +145,9 @@ public Result uploadFile(Long petId) throws Exception { additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); - ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); + ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); obj.validate(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiController.java index 5d5ae986166..92fafa4b746 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiController.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; +import java.io.File; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; @@ -35,9 +36,7 @@ private StoreApiController(StoreApiControllerImpInterface imp) { @ApiAction public Result deleteOrder(String orderId) throws Exception { imp.deleteOrder(orderId); - return ok(); - } @ApiAction @@ -45,8 +44,6 @@ public Result getInventory() throws Exception { Map obj = imp.getInventory(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -55,8 +52,6 @@ public Result getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { obj.validate(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -71,7 +66,5 @@ public Result placeOrder() throws Exception { obj.validate(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java index 9229d39a363..c084e050fa2 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; +import java.io.File; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; @@ -41,9 +42,7 @@ public Result createUser() throws Exception { body.validate(); imp.createUser(body); - return ok(); - } @ApiAction @@ -57,9 +56,7 @@ public Result createUsersWithArrayInput() throws Exception { } imp.createUsersWithArrayInput(body); - return ok(); - } @ApiAction @@ -73,17 +70,13 @@ public Result createUsersWithListInput() throws Exception { } imp.createUsersWithListInput(body); - return ok(); - } @ApiAction public Result deleteUser(String username) throws Exception { imp.deleteUser(username); - return ok(); - } @ApiAction @@ -92,8 +85,6 @@ public Result getUserByName(String username) throws Exception { obj.validate(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -111,16 +102,12 @@ public Result loginUser() throws Exception { String obj = imp.loginUser(username, password); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction public Result logoutUser() throws Exception { imp.logoutUser(); - return ok(); - } @ApiAction @@ -132,8 +119,6 @@ public Result updateUser(String username) throws Exception { body.validate(); imp.updateUser(username, body); - return ok(); - } } diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiController.java index 701f47f0d08..93298749857 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiController.java @@ -13,6 +13,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; +import java.io.File; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; @@ -40,9 +41,7 @@ public Result addPet() throws Exception { body = mapper.readValue(nodebody.toString(), Pet.class); imp.addPet(body); - return ok(); - } @ApiAction @@ -56,9 +55,7 @@ public Result deletePet(Long petId) throws Exception { apiKey = null; } imp.deletePet(petId, apiKey); - return ok(); - } @ApiAction @@ -72,8 +69,6 @@ public Result findPetsByStatus() throws Exception { List obj = imp.findPetsByStatus(status); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -87,8 +82,6 @@ public Result findPetsByTags() throws Exception { List obj = imp.findPetsByTags(tags); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -96,8 +89,6 @@ public Result getPetById(Long petId) throws Exception { Pet obj = imp.getPetById(petId); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -108,9 +99,7 @@ public Result updatePet() throws Exception { body = mapper.readValue(nodebody.toString(), Pet.class); imp.updatePet(body); - return ok(); - } @ApiAction @@ -132,9 +121,7 @@ public Result updatePetWithForm(Long petId) throws Exception { status = null; } imp.updatePetWithForm(petId, name, status); - return ok(); - } @ApiAction @@ -148,10 +135,8 @@ public Result uploadFile(Long petId) throws Exception { additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); - ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); + ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } } diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiController.java index 0b2b94e6a8b..3b0cd2a23b3 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiController.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; +import java.io.File; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; @@ -34,9 +35,7 @@ private StoreApiController(StoreApiControllerImpInterface imp) { @ApiAction public Result deleteOrder(String orderId) throws Exception { imp.deleteOrder(orderId); - return ok(); - } @ApiAction @@ -44,8 +43,6 @@ public Result getInventory() throws Exception { Map obj = imp.getInventory(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -53,8 +50,6 @@ public Result getOrderById(Long orderId) throws Exception { Order obj = imp.getOrderById(orderId); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -67,7 +62,5 @@ public Result placeOrder() throws Exception { Order obj = imp.placeOrder(body); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } } diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiController.java index 8e36b4f12ea..0005ef24311 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiController.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; +import java.io.File; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; @@ -39,9 +40,7 @@ public Result createUser() throws Exception { body = mapper.readValue(nodebody.toString(), User.class); imp.createUser(body); - return ok(); - } @ApiAction @@ -52,9 +51,7 @@ public Result createUsersWithArrayInput() throws Exception { body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); imp.createUsersWithArrayInput(body); - return ok(); - } @ApiAction @@ -65,17 +62,13 @@ public Result createUsersWithListInput() throws Exception { body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); imp.createUsersWithListInput(body); - return ok(); - } @ApiAction public Result deleteUser(String username) throws Exception { imp.deleteUser(username); - return ok(); - } @ApiAction @@ -83,8 +76,6 @@ public Result getUserByName(String username) throws Exception { User obj = imp.getUserByName(username); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -102,16 +93,12 @@ public Result loginUser() throws Exception { String obj = imp.loginUser(username, password); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction public Result logoutUser() throws Exception { imp.logoutUser(); - return ok(); - } @ApiAction @@ -122,8 +109,6 @@ public Result updateUser(String username) throws Exception { body = mapper.readValue(nodebody.toString(), User.class); imp.updateUser(username, body); - return ok(); - } } diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiController.java index 80485be9755..ceec97042b1 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiController.java @@ -13,6 +13,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; +import java.io.File; import java.io.IOException; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; @@ -43,9 +44,7 @@ public Result addPet() throws IOException { body.validate(); imp.addPet(body); - return ok(); - } @ApiAction @@ -59,9 +58,7 @@ public Result deletePet(Long petId) { apiKey = null; } imp.deletePet(petId, apiKey); - return ok(); - } @ApiAction @@ -78,8 +75,6 @@ public Result findPetsByStatus() { } JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -96,8 +91,6 @@ public Result findPetsByTags() { } JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -106,8 +99,6 @@ public Result getPetById(Long petId) { obj.validate(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -119,9 +110,7 @@ public Result updatePet() throws IOException { body.validate(); imp.updatePet(body); - return ok(); - } @ApiAction @@ -143,9 +132,7 @@ public Result updatePetWithForm(Long petId) { status = null; } imp.updatePetWithForm(petId, name, status); - return ok(); - } @ApiAction @@ -159,11 +146,9 @@ public Result uploadFile(Long petId) { additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); - ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); + ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); obj.validate(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } } diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiController.java index a1511878884..ab19ac3ae26 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiController.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; +import java.io.File; import java.io.IOException; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; @@ -36,9 +37,7 @@ private StoreApiController(StoreApiControllerImpInterface imp) { @ApiAction public Result deleteOrder(String orderId) { imp.deleteOrder(orderId); - return ok(); - } @ApiAction @@ -46,8 +45,6 @@ public Result getInventory() { Map obj = imp.getInventory(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -56,8 +53,6 @@ public Result getOrderById( @Min(1) @Max(5)Long orderId) { obj.validate(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -72,7 +67,5 @@ public Result placeOrder() throws IOException { obj.validate(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } } diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiController.java index fbf8c995d65..d09687a9a30 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiController.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; +import java.io.File; import java.io.IOException; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; @@ -42,9 +43,7 @@ public Result createUser() throws IOException { body.validate(); imp.createUser(body); - return ok(); - } @ApiAction @@ -58,9 +57,7 @@ public Result createUsersWithArrayInput() throws IOException { } imp.createUsersWithArrayInput(body); - return ok(); - } @ApiAction @@ -74,17 +71,13 @@ public Result createUsersWithListInput() throws IOException { } imp.createUsersWithListInput(body); - return ok(); - } @ApiAction public Result deleteUser(String username) { imp.deleteUser(username); - return ok(); - } @ApiAction @@ -93,8 +86,6 @@ public Result getUserByName(String username) { obj.validate(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -112,16 +103,12 @@ public Result loginUser() { String obj = imp.loginUser(username, password); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction public Result logoutUser() { imp.logoutUser(); - return ok(); - } @ApiAction @@ -133,8 +120,6 @@ public Result updateUser(String username) throws IOException { body.validate(); imp.updateUser(username, body); - return ok(); - } } diff --git a/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiController.java index 59f1e9bee43..0701f3ba336 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiController.java @@ -13,6 +13,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; +import java.io.File; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; @@ -42,9 +43,7 @@ public Result addPet() throws Exception { body.validate(); imp.addPet(body); - return ok(); - } @ApiAction @@ -58,9 +57,7 @@ public Result deletePet(Long petId) throws Exception { apiKey = null; } imp.deletePet(petId, apiKey); - return ok(); - } @ApiAction @@ -77,8 +74,6 @@ public Result findPetsByStatus() throws Exception { } JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -95,8 +90,6 @@ public Result findPetsByTags() throws Exception { } JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -105,8 +98,6 @@ public Result getPetById(Long petId) throws Exception { obj.validate(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -118,9 +109,7 @@ public Result updatePet() throws Exception { body.validate(); imp.updatePet(body); - return ok(); - } @ApiAction @@ -142,9 +131,7 @@ public Result updatePetWithForm(Long petId) throws Exception { status = null; } imp.updatePetWithForm(petId, name, status); - return ok(); - } @ApiAction @@ -158,11 +145,9 @@ public Result uploadFile(Long petId) throws Exception { additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); - ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); + ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); obj.validate(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } } diff --git a/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiController.java index 460c154131a..b6801a3ef1f 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiController.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; +import java.io.File; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; @@ -35,9 +36,7 @@ private StoreApiController(StoreApiControllerImp imp) { @ApiAction public Result deleteOrder(String orderId) throws Exception { imp.deleteOrder(orderId); - return ok(); - } @ApiAction @@ -45,8 +44,6 @@ public Result getInventory() throws Exception { Map obj = imp.getInventory(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -55,8 +52,6 @@ public Result getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { obj.validate(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -71,7 +66,5 @@ public Result placeOrder() throws Exception { obj.validate(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } } diff --git a/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiController.java index 967fef9a849..a62e1fb9c02 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiController.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; +import java.io.File; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; @@ -41,9 +42,7 @@ public Result createUser() throws Exception { body.validate(); imp.createUser(body); - return ok(); - } @ApiAction @@ -57,9 +56,7 @@ public Result createUsersWithArrayInput() throws Exception { } imp.createUsersWithArrayInput(body); - return ok(); - } @ApiAction @@ -73,17 +70,13 @@ public Result createUsersWithListInput() throws Exception { } imp.createUsersWithListInput(body); - return ok(); - } @ApiAction public Result deleteUser(String username) throws Exception { imp.deleteUser(username); - return ok(); - } @ApiAction @@ -92,8 +85,6 @@ public Result getUserByName(String username) throws Exception { obj.validate(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -111,16 +102,12 @@ public Result loginUser() throws Exception { String obj = imp.loginUser(username, password); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction public Result logoutUser() throws Exception { imp.logoutUser(); - return ok(); - } @ApiAction @@ -132,8 +119,6 @@ public Result updateUser(String username) throws Exception { body.validate(); imp.updateUser(username, body); - return ok(); - } } diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiController.java index 03b79d7f2e7..6ea11161da1 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiController.java @@ -13,6 +13,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; +import java.io.File; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; @@ -42,9 +43,7 @@ public Result addPet() throws Exception { body.validate(); imp.addPet(body); - return ok(); - } @ApiAction @@ -58,9 +57,7 @@ public Result deletePet(Long petId) throws Exception { apiKey = null; } imp.deletePet(petId, apiKey); - return ok(); - } @ApiAction @@ -77,8 +74,6 @@ public Result findPetsByStatus() throws Exception { } JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -95,8 +90,6 @@ public Result findPetsByTags() throws Exception { } JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -105,8 +98,6 @@ public Result getPetById(Long petId) throws Exception { obj.validate(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -118,9 +109,7 @@ public Result updatePet() throws Exception { body.validate(); imp.updatePet(body); - return ok(); - } @ApiAction @@ -142,9 +131,7 @@ public Result updatePetWithForm(Long petId) throws Exception { status = null; } imp.updatePetWithForm(petId, name, status); - return ok(); - } @ApiAction @@ -158,11 +145,9 @@ public Result uploadFile(Long petId) throws Exception { additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); - ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); + ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); obj.validate(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } } diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiController.java index 5d5ae986166..92fafa4b746 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiController.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; +import java.io.File; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; @@ -35,9 +36,7 @@ private StoreApiController(StoreApiControllerImpInterface imp) { @ApiAction public Result deleteOrder(String orderId) throws Exception { imp.deleteOrder(orderId); - return ok(); - } @ApiAction @@ -45,8 +44,6 @@ public Result getInventory() throws Exception { Map obj = imp.getInventory(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -55,8 +52,6 @@ public Result getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { obj.validate(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -71,7 +66,5 @@ public Result placeOrder() throws Exception { obj.validate(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } } diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiController.java index 9229d39a363..c084e050fa2 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiController.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; +import java.io.File; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; @@ -41,9 +42,7 @@ public Result createUser() throws Exception { body.validate(); imp.createUser(body); - return ok(); - } @ApiAction @@ -57,9 +56,7 @@ public Result createUsersWithArrayInput() throws Exception { } imp.createUsersWithArrayInput(body); - return ok(); - } @ApiAction @@ -73,17 +70,13 @@ public Result createUsersWithListInput() throws Exception { } imp.createUsersWithListInput(body); - return ok(); - } @ApiAction public Result deleteUser(String username) throws Exception { imp.deleteUser(username); - return ok(); - } @ApiAction @@ -92,8 +85,6 @@ public Result getUserByName(String username) throws Exception { obj.validate(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -111,16 +102,12 @@ public Result loginUser() throws Exception { String obj = imp.loginUser(username, password); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction public Result logoutUser() throws Exception { imp.logoutUser(); - return ok(); - } @ApiAction @@ -132,8 +119,6 @@ public Result updateUser(String username) throws Exception { body.validate(); imp.updateUser(username, body); - return ok(); - } } diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiController.java index b316e777763..c00d5993360 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiController.java @@ -13,6 +13,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; +import java.io.File; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; @@ -41,9 +42,7 @@ public Result addPet() throws Exception { body.validate(); imp.addPet(body); - return ok(); - } @@ -57,9 +56,7 @@ public Result deletePet(Long petId) throws Exception { apiKey = null; } imp.deletePet(petId, apiKey); - return ok(); - } @@ -76,8 +73,6 @@ public Result findPetsByStatus() throws Exception { } JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @@ -94,8 +89,6 @@ public Result findPetsByTags() throws Exception { } JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @@ -104,8 +97,6 @@ public Result getPetById(Long petId) throws Exception { obj.validate(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @@ -117,9 +108,7 @@ public Result updatePet() throws Exception { body.validate(); imp.updatePet(body); - return ok(); - } @@ -141,9 +130,7 @@ public Result updatePetWithForm(Long petId) throws Exception { status = null; } imp.updatePetWithForm(petId, name, status); - return ok(); - } @@ -157,11 +144,9 @@ public Result uploadFile(Long petId) throws Exception { additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); - ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); + ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); obj.validate(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } } diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiController.java index 01577c842c6..2f5b5b5b627 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiController.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; +import java.io.File; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; @@ -34,9 +35,7 @@ private StoreApiController(StoreApiControllerImpInterface imp) { public Result deleteOrder(String orderId) throws Exception { imp.deleteOrder(orderId); - return ok(); - } @@ -44,8 +43,6 @@ public Result getInventory() throws Exception { Map obj = imp.getInventory(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @@ -54,8 +51,6 @@ public Result getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { obj.validate(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @@ -70,7 +65,5 @@ public Result placeOrder() throws Exception { obj.validate(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } } diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiController.java index 9db7f763094..e95378850b6 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiController.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; +import java.io.File; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; @@ -40,9 +41,7 @@ public Result createUser() throws Exception { body.validate(); imp.createUser(body); - return ok(); - } @@ -56,9 +55,7 @@ public Result createUsersWithArrayInput() throws Exception { } imp.createUsersWithArrayInput(body); - return ok(); - } @@ -72,17 +69,13 @@ public Result createUsersWithListInput() throws Exception { } imp.createUsersWithListInput(body); - return ok(); - } public Result deleteUser(String username) throws Exception { imp.deleteUser(username); - return ok(); - } @@ -91,8 +84,6 @@ public Result getUserByName(String username) throws Exception { obj.validate(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @@ -110,16 +101,12 @@ public Result loginUser() throws Exception { String obj = imp.loginUser(username, password); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } public Result logoutUser() throws Exception { imp.logoutUser(); - return ok(); - } @@ -131,8 +118,6 @@ public Result updateUser(String username) throws Exception { body.validate(); imp.updateUser(username, body); - return ok(); - } } diff --git a/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java index 03b79d7f2e7..6ea11161da1 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java @@ -13,6 +13,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; +import java.io.File; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; @@ -42,9 +43,7 @@ public Result addPet() throws Exception { body.validate(); imp.addPet(body); - return ok(); - } @ApiAction @@ -58,9 +57,7 @@ public Result deletePet(Long petId) throws Exception { apiKey = null; } imp.deletePet(petId, apiKey); - return ok(); - } @ApiAction @@ -77,8 +74,6 @@ public Result findPetsByStatus() throws Exception { } JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -95,8 +90,6 @@ public Result findPetsByTags() throws Exception { } JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -105,8 +98,6 @@ public Result getPetById(Long petId) throws Exception { obj.validate(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -118,9 +109,7 @@ public Result updatePet() throws Exception { body.validate(); imp.updatePet(body); - return ok(); - } @ApiAction @@ -142,9 +131,7 @@ public Result updatePetWithForm(Long petId) throws Exception { status = null; } imp.updatePetWithForm(petId, name, status); - return ok(); - } @ApiAction @@ -158,11 +145,9 @@ public Result uploadFile(Long petId) throws Exception { additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); - ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); + ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); obj.validate(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } } diff --git a/samples/server/petstore/java-play-framework/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework/app/controllers/StoreApiController.java index 5d5ae986166..92fafa4b746 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework/app/controllers/StoreApiController.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; +import java.io.File; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; @@ -35,9 +36,7 @@ private StoreApiController(StoreApiControllerImpInterface imp) { @ApiAction public Result deleteOrder(String orderId) throws Exception { imp.deleteOrder(orderId); - return ok(); - } @ApiAction @@ -45,8 +44,6 @@ public Result getInventory() throws Exception { Map obj = imp.getInventory(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -55,8 +52,6 @@ public Result getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { obj.validate(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -71,7 +66,5 @@ public Result placeOrder() throws Exception { obj.validate(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } } diff --git a/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java index 9229d39a363..c084e050fa2 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; +import java.io.File; import swagger.SwaggerUtils; import com.fasterxml.jackson.core.type.TypeReference; @@ -41,9 +42,7 @@ public Result createUser() throws Exception { body.validate(); imp.createUser(body); - return ok(); - } @ApiAction @@ -57,9 +56,7 @@ public Result createUsersWithArrayInput() throws Exception { } imp.createUsersWithArrayInput(body); - return ok(); - } @ApiAction @@ -73,17 +70,13 @@ public Result createUsersWithListInput() throws Exception { } imp.createUsersWithListInput(body); - return ok(); - } @ApiAction public Result deleteUser(String username) throws Exception { imp.deleteUser(username); - return ok(); - } @ApiAction @@ -92,8 +85,6 @@ public Result getUserByName(String username) throws Exception { obj.validate(); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction @@ -111,16 +102,12 @@ public Result loginUser() throws Exception { String obj = imp.loginUser(username, password); JsonNode result = mapper.valueToTree(obj); return ok(result); - - } @ApiAction public Result logoutUser() throws Exception { imp.logoutUser(); - return ok(); - } @ApiAction @@ -132,8 +119,6 @@ public Result updateUser(String username) throws Exception { body.validate(); imp.updateUser(username, body); - return ok(); - } }