-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: eliminate raw-types and remove unnecessary cast #1095
Conversation
…endencies to v3.0.6 (#1088) [![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 <details> <summary>googleapis/java-shared-dependencies</summary> ### [`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)) </details> --- ### 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. --- - [ ] <!-- rebase-check -->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). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xOS4wIiwidXBkYXRlZEluVmVyIjoiMzQuMTkuMCJ9-->
#1087) [![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. --- - [ ] <!-- rebase-check -->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). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xOS4wIiwidXBkYXRlZEluVmVyIjoiMzQuMTkuMCJ9-->
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thank you for these fixes!
(Nit on PR naming: perhaps prefix with something like fix(spring)
or fix(Spring CodeGen)
, just to help differentiate with PRs merging into the main branch?)
BiFunction<List<String>, Expr, List<? extends AstNode>> processFunc, | ||
Function<String, List<? extends AstNode>> perMethodFuncAfterSettings) { | ||
List resultList = new ArrayList<>(); | ||
Function<String, List<? extends T>> perMethodFuncBeforeSettings, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change <? extends T>
to T
as well? Looks like what gets returned are always the same type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
T
is valid for the current source; but as a Util
function, the limit of the implementation is <? extends T>
which defines how it can be used in the future as well. This also decouples future functions from needing to return the same type of AstNode list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example, without the ? extends T
, it wouldn't be possible to combine type-related-but-not-the-same helper functions:
abstract List<CommentStatement> getHeaderComments(String methodName);
abstract List<Statement> getStatements(String methodName);
private static <T> List<T> NONE(String unused) { return Collections.emptyList(); }
private void example() {
List<Statement> statements = Util.processRetrySettings(
server,
config,
clazzType,
this::getHeaderComments,
this::getStatements,
this::NONE
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with the general idea. But for this util method, it's a very specific use case(Create retry settings with some hardcoded method names) that is only used by the two composers, so I doubt it will be used by anything else. I could also argue that this method should not be a public Util, maybe it should be in something like a AbstractSpringComposer
with default scope.
That being said, I don't think this is critical enough to block the PR, so either way works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this!
Kudos, SonarCloud Quality Gate passed! |
No description provided.