BATCH-1390: Restructured if-statement to prevent doing the same check twice.

This commit is contained in:
dhgarrette
2009-09-04 22:36:03 +00:00
parent cf42e1629e
commit f29b8e908c

View File

@@ -53,11 +53,11 @@ public class ExecutionContextPromotionListener extends StepExecutionListenerSupp
for (String statusPattern : statuses) {
if (PatternMatcher.match(statusPattern, exitCode)) {
for (String key : keys) {
if (strict) {
Assert.isTrue(stepContext.containsKey(key), "The key [" + key
+ "] was not found in the Step's ExecutionContext.");
}
if (stepContext.containsKey(key)) {
if (strict) {
throw new IllegalArgumentException("The key [" + key
+ "] was not found in the Step's ExecutionContext.");
}
jobContext.put(key, stepContext.get(key));
}
}