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

Infinite recursion on TypeExtractor

    XMLWordPrintableJSON

Details

    Description

      This program cause a StackOverflow (infinite recursion) in the TypeExtractor:

      TypeSerializerStackOverflowOnRecursivePojo.java
      public class TypeSerializerStackOverflowOnRecursivePojo {
      
      	public static class RecursivePojo<K,V> implements Serializable {
      
      		private static final long serialVersionUID = 1L;
      		
      		private RecursivePojo<K,V> parent;
      
      		public RecursivePojo(){}
      		public RecursivePojo(K k, V v) {
      		}
      		public RecursivePojo<K, V> getParent() {
      			return parent;
      		}
      		public void setParent(RecursivePojo<K, V> parent) {
      			this.parent = parent;
      		}
      	    
      	}
      	public static class TypedTuple extends Tuple3<String,String, RecursivePojo<String, Map<String, Set<String>>>>{
      
      		private static final long serialVersionUID = 1L;
      
      	}
      	
      	public static void main(String[] args) throws Exception {
      		ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
      		env.fromCollection(Arrays.asList(new RecursivePojo<String, Map<String, Set<String>>>("test",new HashMap<String, Set<String>>())))
      		.map(t-> {TypedTuple ret = new TypedTuple();ret.setFields("1", "1", t);return ret;}).returns(TypedTuple.class)
      		.print();
      	}
      	
      }
      

      The thrown Exception is the following:

      Exception thrown
      Exception in thread "main" java.lang.StackOverflowError
      	at sun.reflect.generics.parser.SignatureParser.parsePackageNameAndSimpleClassTypeSignature(SignatureParser.java:328)
      	at sun.reflect.generics.parser.SignatureParser.parseClassTypeSignature(SignatureParser.java:310)
      	at sun.reflect.generics.parser.SignatureParser.parseFieldTypeSignature(SignatureParser.java:289)
      	at sun.reflect.generics.parser.SignatureParser.parseFieldTypeSignature(SignatureParser.java:283)
      	at sun.reflect.generics.parser.SignatureParser.parseTypeSignature(SignatureParser.java:485)
      	at sun.reflect.generics.parser.SignatureParser.parseReturnType(SignatureParser.java:627)
      	at sun.reflect.generics.parser.SignatureParser.parseMethodTypeSignature(SignatureParser.java:577)
      	at sun.reflect.generics.parser.SignatureParser.parseMethodSig(SignatureParser.java:171)
      	at sun.reflect.generics.repository.ConstructorRepository.parse(ConstructorRepository.java:55)
      	at sun.reflect.generics.repository.ConstructorRepository.parse(ConstructorRepository.java:43)
      	at sun.reflect.generics.repository.AbstractRepository.<init>(AbstractRepository.java:74)
      	at sun.reflect.generics.repository.GenericDeclRepository.<init>(GenericDeclRepository.java:49)
      	at sun.reflect.generics.repository.ConstructorRepository.<init>(ConstructorRepository.java:51)
      	at sun.reflect.generics.repository.MethodRepository.<init>(MethodRepository.java:46)
      	at sun.reflect.generics.repository.MethodRepository.make(MethodRepository.java:59)
      	at java.lang.reflect.Method.getGenericInfo(Method.java:102)
      	at java.lang.reflect.Method.getGenericReturnType(Method.java:255)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.isValidPojoField(TypeExtractor.java:1610)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.analyzePojo(TypeExtractor.java:1671)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.privateGetForClass(TypeExtractor.java:1559)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfoWithTypeHierarchy(TypeExtractor.java:732)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.analyzePojo(TypeExtractor.java:1678)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.privateGetForClass(TypeExtractor.java:1559)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfoWithTypeHierarchy(TypeExtractor.java:732)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.analyzePojo(TypeExtractor.java:1678)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.privateGetForClass(TypeExtractor.java:1559)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfoWithTypeHierarchy(TypeExtractor.java:732)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.analyzePojo(TypeExtractor.java:1678)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.privateGetForClass(TypeExtractor.java:1559)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfoWithTypeHierarchy(TypeExtractor.java:732)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.analyzePojo(TypeExtractor.java:1678)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.privateGetForClass(TypeExtractor.java:1559)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfoWithTypeHierarchy(TypeExtractor.java:732)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.analyzePojo(TypeExtractor.java:1678)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.privateGetForClass(TypeExtractor.java:1559)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfoWithTypeHierarchy(TypeExtractor.java:732)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.analyzePojo(TypeExtractor.java:1678)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.privateGetForClass(TypeExtractor.java:1559)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfoWithTypeHierarchy(TypeExtractor.java:732)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.analyzePojo(TypeExtractor.java:1678)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.privateGetForClass(TypeExtractor.java:1559)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfoWithTypeHierarchy(TypeExtractor.java:732)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.analyzePojo(TypeExtractor.java:1678)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.privateGetForClass(TypeExtractor.java:1559)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfoWithTypeHierarchy(TypeExtractor.java:732)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.analyzePojo(TypeExtractor.java:1678)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.privateGetForClass(TypeExtractor.java:1559)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfoWithTypeHierarchy(TypeExtractor.java:732)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.analyzePojo(TypeExtractor.java:1678)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.privateGetForClass(TypeExtractor.java:1559)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfoWithTypeHierarchy(TypeExtractor.java:732)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.analyzePojo(TypeExtractor.java:1678)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.privateGetForClass(TypeExtractor.java:1559)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfoWithTypeHierarchy(TypeExtractor.java:732)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.analyzePojo(TypeExtractor.java:1678)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.privateGetForClass(TypeExtractor.java:1559)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfoWithTypeHierarchy(TypeExtractor.java:732)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.analyzePojo(TypeExtractor.java:1678)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.privateGetForClass(TypeExtractor.java:1559)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfoWithTypeHierarchy(TypeExtractor.java:732)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.analyzePojo(TypeExtractor.java:1678)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.privateGetForClass(TypeExtractor.java:1559)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfoWithTypeHierarchy(TypeExtractor.java:732)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.analyzePojo(TypeExtractor.java:1678)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.privateGetForClass(TypeExtractor.java:1559)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfoWithTypeHierarchy(TypeExtractor.java:732)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.analyzePojo(TypeExtractor.java:1678)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.privateGetForClass(TypeExtractor.java:1559)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfoWithTypeHierarchy(TypeExtractor.java:732)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.analyzePojo(TypeExtractor.java:1678)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.privateGetForClass(TypeExtractor.java:1559)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.createTypeInfoWithTypeHierarchy(TypeExtractor.java:732)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.analyzePojo(TypeExtractor.java:1678)
      	at org.apache.flink.api.java.typeutils.TypeExtractor.privateGetForClass(TypeExtractor.java:1559)
      	...
      

      Attachments

        Issue Links

          Activity

            People

              twalthr Timo Walther
              f.pompermaier Flavio Pompermaier
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: