Repository: flink
Updated Branches:
  refs/heads/master 721220203 -> b51605686


[FLINK-4645] [core] Adjust signatures of 'registerTypeWithKryoSerializer(...)' 
methods to allow simpler passing of
classes without generic casting.

This is not API breaking due to generic type erasure in Java. The changes 
method still has the same
binary signature.


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/82ef021c
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/82ef021c
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/82ef021c

Branch: refs/heads/master
Commit: 82ef021cb8f77635bcec61d49eedce1ddefd1e48
Parents: 349d06d
Author: Stephan Ewen <se...@apache.org>
Authored: Tue Sep 20 19:47:49 2016 +0200
Committer: Stephan Ewen <se...@apache.org>
Committed: Wed Sep 21 17:53:32 2016 +0200

----------------------------------------------------------------------
 .../org/apache/flink/api/common/ExecutionConfig.java     | 11 ++++++++---
 .../api/environment/StreamExecutionEnvironment.java      |  4 ++--
 2 files changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/82ef021c/flink-core/src/main/java/org/apache/flink/api/common/ExecutionConfig.java
----------------------------------------------------------------------
diff --git 
a/flink-core/src/main/java/org/apache/flink/api/common/ExecutionConfig.java 
b/flink-core/src/main/java/org/apache/flink/api/common/ExecutionConfig.java
index 81ee930..aadf867 100644
--- a/flink-core/src/main/java/org/apache/flink/api/common/ExecutionConfig.java
+++ b/flink-core/src/main/java/org/apache/flink/api/common/ExecutionConfig.java
@@ -311,6 +311,7 @@ public class ExecutionConfig implements Serializable {
         * @return The specified restart configuration
         */
        @PublicEvolving
+       @SuppressWarnings("deprecation")
        public RestartStrategies.RestartStrategyConfiguration 
getRestartStrategy() {
                if (restartStrategyConfiguration == null) {
                        // support the old API calls by creating a restart 
strategy from them
@@ -601,11 +602,15 @@ public class ExecutionConfig implements Serializable {
         * @param type The class of the types serialized with the given 
serializer.
         * @param serializerClass The class of the serializer to use.
         */
-       public void registerTypeWithKryoSerializer(Class<?> type, Class<? 
extends Serializer<?>> serializerClass) {
+       @SuppressWarnings("rawtypes")
+       public void registerTypeWithKryoSerializer(Class<?> type, Class<? 
extends Serializer> serializerClass) {
                if (type == null || serializerClass == null) {
                        throw new NullPointerException("Cannot register null 
class or serializer.");
                }
-               registeredTypesWithKryoSerializerClasses.put(type, 
serializerClass);
+
+               @SuppressWarnings("unchecked")
+               Class<? extends Serializer<?>> castedSerializerClass = (Class<? 
extends Serializer<?>>) serializerClass;
+               registeredTypesWithKryoSerializerClasses.put(type, 
castedSerializerClass);
        }
 
        /**
@@ -620,7 +625,7 @@ public class ExecutionConfig implements Serializable {
                if (type == null) {
                        throw new NullPointerException("Cannot register null 
type class.");
                }
-               if(!registeredPojoTypes.contains(type)) {
+               if (!registeredPojoTypes.contains(type)) {
                        registeredPojoTypes.add(type);
                }
        }

http://git-wip-us.apache.org/repos/asf/flink/blob/82ef021c/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java
----------------------------------------------------------------------
diff --git 
a/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java
 
b/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java
index 06823d5..8fc2872 100644
--- 
a/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java
+++ 
b/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java
@@ -577,8 +577,8 @@ public abstract class StreamExecutionEnvironment {
         * @param serializerClass
         *              The class of the serializer to use.
         */
-       public void registerTypeWithKryoSerializer(Class<?> type, 
-                                       Class<? extends Serializer<?>> 
serializerClass) {
+       @SuppressWarnings("rawtypes")
+       public void registerTypeWithKryoSerializer(Class<?> type, Class<? 
extends Serializer> serializerClass) {
                config.registerTypeWithKryoSerializer(type, serializerClass);
        }
 

Reply via email to