Skip to content

Commit

Permalink
Add commons-lang3 dependency for useReflectionEqualsHashCode
Browse files Browse the repository at this point in the history
  • Loading branch information
DielN committed Nov 9, 2024
1 parent 13b11d7 commit 5f96413
Show file tree
Hide file tree
Showing 343 changed files with 1,165 additions and 2,526 deletions.
1 change: 1 addition & 0 deletions .github/workflows/samples-java-client-jdk11.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ jobs:
- samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter
- samples/client/petstore/java/apache-httpclient
- samples/client/petstore/java/feign
- samples/client/petstore/java/feign-no-nullable
- samples/client/petstore/java/okhttp-gson-awsv4signature
- samples/openapi3/client/petstore/java/jersey2-java8-special-characters
- samples/openapi3/client/petstore/java/native
Expand Down
5 changes: 3 additions & 2 deletions bin/configs/java-feign-no-nullable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ templateDir: modules/openapi-generator/src/main/resources/Java
additionalProperties:
booleanGetterPrefix: is
artifactId: petstore-feign-no-nullable
hideGenerationTimestamp: "true"
hideGenerationTimestamp: true
additionalModelTypeAnnotations: '@javax.annotation.concurrent.Immutable'
openApiNullable: "false"
openApiNullable: false
useReflectionEqualsHashCode: true
3 changes: 2 additions & 1 deletion bin/configs/java-jersey2-8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ additionalProperties:
useOneOfDiscriminatorLookup: true
disallowAdditionalPropertiesIfNotPresent: false
gradleProperties: "\n# JVM arguments\norg.gradle.jvmargs=-Xmx2024m -XX:MaxPermSize=512m\n# set timeout\norg.gradle.daemon.idletimeout=3600000\n# show all warnings\norg.gradle.warning.mode=all"
failOnUnknownProperties: true
failOnUnknownProperties: true
useReflectionEqualsHashCode: true
3 changes: 2 additions & 1 deletion bin/configs/java-jersey3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ additionalProperties:
useOneOfDiscriminatorLookup: true
disallowAdditionalPropertiesIfNotPresent: false
gradleProperties: "\n# JVM arguments\norg.gradle.jvmargs=-Xmx2024m -XX:MaxPermSize=512m\n# set timeout\norg.gradle.daemon.idletimeout=3600000\n# show all warnings\norg.gradle.warning.mode=all"
failOnUnknownProperties: true
failOnUnknownProperties: true
useReflectionEqualsHashCode: true
1 change: 1 addition & 0 deletions bin/configs/java-native.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ additionalProperties:
artifactId: petstore-native
hideGenerationTimestamp: "true"
generateBuilders: true
useReflectionEqualsHashCode: "true"
5 changes: 3 additions & 2 deletions bin/configs/java-okhttp-gson.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ parameterNameMappings:
type_: typeWithUnderscore
additionalProperties:
artifactId: petstore-okhttp-gson
hideGenerationTimestamp: "true"
useOneOfDiscriminatorLookup: "true"
hideGenerationTimestamp: true
useOneOfDiscriminatorLookup: true
disallowAdditionalPropertiesIfNotPresent: false
useReflectionEqualsHashCode:: true
enumNameMappings:
s: LOWER_CASE_S
S: UPPER_CASE_S
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ ext {
jersey_version = "1.19.4"
jodatime_version = "2.9.9"
junit_version = "5.10.2"
{{#useReflectionEqualsHashCode}}
commons_lang3_version = "3.17.0"
{{/useReflectionEqualsHashCode}}
}

dependencies {
Expand All @@ -148,6 +151,9 @@ dependencies {
{{#useBeanValidation}}
implementation "jakarta.validation:jakarta.validation-api:$bean_validation_version"
{{/useBeanValidation}}
{{#useReflectionEqualsHashCode}}
implementation "org.apache.commons:commons-lang3:$commons_lang3_version"
{{/useReflectionEqualsHashCode}}
testImplementation "junit:junit:$junit_version"
testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ ext {
feign_form_version = "3.8.0"
junit_version = "5.7.0"
scribejava_version = "8.0.0"
{{#useReflectionEqualsHashCode}}
commons_lang3_version = "3.17.0"
{{/useReflectionEqualsHashCode}}
}

dependencies {
Expand All @@ -127,9 +130,9 @@ dependencies {
implementation "io.github.openfeign:feign-okhttp:$feign_version"
implementation "io.github.openfeign.form:feign-form:$feign_form_version"
{{#jackson}}
{{#joda}}
{{#joda}}
implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version"
{{/joda}}
{{/joda}}
implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version"
implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version"
Expand All @@ -142,6 +145,9 @@ dependencies {
implementation "com.github.scribejava:scribejava-core:$scribejava_version"
implementation "com.brsanthu:migbase64:2.2"
implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
{{#useReflectionEqualsHashCode}}
implementation "org.apache.commons:commons-lang3:$commons_lang3_version"
{{/useReflectionEqualsHashCode}}
testImplementation "org.junit.jupiter:junit-jupiter:$junit_version"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version"
testImplementation "org.junit.jupiter:junit-jupiter-params:$junit_version"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ lazy val root = (project in file(".")).
"com.github.scribejava" % "scribejava-core" % "8.0.0" % "compile",
"com.brsanthu" % "migbase64" % "2.2" % "compile",
"jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile",
{{#useReflectionEqualsHashCode}}
"org.apache.commons" % "commons-lang3" % "3.17.0" % "compile",
{{/useReflectionEqualsHashCode}}
"org.junit.jupiter" % "junit-jupiter" % "5.7.0" % "test",
"org.junit.jupiter" % "junit-jupiter-params" % "5.7.0" % "test",
"com.github.tomakehurst" % "wiremock-jre8" % "2.35.1" % "test",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,14 @@
<scope>provided</scope>
</dependency>
{{/useBeanValidation}}
{{#useReflectionEqualsHashCode}}
<!-- For equals and hashCode using reflection -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3-version}</version>
</dependency>
{{/useReflectionEqualsHashCode}}

<!-- test dependencies -->
<dependency>
Expand Down Expand Up @@ -409,6 +417,9 @@
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<beanvalidation-version>2.0.2</beanvalidation-version>
{{/useJakartaEe}}
{{#useReflectionEqualsHashCode}}
<commons-lang3-version>3.17.0</commons-lang3-version>
{{/useReflectionEqualsHashCode}}
<junit-version>5.10.0</junit-version>
<maven-plugin-version>1.0.0</maven-plugin-version>
<scribejava-version>8.3.3</scribejava-version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ ext {
{{#hasHttpSignatureMethods}}
tomitribe_http_signatures_version = "1.7"
{{/hasHttpSignatureMethods}}
{{#useReflectionEqualsHashCode}}
commons_lang3_version = "3.17.0"
{{/useReflectionEqualsHashCode}}
}

dependencies {
Expand Down Expand Up @@ -146,6 +149,9 @@ dependencies {
{{#useBeanValidation}}
implementation "jakarta.validation:jakarta.validation-api:$bean_validation_version"
{{/useBeanValidation}}
{{#useReflectionEqualsHashCode}}
implementation "org.apache.commons:commons-lang3:$commons_lang3_version"
{{/useReflectionEqualsHashCode}}
testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ lazy val root = (project in file(".")).
"org.tomitribe" % "tomitribe-http-signatures" % "1.7" % "compile",
{{/hasHttpSignatureMethods}}
"jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile",
{{#useReflectionEqualsHashCode}}
"org.apache.commons" % "commons-lang3" % "3.17.0" % "compile",
{{/useReflectionEqualsHashCode}}
"org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test"
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ ext {
{{#hasHttpSignatureMethods}}
tomitribe_http_signatures_version = "1.7"
{{/hasHttpSignatureMethods}}
{{#useReflectionEqualsHashCode}}
commons_lang3_version = "3.17.0"
{{/useReflectionEqualsHashCode}}
}

dependencies {
Expand Down Expand Up @@ -146,6 +149,9 @@ dependencies {
{{#useBeanValidation}}
implementation "jakarta.validation:jakarta.validation-api:$bean_validation_version"
{{/useBeanValidation}}
{{#useReflectionEqualsHashCode}}
implementation "org.apache.commons:commons-lang3:$commons_lang3_version"
{{/useReflectionEqualsHashCode}}

testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ lazy val root = (project in file(".")).
"org.tomitribe" % "tomitribe-http-signatures" % "1.7" % "compile",
{{/hasHttpSignatureMethods}}
"jakarta.annotation" % "jakarta.annotation-api" % "2.1.0" % "compile",
{{#useReflectionEqualsHashCode}}
"org.apache.commons" % "commons-lang3" % "3.17.0" % "compile",
{{/useReflectionEqualsHashCode}}
"org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test"
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,15 @@
<artifactId>jersey-apache-connector</artifactId>
<version>${jersey-version}</version>
</dependency>
{{#useReflectionEqualsHashCode}}
<!-- For equals and hashCode using reflection -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3-version}</version>
</dependency>
{{/useReflectionEqualsHashCode}}
<!-- test dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down Expand Up @@ -408,6 +417,9 @@
{{#hasOAuthMethods}}
<scribejava-apis-version>8.3.3</scribejava-apis-version>
{{/hasOAuthMethods}}
{{#useReflectionEqualsHashCode}}
<commons-lang3-version>3.17.0</commons-lang3-version>
{{/useReflectionEqualsHashCode}}
<spotless.version>2.21.0</spotless.version>
</properties>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ ext {
{{#hasFormParamsInSpec}}
httpmime_version = "4.5.13"
{{/hasFormParamsInSpec}}
{{#useReflectionEqualsHashCode}}
commons_lang3_version = "3.17.0"
{{/useReflectionEqualsHashCode}}
}

dependencies {
Expand All @@ -107,6 +110,9 @@ dependencies {
{{#hasFormParamsInSpec}}
implementation "org.apache.httpcomponents:httpmime:$httpmime_version"
{{/hasFormParamsInSpec}}
{{#useReflectionEqualsHashCode}}
implementation "org.apache.commons:commons-lang3:$commons_lang3_version"
{{/useReflectionEqualsHashCode}}
testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,14 @@
<version>${httpmime-version}</version>
</dependency>
{{/hasFormParamsInSpec}}
{{#useReflectionEqualsHashCode}}
<!-- For equals and hashCode using reflection -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3-version}</version>
</dependency>
{{/useReflectionEqualsHashCode}}
<!-- test dependencies -->
<dependency>
Expand Down Expand Up @@ -304,6 +312,9 @@
{{#hasFormParamsInSpec}}
<httpmime-version>4.5.14</httpmime-version>
{{/hasFormParamsInSpec}}
{{#useReflectionEqualsHashCode}}
<commons-lang3-version>3.17.0</commons-lang3-version>
{{/useReflectionEqualsHashCode}}
<junit-version>5.10.2</junit-version>
<spotless.version>2.27.2</spotless.version>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ dependencies {
{{#hasOAuthMethods}}
implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2'
{{/hasOAuthMethods}}
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0'
{{#joda}}
implementation 'joda-time:joda-time:2.9.9'
{{/joda}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ lazy val root = (project in file(".")).
"com.squareup.okhttp3" % "okhttp" % "4.12.0",
"com.squareup.okhttp3" % "logging-interceptor" % "4.12.0",
"com.google.code.gson" % "gson" % "2.9.1",
"org.apache.commons" % "commons-lang3" % "3.12.0",
"org.apache.commons" % "commons-lang3" % "3.17.0",
"jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6",
{{#openApiNullable}}
"org.openapitools" % "jackson-databind-nullable" % "0.2.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@
{{/swagger2AnnotationLibrary}}
<okhttp-version>4.12.0</okhttp-version>
<gson-version>2.10.1</gson-version>
<commons-lang3-version>3.14.0</commons-lang3-version>
<commons-lang3-version>3.17.0</commons-lang3-version>
{{#openApiNullable}}
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
{{/openApiNullable}}
Expand Down
24 changes: 18 additions & 6 deletions modules/openapi-generator/src/main/resources/Java/pom.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,12 @@
{{/useJakartaEe}}
{{#withXml}}

<!-- XML processing: Jackson -->
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<version>${jackson-version}</version>
</dependency>
<!-- XML processing: Jackson -->
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<version>${jackson-version}</version>
</dependency>

{{/withXml}}
{{#joda}}
Expand Down Expand Up @@ -341,6 +341,15 @@
<version>${jakarta-annotation-version}</version>
<scope>provided</scope>
</dependency>
{{#useReflectionEqualsHashCode}}
<!-- For equals and hashCode using reflection -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3-version}</version>
</dependency>
{{/useReflectionEqualsHashCode}}

<!-- test dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down Expand Up @@ -374,6 +383,9 @@
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<beanvalidation-version>2.0.2</beanvalidation-version>
{{/useJakartaEe}}
{{#useReflectionEqualsHashCode}}
<commons-lang3-version>3.17.0</commons-lang3-version>
{{/useReflectionEqualsHashCode}}
<maven-plugin-version>1.0.0</maven-plugin-version>
<junit-version>5.10.2</junit-version>
<junit-platform-runner.version>1.10.0</junit-platform-runner.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ dependencies {
implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6'
implementation 'org.openapitools:jackson-databind-nullable:0.2.6'
implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0'
implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3'
testImplementation 'org.mockito:mockito-core:3.12.4'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ lazy val root = (project in file(".")).
"com.squareup.okhttp3" % "okhttp" % "4.12.0",
"com.squareup.okhttp3" % "logging-interceptor" % "4.12.0",
"com.google.code.gson" % "gson" % "2.9.1",
"org.apache.commons" % "commons-lang3" % "3.12.0",
"org.apache.commons" % "commons-lang3" % "3.17.0",
"jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6",
"org.openapitools" % "jackson-databind-nullable" % "0.2.6",
"org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@
<gson-fire-version>1.9.0</gson-fire-version>
<okhttp-version>4.12.0</okhttp-version>
<gson-version>2.10.1</gson-version>
<commons-lang3-version>3.14.0</commons-lang3-version>
<commons-lang3-version>3.17.0</commons-lang3-version>
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<beanvalidation-version>2.0.2</beanvalidation-version>
Expand Down
2 changes: 1 addition & 1 deletion samples/client/echo_api/java/okhttp-gson/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ dependencies {
implementation 'io.gsonfire:gson-fire:1.9.0'
implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6'
implementation 'org.openapitools:jackson-databind-nullable:0.2.6'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0'
implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3'
testImplementation 'org.mockito:mockito-core:3.12.4'
Expand Down
2 changes: 1 addition & 1 deletion samples/client/echo_api/java/okhttp-gson/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ lazy val root = (project in file(".")).
"com.squareup.okhttp3" % "okhttp" % "4.12.0",
"com.squareup.okhttp3" % "logging-interceptor" % "4.12.0",
"com.google.code.gson" % "gson" % "2.9.1",
"org.apache.commons" % "commons-lang3" % "3.12.0",
"org.apache.commons" % "commons-lang3" % "3.17.0",
"jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6",
"org.openapitools" % "jackson-databind-nullable" % "0.2.6",
"io.gsonfire" % "gson-fire" % "1.9.0" % "compile",
Expand Down
2 changes: 1 addition & 1 deletion samples/client/echo_api/java/okhttp-gson/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@
<gson-fire-version>1.9.0</gson-fire-version>
<okhttp-version>4.12.0</okhttp-version>
<gson-version>2.10.1</gson-version>
<commons-lang3-version>3.14.0</commons-lang3-version>
<commons-lang3-version>3.17.0</commons-lang3-version>
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<beanvalidation-version>2.0.2</beanvalidation-version>
Expand Down
Loading

0 comments on commit 5f96413

Please sign in to comment.