Skip to content

add generics support to AutoValueUtils helpers - #32977

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

add generics support to AutoValueUtils helpers#32977
Abacn merged 2 commits into
apache: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

tilgalas commented Nov 4, 2024

Copy link
Copy Markdown
Contributor Author

Run Java_IOs_Direct PreCommit

@tilgalas

tilgalas commented Nov 4, 2024

Copy link
Copy Markdown
Contributor Author

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

github-actions Bot commented Jan 7, 2025

Copy link
Copy Markdown
Contributor

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

github-actions Bot commented Feb 4, 2025

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: @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

github-actions Bot commented Apr 9, 2025

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: @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

tilgalas commented Sep 2, 2025

Copy link
Copy Markdown
Contributor Author

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

tilgalas commented Sep 3, 2025

Copy link
Copy Markdown
Contributor Author

Run Java_GCP_IO_Direct PreCommit

@tilgalas

tilgalas commented Sep 3, 2025

Copy link
Copy Markdown
Contributor Author

Run Java_IOs_Direct PreCommit

@tilgalas

tilgalas commented Sep 3, 2025

Copy link
Copy Markdown
Contributor Author

Hi @reuvenlax, can you take a look again?

@Abacn

Abacn commented Sep 3, 2025

Copy link
Copy Markdown
Contributor

@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

github-actions Bot commented Oct 2, 2025

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: @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

github-actions Bot commented Oct 9, 2025

Copy link
Copy Markdown
Contributor

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