Skip to content

Commit 757a28b

Browse files
committed
Use ExecutionContext map constructor
Use ExecutionContext map constructor to simplify ExecutionContextRowMapper.mapRow.
1 parent d0ab497 commit 757a28b

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcExecutionContextDao.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,6 @@ private class ExecutionContextRowMapper implements RowMapper<ExecutionContext> {
315315

316316
@Override
317317
public ExecutionContext mapRow(ResultSet rs, int i) throws SQLException {
318-
ExecutionContext executionContext = new ExecutionContext();
319318
String serializedContext = rs.getString("SERIALIZED_CONTEXT");
320319
if (serializedContext == null) {
321320
serializedContext = rs.getString("SHORT_CONTEXT");
@@ -329,10 +328,7 @@ public ExecutionContext mapRow(ResultSet rs, int i) throws SQLException {
329328
catch (IOException ioe) {
330329
throw new IllegalArgumentException("Unable to deserialize the execution context", ioe);
331330
}
332-
for (Map.Entry<String, Object> entry : map.entrySet()) {
333-
executionContext.put(entry.getKey(), entry.getValue());
334-
}
335-
return executionContext;
331+
return new ExecutionContext(map);
336332
}
337333
}
338334

0 commit comments

Comments
 (0)