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

    https://github.com/apache/flink/pull/5097#discussion_r156090203
  
    --- Diff: 
flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java 
---
    @@ -1822,13 +1828,15 @@ private static Type 
materializeTypeVariable(ArrayList<Type> typeHierarchy, TypeV
         * OR
         *  - there are getter and setter methods for the field.
         *
    +    * Returns a message why the given field is not valid. Otherwise an 
empty option for valid fields.
    +    *
         * @param f field to check
         * @param clazz class of field
         * @param typeHierarchy type hierarchy for materializing generic types
         */
    -   private boolean isValidPojoField(Field f, Class<?> clazz, 
ArrayList<Type> typeHierarchy) {
    -           if(Modifier.isPublic(f.getModifiers())) {
    -                   return true;
    +   private static Optional<String> analyzePojoField(Field f, Class<?> 
clazz, ArrayList<Type> typeHierarchy) {
    --- End diff --
    
    Shouldn't this be an `Either` to be in line with other methods in this 
class. An Optional that actually contains something in case of failure seems a 
bit strange.


---

Reply via email to