Use ExecutionContext map constructor

Use ExecutionContext map constructor to simplify
ExecutionContextRowMapper.mapRow.

Issue #3985
This commit is contained in:
Philippe Marschall
2021-09-01 11:02:02 +02:00
committed by Mahmoud Ben Hassine
parent 097891fbfb
commit 900b36f604

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2018 the original author or authors.
* Copyright 2006-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -313,7 +313,6 @@ public class JdbcExecutionContextDao extends AbstractJdbcBatchMetadataDao implem
@Override
public ExecutionContext mapRow(ResultSet rs, int i) throws SQLException {
ExecutionContext executionContext = new ExecutionContext();
String serializedContext = rs.getString("SERIALIZED_CONTEXT");
if (serializedContext == null) {
serializedContext = rs.getString("SHORT_CONTEXT");
@@ -327,10 +326,7 @@ public class JdbcExecutionContextDao extends AbstractJdbcBatchMetadataDao implem
catch (IOException ioe) {
throw new IllegalArgumentException("Unable to deserialize the execution context", ioe);
}
for (Map.Entry<String, Object> entry : map.entrySet()) {
executionContext.put(entry.getKey(), entry.getValue());
}
return executionContext;
return new ExecutionContext(map);
}
}