[ https://issues.apache.org/jira/browse/FLINK-8165?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Aljoscha Krettek updated FLINK-8165: ------------------------------------ Description: Trying to get with default value after deserialization fails as the EmptyMap doesn't support put operations for new default values. The problem is here: https://github.com/apache/flink/blob/release-1.4.0-rc2/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java#L621 Reproduce: {code} @Test public void tes() throws IOException, ClassNotFoundException { ParameterTool params = ParameterTool.fromMap(new HashMap<>()); // works params.get("asd", "default"); byte[] b = InstantiationUtil.serializeObject(params); ParameterTool dparams = InstantiationUtil.deserializeObject(b, getClass().getClassLoader()); // fails dparams.get("asd", "default"); } {code} was: Trying to get with default value after deserialization fails as the EmptyMap doesn't support put operations for new default values. The problem is here: https://github.com/apache/flink/blob/release-1.4.0-rc2/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java#L621 Reproduce: @Test public void tes() throws IOException, ClassNotFoundException { ParameterTool params = ParameterTool.fromMap(new HashMap<>()); // works params.get("asd", "default"); byte[] b = InstantiationUtil.serializeObject(params); ParameterTool dparams = InstantiationUtil.deserializeObject(b, getClass().getClassLoader()); // fails dparams.get("asd", "default"); } > ParameterTools not serializable properly > ---------------------------------------- > > Key: FLINK-8165 > URL: https://issues.apache.org/jira/browse/FLINK-8165 > Project: Flink > Issue Type: Bug > Components: Configuration, Java API > Affects Versions: 1.4.0, 1.5.0 > Reporter: Gyula Fora > Priority: Critical > > Trying to get with default value after deserialization fails as the EmptyMap > doesn't support put operations for new default values. > The problem is here: > https://github.com/apache/flink/blob/release-1.4.0-rc2/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java#L621 > Reproduce: > {code} > @Test > public void tes() throws IOException, ClassNotFoundException { > ParameterTool params = ParameterTool.fromMap(new HashMap<>()); > // works > params.get("asd", "default"); > byte[] b = InstantiationUtil.serializeObject(params); > ParameterTool dparams = InstantiationUtil.deserializeObject(b, > getClass().getClassLoader()); > // fails > dparams.get("asd", "default"); > } > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)