File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2009-2018 the original author or authors.
2
+ * Copyright 2009-2021 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
48
48
*/
49
49
public class ResourcesItemReader extends AbstractItemStreamItemReader <Resource > {
50
50
51
+ private static final String COUNT_KEY = "COUNT" ;
52
+
51
53
private Resource [] resources = new Resource [0 ];
52
54
53
55
private AtomicInteger counter = new AtomicInteger (0 );
@@ -85,13 +87,13 @@ public synchronized Resource read() throws Exception {
85
87
@ Override
86
88
public void open (ExecutionContext executionContext ) throws ItemStreamException {
87
89
super .open (executionContext );
88
- counter .set (executionContext .getInt (getExecutionContextKey ("COUNT" ), 0 ));
90
+ counter .set (executionContext .getInt (getExecutionContextKey (COUNT_KEY ), 0 ));
89
91
}
90
92
91
93
@ Override
92
94
public void update (ExecutionContext executionContext ) throws ItemStreamException {
93
95
super .update (executionContext );
94
- executionContext .putInt (getExecutionContextKey ("COUNT" ), counter .get ());
96
+ executionContext .putInt (getExecutionContextKey (COUNT_KEY ), counter .get ());
95
97
}
96
98
97
99
}
You can’t perform that action at this time.
0 commit comments