Github user StephanEwen commented on a diff in the pull request:

    https://github.com/apache/flink/pull/582#discussion_r28691764
  
    --- Diff: 
flink-java/src/main/java/org/apache/flink/api/java/typeutils/ObjectArrayTypeInfo.java
 ---
    @@ -143,6 +143,18 @@ else if (type instanceof Class<?> && ((Class<?>) 
type).isArray()
                throw new InvalidTypesException("The given type is not a valid 
object array.");
        }
     
    +   /**
    +    * Creates a new {@link 
org.apache.flink.api.java.typeutils.ObjectArrayTypeInfo} from a
    +    * {@link TypeInformation} for the component type.
    +    *
    +    * <p>
    +    * This must be used in cases where the complete type of the array is 
not available as a
    +    * {@link java.lang.reflect.Type} or {@link java.lang.Class}.
    +    */
    +   public static <T, C> ObjectArrayTypeInfo<T, C> 
getInfoFor(TypeInformation<C> componentInfo) {
    +           return new ObjectArrayTypeInfo<T, C>(Object[].class, 
componentInfo.getTypeClass(), componentInfo);
    --- End diff --
    
    Is `Object[].class` actually correct? Why not give the class of the real 
array type? There are a few ways to get that, for example 
`Array.newInstance(clazz, 0).getClass();`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to