diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcExecutionContextDao.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcExecutionContextDao.java index 1e1274939..d40cf3145 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcExecutionContextDao.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcExecutionContextDao.java @@ -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 entry : map.entrySet()) { - executionContext.put(entry.getKey(), entry.getValue()); - } - return executionContext; + return new ExecutionContext(map); } }