From 0e75338dcb083c4cccd35d8682ba9cbe4e314ef8 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 8 Nov 2022 16:40:26 +0100 Subject: [PATCH 1/4] fix(deps): update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.6 (#1088) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `3.0.5` -> `3.0.6` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.6/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.6/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.6/compatibility-slim/3.0.5)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.6/confidence-slim/3.0.5)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-shared-dependencies ### [`v3.0.6`](https://togithub.com/googleapis/java-shared-dependencies/blob/HEAD/CHANGELOG.md#​306-httpsgithubcomgoogleapisjava-shared-dependenciescomparev305v306-2022-11-07) [Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v3.0.5...v3.0.6) ##### Dependencies - Update dependency com.fasterxml.jackson:jackson-bom to v2.14.0 ([#​901](https://togithub.com/googleapis/java-shared-dependencies/issues/901)) ([33c5511](https://togithub.com/googleapis/java-shared-dependencies/commit/33c55112ff485da1d7a0a32d8b6dade33aa04ff8)) - Update dependency com.google.api-client:google-api-client-bom to v2.0.1 ([#​899](https://togithub.com/googleapis/java-shared-dependencies/issues/899)) ([4029e89](https://togithub.com/googleapis/java-shared-dependencies/commit/4029e89be507ddfa030515565fdb6fbf8997324e)) - Update dependency com.google.api:api-common to v2.2.2 ([#​892](https://togithub.com/googleapis/java-shared-dependencies/issues/892)) ([5c59fbd](https://togithub.com/googleapis/java-shared-dependencies/commit/5c59fbd3c3cf3efbfda50420c8048e3ff257084c)) - Update dependency com.google.cloud:grpc-gcp to v1.3.1 ([#​884](https://togithub.com/googleapis/java-shared-dependencies/issues/884)) ([9fffe24](https://togithub.com/googleapis/java-shared-dependencies/commit/9fffe243b631565a00b0a848a6c73163b1dd33a4)) - Update dependency com.google.code.gson:gson to v2.10 ([#​887](https://togithub.com/googleapis/java-shared-dependencies/issues/887)) ([15017de](https://togithub.com/googleapis/java-shared-dependencies/commit/15017de39a35f90bc1b38b828edc23fdce524a07)) - Update dependency com.google.http-client:google-http-client-bom to v1.42.3 ([#​893](https://togithub.com/googleapis/java-shared-dependencies/issues/893)) ([4c0de9b](https://togithub.com/googleapis/java-shared-dependencies/commit/4c0de9bd188bfab5fe126c8b01b4d7168f8a5079)) - Update dependency com.google.protobuf:protobuf-bom to v3.21.9 ([#​889](https://togithub.com/googleapis/java-shared-dependencies/issues/889)) ([8576271](https://togithub.com/googleapis/java-shared-dependencies/commit/85762716d1bbb97c447f86451094fb8af2528470)) - Update dependency io.grpc:grpc-bom to v1.50.2 ([#​878](https://togithub.com/googleapis/java-shared-dependencies/issues/878)) ([fd569af](https://togithub.com/googleapis/java-shared-dependencies/commit/fd569af1e5f1b195e2421fc9e02d8b67afe1c638)) - Update dependency org.checkerframework:checker-qual to v3.27.0 ([#​896](https://togithub.com/googleapis/java-shared-dependencies/issues/896)) ([f0f7931](https://togithub.com/googleapis/java-shared-dependencies/commit/f0f7931937a0ed9a32fd87cd58c82b787d368242)) - Update dependency org.threeten:threetenbp to v1.6.4 ([#​894](https://togithub.com/googleapis/java-shared-dependencies/issues/894)) ([899682d](https://togithub.com/googleapis/java-shared-dependencies/commit/899682d0405645d9d5288b298af2fda228414669)) - Update gax.version to v2.19.5 ([#​903](https://togithub.com/googleapis/java-shared-dependencies/issues/903)) ([3e4d8b3](https://togithub.com/googleapis/java-shared-dependencies/commit/3e4d8b35d3f682b07326ffa0a3e552d097f25a65)) - Update google.common-protos.version to v2.10.0 ([#​900](https://togithub.com/googleapis/java-shared-dependencies/issues/900)) ([53b54c3](https://togithub.com/googleapis/java-shared-dependencies/commit/53b54c35f3a7c19df488921a6077e7a9bfb0b103)) - Update google.core.version to v2.8.23 ([#​885](https://togithub.com/googleapis/java-shared-dependencies/issues/885)) ([686dd7c](https://togithub.com/googleapis/java-shared-dependencies/commit/686dd7c8f541189302e8cac4ae72ed7d967b5b3f)) - Update google.core.version to v2.8.24 ([#​890](https://togithub.com/googleapis/java-shared-dependencies/issues/890)) ([1effda3](https://togithub.com/googleapis/java-shared-dependencies/commit/1effda381c7b886f5ae4d2dac9473da821e655fe)) - Update google.core.version to v2.8.27 ([#​902](https://togithub.com/googleapis/java-shared-dependencies/issues/902)) ([3bcb804](https://togithub.com/googleapis/java-shared-dependencies/commit/3bcb804dec4358ed0a9c6c35cf4c35f817821e9a)) - Update iam.version to v1.6.6 ([#​886](https://togithub.com/googleapis/java-shared-dependencies/issues/886)) ([03d0690](https://togithub.com/googleapis/java-shared-dependencies/commit/03d0690f01f9217e31dd65d55c28a47f2f2deb22)) - Update iam.version to v1.6.7 ([#​895](https://togithub.com/googleapis/java-shared-dependencies/issues/895)) ([6cebc20](https://togithub.com/googleapis/java-shared-dependencies/commit/6cebc205daa98b96a8b27b3fc3cd222319b27e59))
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/gapic-generator-java). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 76416d39da..393c33cffb 100644 --- a/pom.xml +++ b/pom.xml @@ -15,7 +15,7 @@ com.google.cloud google-cloud-shared-dependencies - 3.0.5 + 3.0.6 pom import From ee5d7a5985d298e6d96dc700805870f3e362b1de Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 8 Nov 2022 17:06:20 +0100 Subject: [PATCH 2/4] chore(deps): update dependency kr.motd.maven:os-maven-plugin to v1.7.1 (#1087) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [kr.motd.maven:os-maven-plugin](https://togithub.com/trustin/os-maven-plugin) | `1.7.0` -> `1.7.1` | [![age](https://badges.renovateapi.com/packages/maven/kr.motd.maven:os-maven-plugin/1.7.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/kr.motd.maven:os-maven-plugin/1.7.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/kr.motd.maven:os-maven-plugin/1.7.1/compatibility-slim/1.7.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/kr.motd.maven:os-maven-plugin/1.7.1/confidence-slim/1.7.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/gapic-generator-java). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 393c33cffb..a9f45412ad 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ kr.motd.maven os-maven-plugin - 1.7.0 + 1.7.1 From 4fd1f987c59ecf97f17f1b771d74e526fdf0b651 Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Mon, 14 Nov 2022 13:01:49 -0500 Subject: [PATCH 3/4] fix: eliminate raw-types and remove unnecessary cast --- .../composer/SpringAutoConfigClassComposer.java | 5 +++-- .../composer/SpringPropertiesClassComposer.java | 13 ++++++------- .../google/api/generator/spring/utils/Utils.java | 11 ++++++----- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/google/api/generator/spring/composer/SpringAutoConfigClassComposer.java b/src/main/java/com/google/api/generator/spring/composer/SpringAutoConfigClassComposer.java index 1a97af96c7..aaeab40ab8 100644 --- a/src/main/java/com/google/api/generator/spring/composer/SpringAutoConfigClassComposer.java +++ b/src/main/java/com/google/api/generator/spring/composer/SpringAutoConfigClassComposer.java @@ -65,6 +65,7 @@ import java.util.stream.Collectors; public class SpringAutoConfigClassComposer implements ClassComposer { + private static final String CLASS_NAME_PATTERN = "%sSpringAutoConfiguration"; private static final SpringAutoConfigClassComposer INSTANCE = new SpringAutoConfigClassComposer(); @@ -665,7 +666,7 @@ private static MethodDefinition createClientBeanMethod( } // retry settings for each method TypeNode thisClassType = types.get(service.name() + "AutoConfig"); - List retrySettings = + List retrySettings = Utils.processRetrySettings( service, gapicServiceConfig, @@ -876,7 +877,7 @@ private static MethodDefinition createUserAgentHeaderProviderMethod( } private static Map createStaticTypes() { - List concreteClazzes = + List> concreteClazzes = Arrays.asList( RetrySettings.class, RetrySettings.Builder diff --git a/src/main/java/com/google/api/generator/spring/composer/SpringPropertiesClassComposer.java b/src/main/java/com/google/api/generator/spring/composer/SpringPropertiesClassComposer.java index 685830d7f8..a21eec29ce 100644 --- a/src/main/java/com/google/api/generator/spring/composer/SpringPropertiesClassComposer.java +++ b/src/main/java/com/google/api/generator/spring/composer/SpringPropertiesClassComposer.java @@ -14,12 +14,11 @@ package com.google.api.generator.spring.composer; -import static com.google.api.generator.engine.ast.NewObjectExpr.*; +import static com.google.api.generator.engine.ast.NewObjectExpr.builder; import com.google.api.gax.retrying.RetrySettings; import com.google.api.generator.engine.ast.AnnotationNode; import com.google.api.generator.engine.ast.AssignmentExpr; -import com.google.api.generator.engine.ast.AstNode; import com.google.api.generator.engine.ast.ClassDefinition; import com.google.api.generator.engine.ast.ConcreteReference; import com.google.api.generator.engine.ast.Expr; @@ -55,6 +54,7 @@ import java.util.stream.Collectors; public class SpringPropertiesClassComposer implements ClassComposer { + private static final String CLASS_NAME_PATTERN = "%sSpringProperties"; private static final Map staticTypes = createStaticTypes(); @@ -187,7 +187,7 @@ private static List createMemberVariables( // declare each retry settings with its default value. use defaults from serviceConfig TypeNode thisClassType = types.get(service.name() + "Properties"); - List retrySettings = + List retrySettings = Utils.processRetrySettings( service, serviceConfig, @@ -208,8 +208,7 @@ private static List createMemberVariables( }, (String propertyName) -> new ArrayList<>()); - statements.addAll( - retrySettings.stream().map(Statement.class::cast).collect(Collectors.toList())); + statements.addAll(retrySettings); return statements; } @@ -241,7 +240,7 @@ private static List createGetterSetters( methodDefinitions.add( createSetterMethod(thisClassType, "executorThreadCount", TypeNode.INT_OBJECT)); - List retrySettings = + List retrySettings = Utils.processRetrySettings( service, gapicServiceConfig, @@ -381,7 +380,7 @@ private static Map createDynamicTypes(Service service, String } private static Map createStaticTypes() { - List concreteClazzes = + List> concreteClazzes = Arrays.asList(RetrySettings.class, org.threeten.bp.Duration.class); return concreteClazzes.stream() .collect( diff --git a/src/main/java/com/google/api/generator/spring/utils/Utils.java b/src/main/java/com/google/api/generator/spring/utils/Utils.java index ce02532b84..5bd211cbb4 100644 --- a/src/main/java/com/google/api/generator/spring/utils/Utils.java +++ b/src/main/java/com/google/api/generator/spring/utils/Utils.java @@ -38,6 +38,7 @@ import java.util.function.Function; public class Utils { + private static final TypeStore FIXED_TYPESTORE = createStaticTypes(); private static final String BRAND_NAME = "spring.cloud.gcp"; @@ -90,14 +91,14 @@ public static String getSpringPropertyPrefix(String packageName, String serviceN + CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_HYPHEN, serviceName); } - public static List processRetrySettings( + public static List processRetrySettings( Service service, GapicServiceConfig gapicServiceConfig, TypeNode thisClassType, - Function> perMethodFuncBeforeSettings, - BiFunction, Expr, List> processFunc, - Function> perMethodFuncAfterSettings) { - List resultList = new ArrayList<>(); + Function> perMethodFuncBeforeSettings, + BiFunction, Expr, List> processFunc, + Function> perMethodFuncAfterSettings) { + List resultList = new ArrayList<>(); for (Method method : service.methods()) { String methodName = CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, method.name()); String retryParamName = gapicServiceConfig.getRetryParamsName(service, method); From 29ca198e26b1ce94c227dfdf6eaab840cc08007e Mon Sep 17 00:00:00 2001 From: Burke Davison Date: Mon, 14 Nov 2022 13:01:49 -0500 Subject: [PATCH 4/4] fix(spring): eliminate raw-types and remove unnecessary cast --- .../composer/SpringAutoConfigClassComposer.java | 5 +++-- .../composer/SpringPropertiesClassComposer.java | 13 ++++++------- .../google/api/generator/spring/utils/Utils.java | 11 ++++++----- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/google/api/generator/spring/composer/SpringAutoConfigClassComposer.java b/src/main/java/com/google/api/generator/spring/composer/SpringAutoConfigClassComposer.java index 1a97af96c7..aaeab40ab8 100644 --- a/src/main/java/com/google/api/generator/spring/composer/SpringAutoConfigClassComposer.java +++ b/src/main/java/com/google/api/generator/spring/composer/SpringAutoConfigClassComposer.java @@ -65,6 +65,7 @@ import java.util.stream.Collectors; public class SpringAutoConfigClassComposer implements ClassComposer { + private static final String CLASS_NAME_PATTERN = "%sSpringAutoConfiguration"; private static final SpringAutoConfigClassComposer INSTANCE = new SpringAutoConfigClassComposer(); @@ -665,7 +666,7 @@ private static MethodDefinition createClientBeanMethod( } // retry settings for each method TypeNode thisClassType = types.get(service.name() + "AutoConfig"); - List retrySettings = + List retrySettings = Utils.processRetrySettings( service, gapicServiceConfig, @@ -876,7 +877,7 @@ private static MethodDefinition createUserAgentHeaderProviderMethod( } private static Map createStaticTypes() { - List concreteClazzes = + List> concreteClazzes = Arrays.asList( RetrySettings.class, RetrySettings.Builder diff --git a/src/main/java/com/google/api/generator/spring/composer/SpringPropertiesClassComposer.java b/src/main/java/com/google/api/generator/spring/composer/SpringPropertiesClassComposer.java index 685830d7f8..a21eec29ce 100644 --- a/src/main/java/com/google/api/generator/spring/composer/SpringPropertiesClassComposer.java +++ b/src/main/java/com/google/api/generator/spring/composer/SpringPropertiesClassComposer.java @@ -14,12 +14,11 @@ package com.google.api.generator.spring.composer; -import static com.google.api.generator.engine.ast.NewObjectExpr.*; +import static com.google.api.generator.engine.ast.NewObjectExpr.builder; import com.google.api.gax.retrying.RetrySettings; import com.google.api.generator.engine.ast.AnnotationNode; import com.google.api.generator.engine.ast.AssignmentExpr; -import com.google.api.generator.engine.ast.AstNode; import com.google.api.generator.engine.ast.ClassDefinition; import com.google.api.generator.engine.ast.ConcreteReference; import com.google.api.generator.engine.ast.Expr; @@ -55,6 +54,7 @@ import java.util.stream.Collectors; public class SpringPropertiesClassComposer implements ClassComposer { + private static final String CLASS_NAME_PATTERN = "%sSpringProperties"; private static final Map staticTypes = createStaticTypes(); @@ -187,7 +187,7 @@ private static List createMemberVariables( // declare each retry settings with its default value. use defaults from serviceConfig TypeNode thisClassType = types.get(service.name() + "Properties"); - List retrySettings = + List retrySettings = Utils.processRetrySettings( service, serviceConfig, @@ -208,8 +208,7 @@ private static List createMemberVariables( }, (String propertyName) -> new ArrayList<>()); - statements.addAll( - retrySettings.stream().map(Statement.class::cast).collect(Collectors.toList())); + statements.addAll(retrySettings); return statements; } @@ -241,7 +240,7 @@ private static List createGetterSetters( methodDefinitions.add( createSetterMethod(thisClassType, "executorThreadCount", TypeNode.INT_OBJECT)); - List retrySettings = + List retrySettings = Utils.processRetrySettings( service, gapicServiceConfig, @@ -381,7 +380,7 @@ private static Map createDynamicTypes(Service service, String } private static Map createStaticTypes() { - List concreteClazzes = + List> concreteClazzes = Arrays.asList(RetrySettings.class, org.threeten.bp.Duration.class); return concreteClazzes.stream() .collect( diff --git a/src/main/java/com/google/api/generator/spring/utils/Utils.java b/src/main/java/com/google/api/generator/spring/utils/Utils.java index ce02532b84..5bd211cbb4 100644 --- a/src/main/java/com/google/api/generator/spring/utils/Utils.java +++ b/src/main/java/com/google/api/generator/spring/utils/Utils.java @@ -38,6 +38,7 @@ import java.util.function.Function; public class Utils { + private static final TypeStore FIXED_TYPESTORE = createStaticTypes(); private static final String BRAND_NAME = "spring.cloud.gcp"; @@ -90,14 +91,14 @@ public static String getSpringPropertyPrefix(String packageName, String serviceN + CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_HYPHEN, serviceName); } - public static List processRetrySettings( + public static List processRetrySettings( Service service, GapicServiceConfig gapicServiceConfig, TypeNode thisClassType, - Function> perMethodFuncBeforeSettings, - BiFunction, Expr, List> processFunc, - Function> perMethodFuncAfterSettings) { - List resultList = new ArrayList<>(); + Function> perMethodFuncBeforeSettings, + BiFunction, Expr, List> processFunc, + Function> perMethodFuncAfterSettings) { + List resultList = new ArrayList<>(); for (Method method : service.methods()) { String methodName = CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, method.name()); String retryParamName = gapicServiceConfig.getRetryParamsName(service, method);