update resteasy dependencies (#9729)

This commit is contained in:
William Cheng 2021-06-09 15:43:55 +08:00 committed by GitHub
parent 0e93e79cd6
commit cce0d0a222
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 77 additions and 176 deletions

View File

@ -539,12 +539,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
importMapping.put("com.fasterxml.jackson.annotation.JsonProperty", "com.fasterxml.jackson.annotation.JsonCreator");
if (additionalProperties.containsKey(JAVA8_MODE)) {
setJava8Mode(Boolean.parseBoolean(additionalProperties.get(JAVA8_MODE).toString()));
if (java8Mode) {
additionalProperties.put("java8", true);
} else {
additionalProperties.put("java8", false);
}
setJava8ModeAndAdditionalProperties(Boolean.parseBoolean(additionalProperties.get(JAVA8_MODE).toString()));
}
if (additionalProperties.containsKey(SUPPORT_ASYNC)) {
@ -1692,6 +1687,15 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
this.java8Mode = enabled;
}
public void setJava8ModeAndAdditionalProperties(boolean enabled) {
this.java8Mode = enabled;
if (this.java8Mode) {
this.additionalProperties.put("java8", true);
} else {
this.additionalProperties.put("java8", false);
}
}
public void setSupportAsync(boolean enabled) {
this.supportAsync = enabled;
}

View File

@ -436,13 +436,13 @@ public class JavaClientCodegen extends AbstractJavaCodegen
supportsAdditionalPropertiesWithComposedSchema = true;
} else if (NATIVE.equals(getLibrary())) {
setJava8Mode(true);
additionalProperties.put("java8", "true");
setJava8ModeAndAdditionalProperties(true);
supportingFiles.add(new SupportingFile("ApiResponse.mustache", invokerFolder, "ApiResponse.java"));
supportingFiles.add(new SupportingFile("JSON.mustache", invokerFolder, "JSON.java"));
supportingFiles.add(new SupportingFile("AbstractOpenApiSchema.mustache", (sourceFolder + File.separator + modelPackage().replace('.', File.separatorChar)).replace('/', File.separatorChar), "AbstractOpenApiSchema.java"));
forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON);
} else if (RESTEASY.equals(getLibrary())) {
setJava8ModeAndAdditionalProperties(true);
supportingFiles.add(new SupportingFile("JSON.mustache", invokerFolder, "JSON.java"));
forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON);
} else if (JERSEY1.equals(getLibrary())) {
@ -451,14 +451,12 @@ public class JavaClientCodegen extends AbstractJavaCodegen
forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON);
supportingFiles.add(new SupportingFile("auth/Authentication.mustache", authFolder, "Authentication.java"));
} else if (WEBCLIENT.equals(getLibrary())) {
setJava8Mode(true);
additionalProperties.put("java8", "true");
setJava8ModeAndAdditionalProperties(true);
forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON);
} else if (VERTX.equals(getLibrary())) {
typeMapping.put("file", "AsyncFile");
importMapping.put("AsyncFile", "io.vertx.core.file.AsyncFile");
setJava8Mode(true);
additionalProperties.put("java8", "true");
setJava8ModeAndAdditionalProperties(true);
forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON);
apiTemplateFiles.put("apiImpl.mustache", "Impl.java");
apiTemplateFiles.put("rxApiImpl.mustache", ".java");
@ -531,7 +529,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
supportingFiles.add(new SupportingFile("play25/Play25CallFactory.mustache", invokerFolder, "Play25CallFactory.java"));
supportingFiles.add(new SupportingFile("play25/Play25CallAdapterFactory.mustache", invokerFolder,
"Play25CallAdapterFactory.java"));
additionalProperties.put("java8", "true");
setJava8ModeAndAdditionalProperties(true);
}
if (PLAY_26.equals(playVersion)) {
@ -542,7 +540,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
supportingFiles.add(new SupportingFile("play26/Play26CallFactory.mustache", invokerFolder, "Play26CallFactory.java"));
supportingFiles.add(new SupportingFile("play26/Play26CallAdapterFactory.mustache", invokerFolder,
"Play26CallAdapterFactory.java"));
additionalProperties.put("java8", "true");
setJava8ModeAndAdditionalProperties(true);
}
supportingFiles.add(new SupportingFile("play-common/auth/ApiKeyAuth.mustache", authFolder, "ApiKeyAuth.java"));

View File

@ -5,12 +5,7 @@ import com.fasterxml.jackson.databind.*;
{{#openApiNullable}}
import org.openapitools.jackson.nullable.JsonNullableModule;
{{/openApiNullable}}
{{#java8}}
import com.fasterxml.jackson.datatype.jsr310.*;
{{/java8}}
{{^java8}}
import com.fasterxml.jackson.datatype.joda.*;
{{/java8}}
import java.text.DateFormat;
@ -33,12 +28,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
JsonNullableModule jnm = new JsonNullableModule();
mapper.registerModule(jnm);
{{/openApiNullable}}
{{#java8}}
mapper.registerModule(new JavaTimeModule());
{{/java8}}
{{^java8}}
mapper.registerModule(new JodaModule());
{{/java8}}
}
/**

View File

@ -33,14 +33,8 @@ if(hasProperty('target') && target == 'android') {
targetSdkVersion 23
}
compileOptions {
{{#java8}}
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
{{/java8}}
{{^java8}}
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
{{/java8}}
}
// Rename the aar correctly
@ -84,14 +78,8 @@ if(hasProperty('target') && target == 'android') {
apply plugin: 'java'
apply plugin: 'maven'
{{#java8}}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
{{/java8}}
{{^java8}}
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
{{/java8}}
install {
repositories.mavenInstaller {
@ -113,10 +101,7 @@ ext {
jackson_databind_nullable_version = "0.2.1"
{{/openApiNullable}}
threetenbp_version = "2.9.10"
resteasy_version = "3.1.3.Final"
{{^java8}}
jodatime_version = "2.9.9"
{{/java8}}
resteasy_version = "4.5.11.Final"
junit_version = "4.13"
}
@ -133,14 +118,7 @@ dependencies {
{{#openApiNullable}}
implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version"
{{/openApiNullable}}
{{#java8}}
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
{{/java8}}
{{^java8}}
implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version"
implementation "joda-time:joda-time:$jodatime_version"
implementation "com.brsanthu:migbase64:2.2"
{{/java8}}
implementation 'javax.annotation:javax.annotation-api:1.3.2'
testImplementation "junit:junit:$junit_version"
}

View File

@ -11,20 +11,13 @@ lazy val root = (project in file(".")).
libraryDependencies ++= Seq(
"io.swagger" % "swagger-annotations" % "1.5.22" % "compile",
"org.jboss.resteasy" % "resteasy-client" % "3.1.3.Final" % "compile",
"org.jboss.resteasy" % "resteasy-multipart-provider" % "3.1.3.Final" % "compile",
"org.jboss.resteasy" % "resteasy-jackson2-provider" % "3.1.3.Final" % "compile",
"org.jboss.resteasy" % "resteasy-multipart-provider" % "4.5.11.Final" % "compile",
"org.jboss.resteasy" % "resteasy-jackson2-provider" % "4.5.11.Final" % "compile",
"com.fasterxml.jackson.core" % "jackson-core" % "2.10.5" % "compile",
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.5" % "compile",
"com.fasterxml.jackson.core" % "jackson-databind" % "2.10.5.1" % "compile",
"com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile",
{{#java8}}
"com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile",
{{/java8}}
{{^java8}}
"com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.9.10" % "compile",
"joda-time" % "joda-time" % "2.9.9" % "compile",
"com.brsanthu" % "migbase64" % "2.2" % "compile",
{{/java8}}
"javax.annotation" % "javax.annotation-api" % "1.3.2" % "compile",
"junit" % "junit" % "4.13" % "test",
"com.novocode" % "junit-interface" % "0.10" % "test"

View File

@ -142,14 +142,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
{{#java8}}
<source>1.8</source>
<target>1.8</target>
{{/java8}}
{{^java8}}
<source>1.7</source>
<target>1.7</target>
{{/java8}}
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
@ -158,12 +152,7 @@
<version>3.1.1</version>
<configuration>
<doclint>none</doclint>
{{#java8}}
<source>1.8</source>
{{/java8}}
{{^java8}}
<source>1.7</source>
{{/java8}}
<source>1.8</source>
</configuration>
<executions>
<execution>
@ -232,30 +221,10 @@
</dependency>
{{/withXml}}
{{^java8}}
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>${jodatime-version}</version>
</dependency>
<!-- Base64 encoding that works in both JVM and Android -->
<dependency>
<groupId>com.brsanthu</groupId>
<artifactId>migbase64</artifactId>
<version>2.2</version>
</dependency>
{{/java8}}
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jackson2-provider</artifactId>
<version>3.1.3.Final</version>
<version>${resteasy-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
@ -284,15 +253,12 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<swagger-annotations-version>1.5.22</swagger-annotations-version>
<resteasy-version>3.1.3.Final</resteasy-version>
<resteasy-version>4.5.11.Final</resteasy-version>
<jackson-version>2.10.5</jackson-version>
<jackson-databind-version>2.10.5.1</jackson-databind-version>
<jackson-databind-nullable-version>0.2.1</jackson-databind-nullable-version>
<javax-annotation-version>1.3.2</javax-annotation-version>
<threetenbp-version>2.9.10</threetenbp-version>
{{^java8}}
<jodatime-version>2.9.9</jodatime-version>
{{/java8}}
<maven-plugin-version>1.0.0</maven-plugin-version>
<junit-version>4.13</junit-version>
</properties>

View File

@ -13,7 +13,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, mod
Building the API client library requires:
1. Java 1.7+
1. Java 1.8+
2. Maven/Gradle
## Installation

View File

@ -33,8 +33,8 @@ if(hasProperty('target') && target == 'android') {
targetSdkVersion 23
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// Rename the aar correctly
@ -78,8 +78,8 @@ if(hasProperty('target') && target == 'android') {
apply plugin: 'java'
apply plugin: 'maven'
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
install {
repositories.mavenInstaller {
@ -99,8 +99,7 @@ ext {
jackson_databind_version = "2.10.5.1"
jackson_databind_nullable_version = "0.2.1"
threetenbp_version = "2.9.10"
resteasy_version = "3.1.3.Final"
jodatime_version = "2.9.9"
resteasy_version = "4.5.11.Final"
junit_version = "4.13"
}
@ -115,9 +114,7 @@ dependencies {
implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version"
implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$threetenbp_version"
implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version"
implementation "joda-time:joda-time:$jodatime_version"
implementation "com.brsanthu:migbase64:2.2"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
implementation 'javax.annotation:javax.annotation-api:1.3.2'
testImplementation "junit:junit:$junit_version"
}

View File

@ -11,15 +11,13 @@ lazy val root = (project in file(".")).
libraryDependencies ++= Seq(
"io.swagger" % "swagger-annotations" % "1.5.22" % "compile",
"org.jboss.resteasy" % "resteasy-client" % "3.1.3.Final" % "compile",
"org.jboss.resteasy" % "resteasy-multipart-provider" % "3.1.3.Final" % "compile",
"org.jboss.resteasy" % "resteasy-jackson2-provider" % "3.1.3.Final" % "compile",
"org.jboss.resteasy" % "resteasy-multipart-provider" % "4.5.11.Final" % "compile",
"org.jboss.resteasy" % "resteasy-jackson2-provider" % "4.5.11.Final" % "compile",
"com.fasterxml.jackson.core" % "jackson-core" % "2.10.5" % "compile",
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.5" % "compile",
"com.fasterxml.jackson.core" % "jackson-databind" % "2.10.5.1" % "compile",
"com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile",
"com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.9.10" % "compile",
"joda-time" % "joda-time" % "2.9.9" % "compile",
"com.brsanthu" % "migbase64" % "2.2" % "compile",
"com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile",
"javax.annotation" % "javax.annotation-api" % "1.3.2" % "compile",
"junit" % "junit" % "4.13" % "test",
"com.novocode" % "junit-interface" % "0.10" % "test"

View File

@ -135,8 +135,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
@ -145,7 +145,7 @@
<version>3.1.1</version>
<configuration>
<doclint>none</doclint>
<source>1.7</source>
<source>1.8</source>
</configuration>
<executions>
<execution>
@ -202,28 +202,10 @@
<artifactId>jackson-databind-nullable</artifactId>
<version>${jackson-databind-nullable-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>${jodatime-version}</version>
</dependency>
<!-- Base64 encoding that works in both JVM and Android -->
<dependency>
<groupId>com.brsanthu</groupId>
<artifactId>migbase64</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jackson2-provider</artifactId>
<version>3.1.3.Final</version>
<version>${resteasy-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
@ -252,13 +234,12 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<swagger-annotations-version>1.5.22</swagger-annotations-version>
<resteasy-version>3.1.3.Final</resteasy-version>
<resteasy-version>4.5.11.Final</resteasy-version>
<jackson-version>2.10.5</jackson-version>
<jackson-databind-version>2.10.5.1</jackson-databind-version>
<jackson-databind-nullable-version>0.2.1</jackson-databind-nullable-version>
<javax-annotation-version>1.3.2</javax-annotation-version>
<threetenbp-version>2.9.10</threetenbp-version>
<jodatime-version>2.9.9</jodatime-version>
<maven-plugin-version>1.0.0</maven-plugin-version>
<junit-version>4.13</junit-version>
</properties>

View File

@ -3,7 +3,7 @@ package org.openapitools.client;
import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.*;
import org.openapitools.jackson.nullable.JsonNullableModule;
import com.fasterxml.jackson.datatype.joda.*;
import com.fasterxml.jackson.datatype.jsr310.*;
import java.text.DateFormat;
@ -24,7 +24,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
mapper.setDateFormat(new RFC3339DateFormat());
JsonNullableModule jnm = new JsonNullableModule();
mapper.registerModule(jnm);
mapper.registerModule(new JodaModule());
mapper.registerModule(new JavaTimeModule());
}
/**

View File

@ -15,12 +15,12 @@ package org.openapitools.client.auth;
import org.openapitools.client.Pair;
import com.migcomponents.migbase64.Base64;
import java.util.Base64;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import java.util.List;
import java.io.UnsupportedEncodingException;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class HttpBasicAuth implements Authentication {
@ -49,10 +49,6 @@ public class HttpBasicAuth implements Authentication {
return;
}
String str = (username == null ? "" : username) + ":" + (password == null ? "" : password);
try {
headerParams.put("Authorization", "Basic " + Base64.encodeToString(str.getBytes("UTF-8"), false));
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
headerParams.put("Authorization", "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8)));
}
}

View File

@ -89,7 +89,7 @@ public class AdditionalPropertiesClass {
public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) {
if (this.mapString == null) {
this.mapString = new HashMap<String, String>();
this.mapString = new HashMap<>();
}
this.mapString.put(key, mapStringItem);
return this;
@ -124,7 +124,7 @@ public class AdditionalPropertiesClass {
public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) {
if (this.mapNumber == null) {
this.mapNumber = new HashMap<String, BigDecimal>();
this.mapNumber = new HashMap<>();
}
this.mapNumber.put(key, mapNumberItem);
return this;
@ -159,7 +159,7 @@ public class AdditionalPropertiesClass {
public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) {
if (this.mapInteger == null) {
this.mapInteger = new HashMap<String, Integer>();
this.mapInteger = new HashMap<>();
}
this.mapInteger.put(key, mapIntegerItem);
return this;
@ -194,7 +194,7 @@ public class AdditionalPropertiesClass {
public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) {
if (this.mapBoolean == null) {
this.mapBoolean = new HashMap<String, Boolean>();
this.mapBoolean = new HashMap<>();
}
this.mapBoolean.put(key, mapBooleanItem);
return this;
@ -229,7 +229,7 @@ public class AdditionalPropertiesClass {
public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List<Integer> mapArrayIntegerItem) {
if (this.mapArrayInteger == null) {
this.mapArrayInteger = new HashMap<String, List<Integer>>();
this.mapArrayInteger = new HashMap<>();
}
this.mapArrayInteger.put(key, mapArrayIntegerItem);
return this;
@ -264,7 +264,7 @@ public class AdditionalPropertiesClass {
public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List<Object> mapArrayAnytypeItem) {
if (this.mapArrayAnytype == null) {
this.mapArrayAnytype = new HashMap<String, List<Object>>();
this.mapArrayAnytype = new HashMap<>();
}
this.mapArrayAnytype.put(key, mapArrayAnytypeItem);
return this;
@ -299,7 +299,7 @@ public class AdditionalPropertiesClass {
public AdditionalPropertiesClass putMapMapStringItem(String key, Map<String, String> mapMapStringItem) {
if (this.mapMapString == null) {
this.mapMapString = new HashMap<String, Map<String, String>>();
this.mapMapString = new HashMap<>();
}
this.mapMapString.put(key, mapMapStringItem);
return this;
@ -334,7 +334,7 @@ public class AdditionalPropertiesClass {
public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map<String, Object> mapMapAnytypeItem) {
if (this.mapMapAnytype == null) {
this.mapMapAnytype = new HashMap<String, Map<String, Object>>();
this.mapMapAnytype = new HashMap<>();
}
this.mapMapAnytype.put(key, mapMapAnytypeItem);
return this;

View File

@ -48,7 +48,7 @@ public class ArrayOfArrayOfNumberOnly {
public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List<BigDecimal> arrayArrayNumberItem) {
if (this.arrayArrayNumber == null) {
this.arrayArrayNumber = new ArrayList<List<BigDecimal>>();
this.arrayArrayNumber = new ArrayList<>();
}
this.arrayArrayNumber.add(arrayArrayNumberItem);
return this;

View File

@ -48,7 +48,7 @@ public class ArrayOfNumberOnly {
public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) {
if (this.arrayNumber == null) {
this.arrayNumber = new ArrayList<BigDecimal>();
this.arrayNumber = new ArrayList<>();
}
this.arrayNumber.add(arrayNumberItem);
return this;

View File

@ -56,7 +56,7 @@ public class ArrayTest {
public ArrayTest addArrayOfStringItem(String arrayOfStringItem) {
if (this.arrayOfString == null) {
this.arrayOfString = new ArrayList<String>();
this.arrayOfString = new ArrayList<>();
}
this.arrayOfString.add(arrayOfStringItem);
return this;
@ -91,7 +91,7 @@ public class ArrayTest {
public ArrayTest addArrayArrayOfIntegerItem(List<Long> arrayArrayOfIntegerItem) {
if (this.arrayArrayOfInteger == null) {
this.arrayArrayOfInteger = new ArrayList<List<Long>>();
this.arrayArrayOfInteger = new ArrayList<>();
}
this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem);
return this;
@ -126,7 +126,7 @@ public class ArrayTest {
public ArrayTest addArrayArrayOfModelItem(List<ReadOnlyFirst> arrayArrayOfModelItem) {
if (this.arrayArrayOfModel == null) {
this.arrayArrayOfModel = new ArrayList<List<ReadOnlyFirst>>();
this.arrayArrayOfModel = new ArrayList<>();
}
this.arrayArrayOfModel.add(arrayArrayOfModelItem);
return this;

View File

@ -148,7 +148,7 @@ public class EnumArrays {
public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) {
if (this.arrayEnum == null) {
this.arrayEnum = new ArrayList<ArrayEnumEnum>();
this.arrayEnum = new ArrayList<>();
}
this.arrayEnum.add(arrayEnumItem);
return this;

View File

@ -78,7 +78,7 @@ public class FileSchemaTestClass {
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
if (this.files == null) {
this.files = new ArrayList<java.io.File>();
this.files = new ArrayList<>();
}
this.files.add(filesItem);
return this;

View File

@ -95,7 +95,7 @@ public class MapTest {
public MapTest putMapMapOfStringItem(String key, Map<String, String> mapMapOfStringItem) {
if (this.mapMapOfString == null) {
this.mapMapOfString = new HashMap<String, Map<String, String>>();
this.mapMapOfString = new HashMap<>();
}
this.mapMapOfString.put(key, mapMapOfStringItem);
return this;
@ -130,7 +130,7 @@ public class MapTest {
public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) {
if (this.mapOfEnumString == null) {
this.mapOfEnumString = new HashMap<String, InnerEnum>();
this.mapOfEnumString = new HashMap<>();
}
this.mapOfEnumString.put(key, mapOfEnumStringItem);
return this;
@ -165,7 +165,7 @@ public class MapTest {
public MapTest putDirectMapItem(String key, Boolean directMapItem) {
if (this.directMap == null) {
this.directMap = new HashMap<String, Boolean>();
this.directMap = new HashMap<>();
}
this.directMap.put(key, directMapItem);
return this;
@ -200,7 +200,7 @@ public class MapTest {
public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) {
if (this.indirectMap == null) {
this.indirectMap = new HashMap<String, Boolean>();
this.indirectMap = new HashMap<>();
}
this.indirectMap.put(key, indirectMapItem);
return this;

View File

@ -113,7 +113,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) {
if (this.map == null) {
this.map = new HashMap<String, Animal>();
this.map = new HashMap<>();
}
this.map.put(key, mapItem);
return this;

View File

@ -54,7 +54,7 @@ public class Pet {
private String name;
public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls";
private Set<String> photoUrls = new LinkedHashSet<String>();
private Set<String> photoUrls = new LinkedHashSet<>();
public static final String JSON_PROPERTY_TAGS = "tags";
private List<Tag> tags = null;
@ -219,7 +219,7 @@ public class Pet {
public Pet addTagsItem(Tag tagsItem) {
if (this.tags == null) {
this.tags = new ArrayList<Tag>();
this.tags = new ArrayList<>();
}
this.tags.add(tagsItem);
return this;

View File

@ -53,7 +53,7 @@ public class TypeHolderDefault {
private Boolean boolItem = true;
public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item";
private List<Integer> arrayItem = new ArrayList<Integer>();
private List<Integer> arrayItem = new ArrayList<>();
public TypeHolderDefault stringItem(String stringItem) {

View File

@ -57,7 +57,7 @@ public class TypeHolderExample {
private Boolean boolItem;
public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item";
private List<Integer> arrayItem = new ArrayList<Integer>();
private List<Integer> arrayItem = new ArrayList<>();
public TypeHolderExample stringItem(String stringItem) {

View File

@ -268,7 +268,7 @@ public class XmlItem {
public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) {
if (this.wrappedArray == null) {
this.wrappedArray = new ArrayList<Integer>();
this.wrappedArray = new ArrayList<>();
}
this.wrappedArray.add(wrappedArrayItem);
return this;
@ -411,7 +411,7 @@ public class XmlItem {
public XmlItem addNameArrayItem(Integer nameArrayItem) {
if (this.nameArray == null) {
this.nameArray = new ArrayList<Integer>();
this.nameArray = new ArrayList<>();
}
this.nameArray.add(nameArrayItem);
return this;
@ -446,7 +446,7 @@ public class XmlItem {
public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) {
if (this.nameWrappedArray == null) {
this.nameWrappedArray = new ArrayList<Integer>();
this.nameWrappedArray = new ArrayList<>();
}
this.nameWrappedArray.add(nameWrappedArrayItem);
return this;
@ -589,7 +589,7 @@ public class XmlItem {
public XmlItem addPrefixArrayItem(Integer prefixArrayItem) {
if (this.prefixArray == null) {
this.prefixArray = new ArrayList<Integer>();
this.prefixArray = new ArrayList<>();
}
this.prefixArray.add(prefixArrayItem);
return this;
@ -624,7 +624,7 @@ public class XmlItem {
public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) {
if (this.prefixWrappedArray == null) {
this.prefixWrappedArray = new ArrayList<Integer>();
this.prefixWrappedArray = new ArrayList<>();
}
this.prefixWrappedArray.add(prefixWrappedArrayItem);
return this;
@ -767,7 +767,7 @@ public class XmlItem {
public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) {
if (this.namespaceArray == null) {
this.namespaceArray = new ArrayList<Integer>();
this.namespaceArray = new ArrayList<>();
}
this.namespaceArray.add(namespaceArrayItem);
return this;
@ -802,7 +802,7 @@ public class XmlItem {
public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) {
if (this.namespaceWrappedArray == null) {
this.namespaceWrappedArray = new ArrayList<Integer>();
this.namespaceWrappedArray = new ArrayList<>();
}
this.namespaceWrappedArray.add(namespaceWrappedArrayItem);
return this;
@ -945,7 +945,7 @@ public class XmlItem {
public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) {
if (this.prefixNsArray == null) {
this.prefixNsArray = new ArrayList<Integer>();
this.prefixNsArray = new ArrayList<>();
}
this.prefixNsArray.add(prefixNsArrayItem);
return this;
@ -980,7 +980,7 @@ public class XmlItem {
public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) {
if (this.prefixNsWrappedArray == null) {
this.prefixNsWrappedArray = new ArrayList<Integer>();
this.prefixNsWrappedArray = new ArrayList<>();
}
this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem);
return this;