Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.2.0
    • Fix Version/s: 1.3.0
    • Component/s: Core
    • Labels:
      None

      Description

      I was able to resolve the requirement to specify an explicit TypeInformation in the pull request for FLINK-4624 by creating a TypeInfoFactory for the Either type.

        Issue Links

          Activity

          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user greghogan opened a pull request:

          https://github.com/apache/flink/pull/2545

          FLINK-4673 [core] TypeInfoFactory for Either type

          Removes from TypeExtractor the explicit parsing for Either and adds an EitherTypeInfoFactory.

          A test was removed that was expected to fail but now looks to succeed.

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/greghogan/flink 4673_typeinfofactory_for_either_type

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/flink/pull/2545.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #2545


          commit a7fe93d8cbe10eb1c327cc659202e10c34efead9
          Author: Greg Hogan <code@greghogan.com>
          Date: 2016-09-23T18:59:36Z

          FLINK-4673 [core] TypeInfoFactory for Either type

          Removes from TypeExtractor the explicit parsing for Either and adds an
          EitherTypeInfoFactory.


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user greghogan opened a pull request: https://github.com/apache/flink/pull/2545 FLINK-4673 [core] TypeInfoFactory for Either type Removes from TypeExtractor the explicit parsing for Either and adds an EitherTypeInfoFactory. A test was removed that was expected to fail but now looks to succeed. You can merge this pull request into a Git repository by running: $ git pull https://github.com/greghogan/flink 4673_typeinfofactory_for_either_type Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/2545.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #2545 commit a7fe93d8cbe10eb1c327cc659202e10c34efead9 Author: Greg Hogan <code@greghogan.com> Date: 2016-09-23T18:59:36Z FLINK-4673 [core] TypeInfoFactory for Either type Removes from TypeExtractor the explicit parsing for Either and adds an EitherTypeInfoFactory.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user twalthr commented on the issue:

          https://github.com/apache/flink/pull/2545

          I will review this PR soon.

          Show
          githubbot ASF GitHub Bot added a comment - Github user twalthr commented on the issue: https://github.com/apache/flink/pull/2545 I will review this PR soon.
          Hide
          githubbot ASF GitHub Bot added a comment -

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

          https://github.com/apache/flink/pull/2545#discussion_r80439161

          — Diff: flink-core/src/test/java/org/apache/flink/api/java/typeutils/TypeExtractorTest.java —
          @@ -1857,12 +1856,6 @@ public void testEitherHierarchy()

          { Assert.assertEquals(expected, ti); }
          • @Test(expected=InvalidTypesException.class)
          • public void testEitherFromObjectException() {
          • Either<String, Tuple1<Integer>> either = Either.Left("test");
          • TypeExtractor.getForObject(either);
              • End diff –

          This test is necessary. The exception is not thrown anymore but the type information that is currently generated is invalid (the right type information is `null`, which should never happen).

          Show
          githubbot ASF GitHub Bot added a comment - Github user twalthr commented on a diff in the pull request: https://github.com/apache/flink/pull/2545#discussion_r80439161 — Diff: flink-core/src/test/java/org/apache/flink/api/java/typeutils/TypeExtractorTest.java — @@ -1857,12 +1856,6 @@ public void testEitherHierarchy() { Assert.assertEquals(expected, ti); } @Test(expected=InvalidTypesException.class) public void testEitherFromObjectException() { Either<String, Tuple1<Integer>> either = Either.Left("test"); TypeExtractor.getForObject(either); End diff – This test is necessary. The exception is not thrown anymore but the type information that is currently generated is invalid (the right type information is `null`, which should never happen).
          Hide
          githubbot ASF GitHub Bot added a comment -

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

          https://github.com/apache/flink/pull/2545#discussion_r80424649

          — Diff: flink-core/src/main/java/org/apache/flink/api/java/typeutils/EitherTypeInfoFactory.java —
          @@ -0,0 +1,34 @@
          +/*
          + * Licensed to the Apache Software Foundation (ASF) under one
          + * or more contributor license agreements. See the NOTICE file
          + * distributed with this work for additional information
          + * regarding copyright ownership. The ASF licenses this file
          + * to you under the Apache License, Version 2.0 (the
          + * "License"); you may not use this file except in compliance
          + * with the License. You may obtain a copy of the License at
          + *
          + * http://www.apache.org/licenses/LICENSE-2.0
          + *
          + * Unless required by applicable law or agreed to in writing, software
          + * distributed under the License is distributed on an "AS IS" BASIS,
          + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
          + * See the License for the specific language governing permissions and
          + * limitations under the License.
          + */
          +
          +package org.apache.flink.api.java.typeutils;
          +
          +import org.apache.flink.api.common.typeinfo.TypeInfoFactory;
          +import org.apache.flink.api.common.typeinfo.TypeInformation;
          +import org.apache.flink.types.Either;
          +
          +import java.lang.reflect.Type;
          +import java.util.Map;
          +
          +public class EitherTypeInfoFactory<L, R> extends TypeInfoFactory<Either<L, R>> {
          +
          + @Override
          + public TypeInformation<Either<L, R>> createTypeInfo(Type t, Map<String, TypeInformation<?>> genericParameters) {
          + return new EitherTypeInfo(genericParameters.get("L"), genericParameters.get("R"));
          — End diff –

          Can check here if the key is not null? Btw. we should add a null check to the constructor of EitherTypeInfo.

          Show
          githubbot ASF GitHub Bot added a comment - Github user twalthr commented on a diff in the pull request: https://github.com/apache/flink/pull/2545#discussion_r80424649 — Diff: flink-core/src/main/java/org/apache/flink/api/java/typeutils/EitherTypeInfoFactory.java — @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.api.java.typeutils; + +import org.apache.flink.api.common.typeinfo.TypeInfoFactory; +import org.apache.flink.api.common.typeinfo.TypeInformation; +import org.apache.flink.types.Either; + +import java.lang.reflect.Type; +import java.util.Map; + +public class EitherTypeInfoFactory<L, R> extends TypeInfoFactory<Either<L, R>> { + + @Override + public TypeInformation<Either<L, R>> createTypeInfo(Type t, Map<String, TypeInformation<?>> genericParameters) { + return new EitherTypeInfo(genericParameters.get("L"), genericParameters.get("R")); — End diff – Can check here if the key is not null? Btw. we should add a null check to the constructor of EitherTypeInfo.
          Hide
          githubbot ASF GitHub Bot added a comment -

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

          https://github.com/apache/flink/pull/2545#discussion_r80437853

          — Diff: flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java —
          @@ -675,38 +673,6 @@ else if (isClassType(t) && Tuple.class.isAssignableFrom(typeToClass(t)))

          { return new TupleTypeInfo(typeToClass(t), subTypesInfo); }
          • // check if type is a subclass of Either
          • else if (isClassType(t) && Either.class.isAssignableFrom(typeToClass(t))) {
          • Type curT = t;
            -
          • // go up the hierarchy until we reach Either (with or without generics)
          • // collect the types while moving up for a later top-down
          • while (!(isClassType(curT) && typeToClass(curT).equals(Either.class))) { - typeHierarchy.add(curT); - curT = typeToClass(curT).getGenericSuperclass(); - }

            -

          • // check if Either has generics
          • if (curT instanceof Class<?>) { - throw new InvalidTypesException("Either needs to be parameterized by using generics."); - }

            -

          • typeHierarchy.add(curT);
            -
          • // create the type information for the subtypes
          • final TypeInformation<?>[] subTypesInfo = createSubTypesInfo(t, (ParameterizedType) curT, typeHierarchy, in1Type, in2Type, false);
          • // type needs to be treated a pojo due to additional fields
          • if (subTypesInfo == null) {
          • if (t instanceof ParameterizedType) {
          • return (TypeInformation<OUT>) analyzePojo(typeToClass(t), new ArrayList<Type>(typeHierarchy), (ParameterizedType) t, in1Type, in2Type);
              • End diff –

          What happens if Either class is extended? The whole checking is missing when using a factory. It need to go into the `createTypeInfo` method. What I just recognized, actually the `EitherTypeInfo` needs a second constructor that takes the subclass similar to `TupleTypeInfo`. The `t` parameter of `createTypeInfo` can than passed to this constructor.

          Show
          githubbot ASF GitHub Bot added a comment - Github user twalthr commented on a diff in the pull request: https://github.com/apache/flink/pull/2545#discussion_r80437853 — Diff: flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java — @@ -675,38 +673,6 @@ else if (isClassType(t) && Tuple.class.isAssignableFrom(typeToClass(t))) { return new TupleTypeInfo(typeToClass(t), subTypesInfo); } // check if type is a subclass of Either else if (isClassType(t) && Either.class.isAssignableFrom(typeToClass(t))) { Type curT = t; - // go up the hierarchy until we reach Either (with or without generics) // collect the types while moving up for a later top-down while (!(isClassType(curT) && typeToClass(curT).equals(Either.class))) { - typeHierarchy.add(curT); - curT = typeToClass(curT).getGenericSuperclass(); - } - // check if Either has generics if (curT instanceof Class<?>) { - throw new InvalidTypesException("Either needs to be parameterized by using generics."); - } - typeHierarchy.add(curT); - // create the type information for the subtypes final TypeInformation<?>[] subTypesInfo = createSubTypesInfo(t, (ParameterizedType) curT, typeHierarchy, in1Type, in2Type, false); // type needs to be treated a pojo due to additional fields if (subTypesInfo == null) { if (t instanceof ParameterizedType) { return (TypeInformation<OUT>) analyzePojo(typeToClass(t), new ArrayList<Type>(typeHierarchy), (ParameterizedType) t, in1Type, in2Type); End diff – What happens if Either class is extended? The whole checking is missing when using a factory. It need to go into the `createTypeInfo` method. What I just recognized, actually the `EitherTypeInfo` needs a second constructor that takes the subclass similar to `TupleTypeInfo`. The `t` parameter of `createTypeInfo` can than passed to this constructor.
          Hide
          githubbot ASF GitHub Bot added a comment -

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

          https://github.com/apache/flink/pull/2545#discussion_r81987517

          — Diff: flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java —
          @@ -675,38 +673,6 @@ else if (isClassType(t) && Tuple.class.isAssignableFrom(typeToClass(t)))

          { return new TupleTypeInfo(typeToClass(t), subTypesInfo); }
          • // check if type is a subclass of Either
          • else if (isClassType(t) && Either.class.isAssignableFrom(typeToClass(t))) {
          • Type curT = t;
            -
          • // go up the hierarchy until we reach Either (with or without generics)
          • // collect the types while moving up for a later top-down
          • while (!(isClassType(curT) && typeToClass(curT).equals(Either.class))) { - typeHierarchy.add(curT); - curT = typeToClass(curT).getGenericSuperclass(); - }

            -

          • // check if Either has generics
          • if (curT instanceof Class<?>) { - throw new InvalidTypesException("Either needs to be parameterized by using generics."); - }

            -

          • typeHierarchy.add(curT);
            -
          • // create the type information for the subtypes
          • final TypeInformation<?>[] subTypesInfo = createSubTypesInfo(t, (ParameterizedType) curT, typeHierarchy, in1Type, in2Type, false);
          • // type needs to be treated a pojo due to additional fields
          • if (subTypesInfo == null) {
          • if (t instanceof ParameterizedType) {
          • return (TypeInformation<OUT>) analyzePojo(typeToClass(t), new ArrayList<Type>(typeHierarchy), (ParameterizedType) t, in1Type, in2Type);
              • End diff –

          `Either` is overridden in `TypeExtractorTest` without any test errors. Could you give an example that would break the current PR?

          Show
          githubbot ASF GitHub Bot added a comment - Github user greghogan commented on a diff in the pull request: https://github.com/apache/flink/pull/2545#discussion_r81987517 — Diff: flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java — @@ -675,38 +673,6 @@ else if (isClassType(t) && Tuple.class.isAssignableFrom(typeToClass(t))) { return new TupleTypeInfo(typeToClass(t), subTypesInfo); } // check if type is a subclass of Either else if (isClassType(t) && Either.class.isAssignableFrom(typeToClass(t))) { Type curT = t; - // go up the hierarchy until we reach Either (with or without generics) // collect the types while moving up for a later top-down while (!(isClassType(curT) && typeToClass(curT).equals(Either.class))) { - typeHierarchy.add(curT); - curT = typeToClass(curT).getGenericSuperclass(); - } - // check if Either has generics if (curT instanceof Class<?>) { - throw new InvalidTypesException("Either needs to be parameterized by using generics."); - } - typeHierarchy.add(curT); - // create the type information for the subtypes final TypeInformation<?>[] subTypesInfo = createSubTypesInfo(t, (ParameterizedType) curT, typeHierarchy, in1Type, in2Type, false); // type needs to be treated a pojo due to additional fields if (subTypesInfo == null) { if (t instanceof ParameterizedType) { return (TypeInformation<OUT>) analyzePojo(typeToClass(t), new ArrayList<Type>(typeHierarchy), (ParameterizedType) t, in1Type, in2Type); End diff – `Either` is overridden in `TypeExtractorTest` without any test errors. Could you give an example that would break the current PR?
          Hide
          githubbot ASF GitHub Bot added a comment -

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

          https://github.com/apache/flink/pull/2545#discussion_r82598976

          — Diff: flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java —
          @@ -675,38 +673,6 @@ else if (isClassType(t) && Tuple.class.isAssignableFrom(typeToClass(t)))

          { return new TupleTypeInfo(typeToClass(t), subTypesInfo); }
          • // check if type is a subclass of Either
          • else if (isClassType(t) && Either.class.isAssignableFrom(typeToClass(t))) {
          • Type curT = t;
            -
          • // go up the hierarchy until we reach Either (with or without generics)
          • // collect the types while moving up for a later top-down
          • while (!(isClassType(curT) && typeToClass(curT).equals(Either.class))) { - typeHierarchy.add(curT); - curT = typeToClass(curT).getGenericSuperclass(); - }

            -

          • // check if Either has generics
          • if (curT instanceof Class<?>) { - throw new InvalidTypesException("Either needs to be parameterized by using generics."); - }

            -

          • typeHierarchy.add(curT);
            -
          • // create the type information for the subtypes
          • final TypeInformation<?>[] subTypesInfo = createSubTypesInfo(t, (ParameterizedType) curT, typeHierarchy, in1Type, in2Type, false);
          • // type needs to be treated a pojo due to additional fields
          • if (subTypesInfo == null) {
          • if (t instanceof ParameterizedType) {
          • return (TypeInformation<OUT>) analyzePojo(typeToClass(t), new ArrayList<Type>(typeHierarchy), (ParameterizedType) t, in1Type, in2Type);
              • End diff –

          Sorry, for the delay. I will have a look at it again.

          Show
          githubbot ASF GitHub Bot added a comment - Github user twalthr commented on a diff in the pull request: https://github.com/apache/flink/pull/2545#discussion_r82598976 — Diff: flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java — @@ -675,38 +673,6 @@ else if (isClassType(t) && Tuple.class.isAssignableFrom(typeToClass(t))) { return new TupleTypeInfo(typeToClass(t), subTypesInfo); } // check if type is a subclass of Either else if (isClassType(t) && Either.class.isAssignableFrom(typeToClass(t))) { Type curT = t; - // go up the hierarchy until we reach Either (with or without generics) // collect the types while moving up for a later top-down while (!(isClassType(curT) && typeToClass(curT).equals(Either.class))) { - typeHierarchy.add(curT); - curT = typeToClass(curT).getGenericSuperclass(); - } - // check if Either has generics if (curT instanceof Class<?>) { - throw new InvalidTypesException("Either needs to be parameterized by using generics."); - } - typeHierarchy.add(curT); - // create the type information for the subtypes final TypeInformation<?>[] subTypesInfo = createSubTypesInfo(t, (ParameterizedType) curT, typeHierarchy, in1Type, in2Type, false); // type needs to be treated a pojo due to additional fields if (subTypesInfo == null) { if (t instanceof ParameterizedType) { return (TypeInformation<OUT>) analyzePojo(typeToClass(t), new ArrayList<Type>(typeHierarchy), (ParameterizedType) t, in1Type, in2Type); End diff – Sorry, for the delay. I will have a look at it again.
          Hide
          githubbot ASF GitHub Bot added a comment -

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

          https://github.com/apache/flink/pull/2545#discussion_r95365908

          — Diff: flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java —
          @@ -675,38 +673,6 @@ else if (isClassType(t) && Tuple.class.isAssignableFrom(typeToClass(t)))

          { return new TupleTypeInfo(typeToClass(t), subTypesInfo); }
          • // check if type is a subclass of Either
          • else if (isClassType(t) && Either.class.isAssignableFrom(typeToClass(t))) {
          • Type curT = t;
            -
          • // go up the hierarchy until we reach Either (with or without generics)
          • // collect the types while moving up for a later top-down
          • while (!(isClassType(curT) && typeToClass(curT).equals(Either.class))) { - typeHierarchy.add(curT); - curT = typeToClass(curT).getGenericSuperclass(); - }

            -

          • // check if Either has generics
          • if (curT instanceof Class<?>) { - throw new InvalidTypesException("Either needs to be parameterized by using generics."); - }

            -

          • typeHierarchy.add(curT);
            -
          • // create the type information for the subtypes
          • final TypeInformation<?>[] subTypesInfo = createSubTypesInfo(t, (ParameterizedType) curT, typeHierarchy, in1Type, in2Type, false);
          • // type needs to be treated a pojo due to additional fields
          • if (subTypesInfo == null) {
          • if (t instanceof ParameterizedType) {
          • return (TypeInformation<OUT>) analyzePojo(typeToClass(t), new ArrayList<Type>(typeHierarchy), (ParameterizedType) t, in1Type, in2Type);
              • End diff –

          Sorry for not writing back earlier. You are right, all tests still work. The factories work better than I expected. We lose the input validation in this PR but I think this is ok. I will merge this.

          Show
          githubbot ASF GitHub Bot added a comment - Github user twalthr commented on a diff in the pull request: https://github.com/apache/flink/pull/2545#discussion_r95365908 — Diff: flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java — @@ -675,38 +673,6 @@ else if (isClassType(t) && Tuple.class.isAssignableFrom(typeToClass(t))) { return new TupleTypeInfo(typeToClass(t), subTypesInfo); } // check if type is a subclass of Either else if (isClassType(t) && Either.class.isAssignableFrom(typeToClass(t))) { Type curT = t; - // go up the hierarchy until we reach Either (with or without generics) // collect the types while moving up for a later top-down while (!(isClassType(curT) && typeToClass(curT).equals(Either.class))) { - typeHierarchy.add(curT); - curT = typeToClass(curT).getGenericSuperclass(); - } - // check if Either has generics if (curT instanceof Class<?>) { - throw new InvalidTypesException("Either needs to be parameterized by using generics."); - } - typeHierarchy.add(curT); - // create the type information for the subtypes final TypeInformation<?>[] subTypesInfo = createSubTypesInfo(t, (ParameterizedType) curT, typeHierarchy, in1Type, in2Type, false); // type needs to be treated a pojo due to additional fields if (subTypesInfo == null) { if (t instanceof ParameterizedType) { return (TypeInformation<OUT>) analyzePojo(typeToClass(t), new ArrayList<Type>(typeHierarchy), (ParameterizedType) t, in1Type, in2Type); End diff – Sorry for not writing back earlier. You are right, all tests still work. The factories work better than I expected. We lose the input validation in this PR but I think this is ok. I will merge this.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/flink/pull/2545

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/flink/pull/2545
          Hide
          twalthr Timo Walther added a comment -

          Fixed in 1.3.0: d4d7cc32667016d66c65a7d64601cabd101a0c4d

          Show
          twalthr Timo Walther added a comment - Fixed in 1.3.0: d4d7cc32667016d66c65a7d64601cabd101a0c4d
          Hide
          githubbot ASF GitHub Bot added a comment -

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

          https://github.com/apache/flink/pull/2545#discussion_r95386388

          — Diff: flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java —
          @@ -675,38 +673,6 @@ else if (isClassType(t) && Tuple.class.isAssignableFrom(typeToClass(t)))

          { return new TupleTypeInfo(typeToClass(t), subTypesInfo); }
          • // check if type is a subclass of Either
          • else if (isClassType(t) && Either.class.isAssignableFrom(typeToClass(t))) {
          • Type curT = t;
            -
          • // go up the hierarchy until we reach Either (with or without generics)
          • // collect the types while moving up for a later top-down
          • while (!(isClassType(curT) && typeToClass(curT).equals(Either.class))) { - typeHierarchy.add(curT); - curT = typeToClass(curT).getGenericSuperclass(); - }

            -

          • // check if Either has generics
          • if (curT instanceof Class<?>) { - throw new InvalidTypesException("Either needs to be parameterized by using generics."); - }

            -

          • typeHierarchy.add(curT);
            -
          • // create the type information for the subtypes
          • final TypeInformation<?>[] subTypesInfo = createSubTypesInfo(t, (ParameterizedType) curT, typeHierarchy, in1Type, in2Type, false);
          • // type needs to be treated a pojo due to additional fields
          • if (subTypesInfo == null) {
          • if (t instanceof ParameterizedType) {
          • return (TypeInformation<OUT>) analyzePojo(typeToClass(t), new ArrayList<Type>(typeHierarchy), (ParameterizedType) t, in1Type, in2Type);
              • End diff –

          @twalthr thanks for checking this! Glad to hear that your factories implementation has exceeded expectations

          Show
          githubbot ASF GitHub Bot added a comment - Github user greghogan commented on a diff in the pull request: https://github.com/apache/flink/pull/2545#discussion_r95386388 — Diff: flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java — @@ -675,38 +673,6 @@ else if (isClassType(t) && Tuple.class.isAssignableFrom(typeToClass(t))) { return new TupleTypeInfo(typeToClass(t), subTypesInfo); } // check if type is a subclass of Either else if (isClassType(t) && Either.class.isAssignableFrom(typeToClass(t))) { Type curT = t; - // go up the hierarchy until we reach Either (with or without generics) // collect the types while moving up for a later top-down while (!(isClassType(curT) && typeToClass(curT).equals(Either.class))) { - typeHierarchy.add(curT); - curT = typeToClass(curT).getGenericSuperclass(); - } - // check if Either has generics if (curT instanceof Class<?>) { - throw new InvalidTypesException("Either needs to be parameterized by using generics."); - } - typeHierarchy.add(curT); - // create the type information for the subtypes final TypeInformation<?>[] subTypesInfo = createSubTypesInfo(t, (ParameterizedType) curT, typeHierarchy, in1Type, in2Type, false); // type needs to be treated a pojo due to additional fields if (subTypesInfo == null) { if (t instanceof ParameterizedType) { return (TypeInformation<OUT>) analyzePojo(typeToClass(t), new ArrayList<Type>(typeHierarchy), (ParameterizedType) t, in1Type, in2Type); End diff – @twalthr thanks for checking this! Glad to hear that your factories implementation has exceeded expectations

            People

            • Assignee:
              greghogan Greg Hogan
              Reporter:
              greghogan Greg Hogan
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development