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 b38226e810
commit 41517ea283

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2022 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.
@@ -351,7 +351,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");
@@ -365,10 +364,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);
}
}