Hi Alberto,

it seems that this class is not compatible with Java 8 new type inference
rules, more specifically the 1.8 compiler picks a different overloaded
method than 1.7.

In TupleSerializer.java:112 the call to TypeSerializer.copy method in Java
7 resolves to

public abstract T copy(T from, T reuse);

while with Java 8 following the new inference rules (which basically
selects the most specific matching method)  the compiler prefers

public abstract void copy(DataInputView source, DataOutputView target)
throws IOException;

and the compilation fails. It's the only place in the production code where
this change in the compilation logic seems to cause compile-time errors.
There are a few unit tests that fail to pick the correct overloaded method
alternative as well.

Since Java 7 is end of life, I think it makes sense to be able to build
Flink with Java 8 source/target. If you create a Jira for the compilation
issue, I can suggest a PR fixing the compile-time errors and the tests.

Note that you can still use JDK8 to compile Flink without changing the
java.version in pom.xml, in this scenario the compiler will not try to use
1.8 language features and the compilation will succeed. You can also run
your Flink cluster using the Java 8 runtime.

Andrey

On Sun, Nov 13, 2016 at 12:29 AM, Alberto Ramón <[email protected]>
wrote:

> bash> git Clone
> POM> <java.version>1.8</java.version>
> bash> java -version ==> java version "1.8.0_111"
>
>
> *Failed to execute goal
> org.apache.maven.plugins:maven-compiler-plugin:3.1:compile
> (default-compile) on project flink-core: Compilation failure[ERROR] . . .
> /flink1.2
> _10_Nov/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/TupleSerializer.java:[112,63]
> incompatible types: void cannot be converted to java.lang.Object*
>
> is this Normal ?
> (If I put 1.7, there isn't any problem)
>

Reply via email to