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

    https://github.com/apache/incubator-flink/pull/203#discussion_r21818932
  
    --- Diff: flink-java/src/main/java/org/apache/flink/api/java/DataSet.java 
---
    @@ -98,14 +99,18 @@ protected DataSet(ExecutionEnvironment context, 
TypeInformation<T> type) {
                        throw new NullPointerException("context is null");
                }
     
    -           if (type == null) {
    -                   throw new NullPointerException("type is null");
    -           }
    -           
                this.context = context;
                this.type = type;
        }
     
    +   protected void setType(TypeInformation<T> type) {
    --- End diff --
    
    Okay, that makes sense.
    
    How about we add a flag to make sure that the `fillInTypeInfo()` cannot be 
called after the `getType()` method was called? That way we make sure that we 
do not make things inconsistent (by returning some type info at some point, and 
another one later). This should not happen anyways, but I would feel much 
better with this sanity check in place - after all, this can cause very hard to 
debug issues, if used inconsistently.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to