Skip to content

add generics support to AutoValueUtils helpers#32977

Merged
Abacn merged 2 commits intoapache:masterfrom
tilgalas:generic-autovalueutils-helpers
Oct 13, 2025
Merged

add generics support to AutoValueUtils helpers#32977
Abacn merged 2 commits intoapache:masterfrom
tilgalas:generic-autovalueutils-helpers

Conversation

@tilgalas
Copy link
Copy Markdown
Contributor

This is a 3rd PR in the series of PRs (based on the now closed #31648) whose ultimate goal is to add support for generic classes to schema providers.

This PR updates the AutoValueUtils class which contains helpers that aid in manipulating the AutoValue internal generated classes - builders and concrete implementation of the abstract "spec" classes. The helpers will now be able to correctly find builders and generated implementations for generic AutoValue classes, see the newly added tests to see them in action.

@github-actions github-actions bot added the java label Oct 30, 2024
}
String builderName = generated.getName() + "$Builder";
public static @Nullable TypeDescriptor<?> getAutoValueGeneratedBuilder(
TypeDescriptor<?> typeDescriptor) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason you remoevd the code that walks up the class hierarchy here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, probably did it by mistake, I'll bring it back

@github-actions
Copy link
Copy Markdown
Contributor

Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment assign set of reviewers

@tilgalas
Copy link
Copy Markdown
Contributor Author

tilgalas commented Nov 4, 2024

Run Java_IOs_Direct PreCommit

@tilgalas
Copy link
Copy Markdown
Contributor Author

tilgalas commented Nov 4, 2024

Run Java PreCommit

// AutoValue extensions may be nested
TypeDescriptor<?> firstGeneratedTypeDescriptor = findFirstGeneratedAutoValue(typeDescriptor);
return Optional.ofNullable(firstGeneratedTypeDescriptor.getRawType().getSuperclass())
.map(superClass -> firstGeneratedTypeDescriptor.getSupertype((Class) superClass))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we calling getSuperclass here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so the findFirstGeneratedAutoValue will return the topmost class which is still generated, the getBaseAutoValueClass is supposed to return the non-generated base class which is the superclass of that

@github-actions
Copy link
Copy Markdown
Contributor

Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:

R: @m-trieu for label java.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 7, 2025

Reminder, please take a look at this pr: @m-trieu

@github-actions
Copy link
Copy Markdown
Contributor

Assigning new set of reviewers because Pr has gone too long without review. If you would like to opt out of this review, comment assign to next reviewer:

R: @robertwb for label java.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

@github-actions
Copy link
Copy Markdown
Contributor

Reminder, please take a look at this pr: @robertwb

@github-actions
Copy link
Copy Markdown
Contributor

Assigning new set of reviewers because Pr has gone too long without review. If you would like to opt out of this review, comment assign to next reviewer:

R: @damondouglas for label java.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

@github-actions
Copy link
Copy Markdown
Contributor

Reminder, please take a look at this pr: @damondouglas

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 4, 2025

Assigning new set of reviewers because Pr has gone too long without review. If you would like to opt out of this review, comment assign to next reviewer:

R: @Abacn for label java.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

@github-actions
Copy link
Copy Markdown
Contributor

Reminder, please take a look at this pr: @Abacn

@github-actions
Copy link
Copy Markdown
Contributor

Assigning new set of reviewers because Pr has gone too long without review. If you would like to opt out of this review, comment assign to next reviewer:

R: @kennknowles for label java.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

@github-actions
Copy link
Copy Markdown
Contributor

Reminder, please take a look at this pr: @kennknowles

@github-actions
Copy link
Copy Markdown
Contributor

Assigning new set of reviewers because Pr has gone too long without review. If you would like to opt out of this review, comment assign to next reviewer:

R: @damondouglas for label java.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2025

Reminder, please take a look at this pr: @Abacn

@github-actions
Copy link
Copy Markdown
Contributor

Assigning new set of reviewers because Pr has gone too long without review. If you would like to opt out of this review, comment assign to next reviewer:

R: @robertwb for label java.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

@github-actions
Copy link
Copy Markdown
Contributor

Reminder, please take a look at this pr: @robertwb

@kennknowles
Copy link
Copy Markdown
Member

R: @reuvenlax

@github-actions
Copy link
Copy Markdown
Contributor

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment assign set of reviewers

@claudevdm
Copy link
Copy Markdown
Collaborator

Hi @tilgalas is this progress?

@liferoad
Copy link
Copy Markdown
Contributor

Close this for now.

@liferoad liferoad closed this Jun 27, 2025
@tilgalas
Copy link
Copy Markdown
Contributor Author

tilgalas commented Sep 2, 2025

I think there's a renewed interest in this PR, can we reopen it? I don't think I can do it (I can't see the reopen button anywhere) - cc @stankiewicz

@liferoad liferoad reopened this Sep 2, 2025
@tilgalas
Copy link
Copy Markdown
Contributor Author

tilgalas commented Sep 3, 2025

Run Java_GCP_IO_Direct PreCommit

@tilgalas
Copy link
Copy Markdown
Contributor Author

tilgalas commented Sep 3, 2025

Run Java_IOs_Direct PreCommit

@tilgalas
Copy link
Copy Markdown
Contributor Author

tilgalas commented Sep 3, 2025

Hi @reuvenlax, can you take a look again?

@Abacn
Copy link
Copy Markdown
Contributor

Abacn commented Sep 3, 2025

@kennknowles
Copy link
Copy Markdown
Member

friendly ping

@tilgalas
Copy link
Copy Markdown
Contributor Author

assign set of reviewers

@github-actions
Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @robertwb for label java.

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 2, 2025

Assigning new set of reviewers because Pr has gone too long without review. If you would like to opt out of this review, comment assign to next reviewer:

R: @chamikaramj for label java.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 9, 2025

Reminder, please take a look at this pr: @chamikaramj

@github-actions
Copy link
Copy Markdown
Contributor

Assigning new set of reviewers because Pr has gone too long without review. If you would like to opt out of this review, comment assign to next reviewer:

R: @robertwb for label java.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

@Abacn Abacn merged commit 08b4800 into apache:master Oct 13, 2025
21 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants