Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-7450

Bounded generic POJO field is identified as Object by TypeExtractor

    XMLWordPrintableJSON

Details

    Description

      The TypeExtractor does not correctly handle POJO fields with bounded generics.

      For example:

      public class Foo<SomeKey extends BarKey> implements Serializable {
      
          public SomeKey someKey;
      
          public Foo() {}
      
          public Foo(SomeKey someKey) {
              this.someKey = someKey;
          }
      }
      

      Is identified as:

      PojoType<org.apache.flink.streaming.examples.wordcount.WordCount$Foo, fields = [someKey: GenericType<java.lang.Object>]>
      

      So even though the reflection field has a type, the type information only describes a Object class.

      Attachments

        Activity

          People

            Unassigned Unassigned
            twalthr Timo Walther
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: