You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "tilgalas (via GitHub)" <gi...@apache.org> on 2024/10/30 19:00:30 UTC
[PR] add generics support to AutoValueUtils helpers [beam]
tilgalas opened a new pull request, #32977:
URL: https://github.com/apache/beam/pull/32977
This is a 3rd PR in the series of PRs (based on the now closed https://github.com/apache/beam/pull/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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-2801514518
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)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-2818757430
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`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-2733006566
Reminder, please take a look at this pr: @robertwb
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "reuvenlax (via GitHub)" <gi...@apache.org>.
reuvenlax commented on code in PR #32977:
URL: https://github.com/apache/beam/pull/32977#discussion_r1823336789
##########
sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/utils/AutoValueUtils.java:
##########
@@ -70,45 +72,55 @@
/** Utilities for managing AutoValue schemas. */
@SuppressWarnings({"rawtypes"})
public class AutoValueUtils {
+ @SuppressWarnings("unchecked")
public static @Nullable TypeDescriptor<?> getBaseAutoValueClass(
TypeDescriptor<?> typeDescriptor) {
// AutoValue extensions may be nested
@Nullable TypeDescriptor<?> baseTypeDescriptor = typeDescriptor;
while (baseTypeDescriptor != null
&& baseTypeDescriptor.getRawType().getName().contains("AutoValue_")) {
+ TypeDescriptor<?> finalBaseTypeDescriptor = baseTypeDescriptor;
baseTypeDescriptor =
Optional.ofNullable(baseTypeDescriptor.getRawType().getSuperclass())
- .map(TypeDescriptor::of)
+ .map(superClass -> finalBaseTypeDescriptor.getSupertype((Class) superClass))
.orElse(null);
}
return baseTypeDescriptor;
}
- private static TypeDescriptor<?> getAutoValueGenerated(TypeDescriptor<?> typeDescriptor) {
+ @SuppressWarnings("unchecked")
+ public static TypeDescriptor<?> getAutoValueGenerated(TypeDescriptor<?> typeDescriptor) {
String generatedClassName = getAutoValueGeneratedName(typeDescriptor.getRawType().getName());
try {
- return TypeDescriptor.of(Class.forName(generatedClassName));
+ return typeDescriptor.getSubtype((Class) Class.forName(generatedClassName));
} catch (ClassNotFoundException e) {
throw new IllegalStateException("AutoValue generated class not found: " + generatedClassName);
}
}
- private static @Nullable Class getAutoValueGeneratedBuilder(Class<?> clazz) {
- Class generated;
- try {
- generated = Class.forName(getAutoValueGeneratedName(clazz.getName()));
- } catch (ClassNotFoundException e) {
- return null;
- }
- // Find the first generated class
- Class base = generated;
- while (base != null && base.getName().contains("AutoValue_")) {
- generated = base;
- base = base.getSuperclass();
- }
- String builderName = generated.getName() + "$Builder";
+ public static @Nullable TypeDescriptor<?> getAutoValueGeneratedBuilder(
+ TypeDescriptor<?> typeDescriptor) {
Review Comment:
is there a reason you remoevd the code that walks up the class hierarchy here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-2599692987
Reminder, please take a look at this pr: @robertwb
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-2713957869
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)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-2662943629
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)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-3397281771
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)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "reuvenlax (via GitHub)" <gi...@apache.org>.
reuvenlax commented on code in PR #32977:
URL: https://github.com/apache/beam/pull/32977#discussion_r1834933970
##########
sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/utils/AutoValueUtils.java:
##########
@@ -70,45 +72,71 @@
/** Utilities for managing AutoValue schemas. */
@SuppressWarnings({"rawtypes"})
public class AutoValueUtils {
+
+ private static final String AUTO_VALUE_GENERATED_PREFIX = "AutoValue_";
+
+ /**
+ * Walk the class hierarchy upwards and find the topmost {@link TypeDescriptor} whose super class
+ * is not generated (whose class name doesn't contain the {@code AutoValue_} prefix).
+ */
+ private static TypeDescriptor<?> findFirstGeneratedAutoValue(TypeDescriptor<?> typeDescriptor) {
+ Class<?> rawType = typeDescriptor.getRawType();
+ for (Class superClass = rawType.getSuperclass();
+ superClass != null && superClass.getName().contains(AUTO_VALUE_GENERATED_PREFIX);
+ superClass = superClass.getSuperclass()) {
+ rawType = superClass;
+ }
+ return typeDescriptor.getSupertype((Class) rawType);
+ }
+
+ @SuppressWarnings("unchecked")
public static @Nullable TypeDescriptor<?> getBaseAutoValueClass(
TypeDescriptor<?> typeDescriptor) {
- // AutoValue extensions may be nested
- @Nullable TypeDescriptor<?> baseTypeDescriptor = typeDescriptor;
- while (baseTypeDescriptor != null
- && baseTypeDescriptor.getRawType().getName().contains("AutoValue_")) {
- baseTypeDescriptor =
- Optional.ofNullable(baseTypeDescriptor.getRawType().getSuperclass())
- .map(TypeDescriptor::of)
- .orElse(null);
+ if (!typeDescriptor.getRawType().getName().contains(AUTO_VALUE_GENERATED_PREFIX)) {
+ // fast path for types which aren't autogenerated
+ return typeDescriptor;
}
- return baseTypeDescriptor;
+ // AutoValue extensions may be nested
+ TypeDescriptor<?> firstGeneratedTypeDescriptor = findFirstGeneratedAutoValue(typeDescriptor);
+ return Optional.ofNullable(firstGeneratedTypeDescriptor.getRawType().getSuperclass())
+ .map(superClass -> firstGeneratedTypeDescriptor.getSupertype((Class) superClass))
Review Comment:
why are we calling getSuperclass here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-2789501168
Reminder, please take a look at this pr: @Abacn
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-2818297965
Reminder, please take a look at this pr: @robertwb
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-3250237374
related to #34672 (acutally this PR is the one referred in Beam 3 milestone doc https://s.apache.org/beam3-milestones: https://docs.google.com/document/d/1KfTMok67-bZBUcCCYeHkdktyQZ6arWQJEPMc-4hUrX0/edit?disco=AAABhaO_SVw)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "tilgalas (via GitHub)" <gi...@apache.org>.
tilgalas commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-3249028859
Hi @reuvenlax, can you take a look again?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-2565824576
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).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-2633729452
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)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-2653543336
Reminder, please take a look at this pr: @Abacn
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-2769165590
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)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn merged PR #32977:
URL: https://github.com/apache/beam/pull/32977
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-2582574269
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)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-2761192888
Reminder, please take a look at this pr: @kennknowles
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "tilgalas (via GitHub)" <gi...@apache.org>.
tilgalas commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-3244850427
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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "tilgalas (via GitHub)" <gi...@apache.org>.
tilgalas commented on code in PR #32977:
URL: https://github.com/apache/beam/pull/32977#discussion_r2318772789
##########
sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/utils/AutoValueUtils.java:
##########
@@ -70,45 +72,71 @@
/** Utilities for managing AutoValue schemas. */
@SuppressWarnings({"rawtypes"})
public class AutoValueUtils {
+
+ private static final String AUTO_VALUE_GENERATED_PREFIX = "AutoValue_";
+
+ /**
+ * Walk the class hierarchy upwards and find the topmost {@link TypeDescriptor} whose super class
+ * is not generated (whose class name doesn't contain the {@code AutoValue_} prefix).
+ */
+ private static TypeDescriptor<?> findFirstGeneratedAutoValue(TypeDescriptor<?> typeDescriptor) {
+ Class<?> rawType = typeDescriptor.getRawType();
+ for (Class superClass = rawType.getSuperclass();
+ superClass != null && superClass.getName().contains(AUTO_VALUE_GENERATED_PREFIX);
+ superClass = superClass.getSuperclass()) {
+ rawType = superClass;
+ }
+ return typeDescriptor.getSupertype((Class) rawType);
+ }
+
+ @SuppressWarnings("unchecked")
public static @Nullable TypeDescriptor<?> getBaseAutoValueClass(
TypeDescriptor<?> typeDescriptor) {
- // AutoValue extensions may be nested
- @Nullable TypeDescriptor<?> baseTypeDescriptor = typeDescriptor;
- while (baseTypeDescriptor != null
- && baseTypeDescriptor.getRawType().getName().contains("AutoValue_")) {
- baseTypeDescriptor =
- Optional.ofNullable(baseTypeDescriptor.getRawType().getSuperclass())
- .map(TypeDescriptor::of)
- .orElse(null);
+ if (!typeDescriptor.getRawType().getName().contains(AUTO_VALUE_GENERATED_PREFIX)) {
+ // fast path for types which aren't autogenerated
+ return typeDescriptor;
}
- return baseTypeDescriptor;
+ // AutoValue extensions may be nested
+ TypeDescriptor<?> firstGeneratedTypeDescriptor = findFirstGeneratedAutoValue(typeDescriptor);
+ return Optional.ofNullable(firstGeneratedTypeDescriptor.getRawType().getSuperclass())
+ .map(superClass -> firstGeneratedTypeDescriptor.getSupertype((Class) superClass))
Review Comment:
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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "kennknowles (via GitHub)" <gi...@apache.org>.
kennknowles commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-3324605320
friendly ping
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "tilgalas (via GitHub)" <gi...@apache.org>.
tilgalas commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-3248951749
Run Java_IOs_Direct PreCommit
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "tilgalas (via GitHub)" <gi...@apache.org>.
tilgalas commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-2455164334
Run Java_IOs_Direct PreCommit
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-2624344092
Reminder, please take a look at this pr: @damondouglas
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-2687786840
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)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "kennknowles (via GitHub)" <gi...@apache.org>.
kennknowles commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-2818754809
R: @reuvenlax
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-2678245028
Reminder, please take a look at this pr: @kennknowles
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "tilgalas (via GitHub)" <gi...@apache.org>.
tilgalas commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-3351259208
assign set of reviewers
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-2575135521
Reminder, please take a look at this pr: @m-trieu
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-2607091233
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)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "tilgalas (via GitHub)" <gi...@apache.org>.
tilgalas commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-2455164733
Run Java PreCommit
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-2706302624
Reminder, please take a look at this pr: @damondouglas
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-2448323054
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment `assign set of reviewers`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "claudevdm (via GitHub)" <gi...@apache.org>.
claudevdm commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-2981055144
Hi @tilgalas is this progress?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-2743197613
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)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "tilgalas (via GitHub)" <gi...@apache.org>.
tilgalas commented on code in PR #32977:
URL: https://github.com/apache/beam/pull/32977#discussion_r1827650827
##########
sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/utils/AutoValueUtils.java:
##########
@@ -70,45 +72,55 @@
/** Utilities for managing AutoValue schemas. */
@SuppressWarnings({"rawtypes"})
public class AutoValueUtils {
+ @SuppressWarnings("unchecked")
public static @Nullable TypeDescriptor<?> getBaseAutoValueClass(
TypeDescriptor<?> typeDescriptor) {
// AutoValue extensions may be nested
@Nullable TypeDescriptor<?> baseTypeDescriptor = typeDescriptor;
while (baseTypeDescriptor != null
&& baseTypeDescriptor.getRawType().getName().contains("AutoValue_")) {
+ TypeDescriptor<?> finalBaseTypeDescriptor = baseTypeDescriptor;
baseTypeDescriptor =
Optional.ofNullable(baseTypeDescriptor.getRawType().getSuperclass())
- .map(TypeDescriptor::of)
+ .map(superClass -> finalBaseTypeDescriptor.getSupertype((Class) superClass))
.orElse(null);
}
return baseTypeDescriptor;
}
- private static TypeDescriptor<?> getAutoValueGenerated(TypeDescriptor<?> typeDescriptor) {
+ @SuppressWarnings("unchecked")
+ public static TypeDescriptor<?> getAutoValueGenerated(TypeDescriptor<?> typeDescriptor) {
String generatedClassName = getAutoValueGeneratedName(typeDescriptor.getRawType().getName());
try {
- return TypeDescriptor.of(Class.forName(generatedClassName));
+ return typeDescriptor.getSubtype((Class) Class.forName(generatedClassName));
} catch (ClassNotFoundException e) {
throw new IllegalStateException("AutoValue generated class not found: " + generatedClassName);
}
}
- private static @Nullable Class getAutoValueGeneratedBuilder(Class<?> clazz) {
- Class generated;
- try {
- generated = Class.forName(getAutoValueGeneratedName(clazz.getName()));
- } catch (ClassNotFoundException e) {
- return null;
- }
- // Find the first generated class
- Class base = generated;
- while (base != null && base.getName().contains("AutoValue_")) {
- generated = base;
- base = base.getSuperclass();
- }
- String builderName = generated.getName() + "$Builder";
+ public static @Nullable TypeDescriptor<?> getAutoValueGeneratedBuilder(
+ TypeDescriptor<?> typeDescriptor) {
Review Comment:
oh, probably did it by mistake, I'll bring it back
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-3385598158
Reminder, please take a look at this pr: @chamikaramj
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-3351266649
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).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-3360917460
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)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] add generics support to AutoValueUtils helpers [beam]
Posted by "tilgalas (via GitHub)" <gi...@apache.org>.
tilgalas commented on PR #32977:
URL: https://github.com/apache/beam/pull/32977#issuecomment-3248549685
Run Java_GCP_IO_Direct PreCommit
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org