kennknowles commented on code in PR #30560:
URL: https://github.com/apache/beam/pull/30560#discussion_r1518299124
##########
sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/transforms/TypedSchemaTransformProvider.java:
##########
@@ -39,7 +42,16 @@
@Internal
public abstract class TypedSchemaTransformProvider<ConfigT> implements
SchemaTransformProvider {
- protected abstract Class<ConfigT> configurationClass();
+ @SuppressWarnings("unchecked")
+ protected Class<ConfigT> configurationClass() {
+ Optional<ParameterizedType> parameterizedType =
Review Comment:
Since you just put it in an `Optional` and then take it out again, might be
simpler to go ahead like
```java
@Nullable ParameterizedType parameterizedType = (ParameterizedType)
getClass().getGenericSuperclass();
checkStateNotNull(superClass, "Could not ...");
return (Class<ConfigT>) parameterizedType.getActualTypeArguments[0];
```
FWIW I am not sure if `getActualTypeArguments[0]` could still be a type
variable in some cases. You might want to check that it is a usefully defined
type in some more ways... but also this is probably just always going to work,
because of how these things are authored. Very nice!
##########
sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/transforms/SchemaTransformProvider.java:
##########
@@ -58,10 +59,14 @@ default String description() {
SchemaTransform from(Row configuration);
/** Returns the input collection names of this transform. */
- List<String> inputCollectionNames();
+ default List<String> inputCollectionNames() {
Review Comment:
intellij thinks these methods are unused - is intellij wrong? or could they
be removed?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]