Skip to content

Commit d17464f

Browse files
author
Jay Bryant
committed
Editing pass
for org.springframework.batch.core but not further down that tree.
1 parent 0b49e08 commit d17464f

27 files changed

+476
-454
lines changed

spring-batch-core/src/main/java/org/springframework/batch/core/BatchStatus.java

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
package org.springframework.batch.core;
1818

1919
/**
20-
* Enumeration representing the status of an Execution.
21-
*
20+
* Enumeration representing the status of an execution.
21+
*
2222
* @author Lucas Ward
2323
* @author Dave Syer
2424
* @author Michael Minella
@@ -28,14 +28,14 @@ public enum BatchStatus {
2828

2929
/**
3030
* The order of the status values is significant because it can be used to
31-
* aggregate a set of status values - the result should be the maximum
32-
* value. Since COMPLETED is first in the order, only if all elements of an
33-
* execution are COMPLETED will the aggregate status be COMPLETED. A running
34-
* execution is expected to move from STARTING to STARTED to COMPLETED
31+
* aggregate a set of status values. The result should be the maximum
32+
* value. Since {@code COMPLETED} is first in the order, only if all elements of an
33+
* execution are {@code COMPLETED} can the aggregate status be COMPLETED. A running
34+
* execution is expected to move from {@code STARTING} to {@code STARTED} to {@code COMPLETED}
3535
* (through the order defined by {@link #upgradeTo(BatchStatus)}). Higher
36-
* values than STARTED signify more serious failure. ABANDONED is used for
37-
* steps that have finished processing, but were not successful, and where
38-
* they should be skipped on a restart (so FAILED is the wrong status).
36+
* values than {@code STARTED} signify more serious failures. {@code ABANDONED} is used for
37+
* steps that have finished processing but were not successful and where
38+
* they should be skipped on a restart (so {@code FAILED} is the wrong status).
3939
*/
4040

4141
/**
@@ -72,7 +72,7 @@ public enum BatchStatus {
7272
UNKNOWN;
7373

7474
/**
75-
* Convenience method to return the higher value status of the statuses pass in to the method.
75+
* Convenience method to return the higher value status of the statuses passed to the method.
7676
*
7777
* @param status1 The first status to check.
7878
* @param status2 The second status to check.
@@ -83,8 +83,8 @@ public static BatchStatus max(BatchStatus status1, BatchStatus status2) {
8383
}
8484

8585
/**
86-
* Convenience method to decide if a status indicates work is in progress.
87-
*
86+
* Convenience method to decide if a status indicates that work is in progress.
87+
*
8888
* @return true if the status is STARTING, STARTED
8989
*/
9090
public boolean isRunning() {
@@ -94,8 +94,8 @@ public boolean isRunning() {
9494
/**
9595
* Convenience method to decide if a status indicates execution was
9696
* unsuccessful.
97-
*
98-
* @return true if the status is FAILED or greater
97+
*
98+
* @return {@code true} if the status is {@code FAILED} or greater.
9999
*/
100100
public boolean isUnsuccessful() {
101101
return this == FAILED || this.isGreaterThan(FAILED);
@@ -104,13 +104,13 @@ public boolean isUnsuccessful() {
104104
/**
105105
* Method used to move status values through their logical progression, and
106106
* override less severe failures with more severe ones. This value is
107-
* compared with the parameter and the one that has higher priority is
108-
* returned. If both are STARTED or less than the value returned is the
109-
* largest in the sequence STARTING, STARTED, COMPLETED. Otherwise the value
107+
* compared with the parameter, and the one that has higher priority is
108+
* returned. If both are {@code STARTED} or less than the value returned is the
109+
* largest in the sequence {@code STARTING}, {@code STARTED}, {@code COMPLETED}. Otherwise, the value
110110
* returned is the maximum of the two.
111-
*
112-
* @param other another status to compare to
113-
* @return either this or the other status depending on their priority
111+
*
112+
* @param other Another status to which to compare.
113+
* @return either this or the other status, depending on their priority.
114114
*/
115115
public BatchStatus upgradeTo(BatchStatus other) {
116116
if (isGreaterThan(STARTED) || other.isGreaterThan(STARTED)) {
@@ -124,36 +124,36 @@ public BatchStatus upgradeTo(BatchStatus other) {
124124
}
125125

126126
/**
127-
* @param other a status value to compare
128-
* @return true if this is greater than other
127+
* @param other A status value to which to compare.
128+
* @return {@code true} if this is greater than {@code other}.
129129
*/
130130
public boolean isGreaterThan(BatchStatus other) {
131131
return this.compareTo(other) > 0;
132132
}
133133

134134
/**
135-
* @param other a status value to compare
136-
* @return true if this is less than other
135+
* @param other A status value to which to compare.
136+
* @return {@code true} if this is less than {@code other}.
137137
*/
138138
public boolean isLessThan(BatchStatus other) {
139139
return this.compareTo(other) < 0;
140140
}
141141

142142
/**
143-
* @param other a status value to compare
144-
* @return true if this is less than other
143+
* @param other A status value to which to compare.
144+
* @return {@code true} if this is less than {@code other}.
145145
*/
146146
public boolean isLessThanOrEqualTo(BatchStatus other) {
147147
return this.compareTo(other) <= 0;
148148
}
149149

150150
/**
151-
* Find a BatchStatus that matches the beginning of the given value. If no
152-
* match is found, return COMPLETED as the default because has is low
151+
* Find a {@code BatchStatus} that matches the beginning of the given value. If no
152+
* match is found, return {@code COMPLETED} as the default because it has low
153153
* precedence.
154-
*
155-
* @param value a string representing a status
156-
* @return a BatchStatus
154+
*
155+
* @param value A string representing a status.
156+
* @return a {BatchStatus} object.
157157
*/
158158
public static BatchStatus match(String value) {
159159
for (BatchStatus status : values()) {

spring-batch-core/src/main/java/org/springframework/batch/core/ChunkListener.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
import org.springframework.batch.core.scope.context.ChunkContext;
1919

2020
/**
21-
* Listener interface for the lifecycle of a chunk. A chunk
22-
* can be thought of as a collection of items that will be
21+
* Listener interface for the lifecycle of a chunk. A chunk
22+
* can be thought of as a collection of items that are
2323
* committed together.
2424
*
2525
* @author Lucas Ward
@@ -52,11 +52,11 @@ default void afterChunk(ChunkContext context) {
5252

5353
/**
5454
* Callback after a chunk has been marked for rollback. It is invoked
55-
* after transaction rollback. While the rollback will have occurred,
56-
* transactional resources might still be active and accessible. Due to
57-
* this, data access code within this callback will still "participate" in
55+
* after transaction rollback. While the rollback will have occurred,
56+
* transactional resources might still be active and accessible. Due to
57+
* this, data access code within this callback still "participates" in
5858
* the original transaction unless it declares that it runs in its own
59-
* transaction. Hence: <em> Use PROPAGATION_REQUIRES_NEW for any
59+
* transaction. <em>As a result, you should use {@code PROPAGATION_REQUIRES_NEW} for any
6060
* transactional operation that is called from here.</em>
6161
*
6262
* @param context the chunk context containing the exception that caused

spring-batch-core/src/main/java/org/springframework/batch/core/DefaultJobKeyGenerator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626

2727
/**
2828
* Default implementation of the {@link JobKeyGenerator} interface.
29-
* This implementation provides a single hash value based on the JobParameters
30-
* passed in. Only identifying parameters (per {@link JobParameter#isIdentifying()})
29+
* This implementation provides a single hash value based on the {@link JobParameters} object
30+
* passed in. Only identifying parameters (as per {@link JobParameter#isIdentifying()})
3131
* are used in the calculation of the key.
3232
*
3333
* @author Michael Minella

spring-batch-core/src/main/java/org/springframework/batch/core/Entity.java

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222

2323
/**
2424
* Batch Domain Entity class. Any class that should be uniquely identifiable
25-
* from another should subclass from Entity. More information on this pattern
26-
* and the difference between Entities and Value Objects can be found in Domain
27-
* Driven Design by Eric Evans.
25+
* from another should subclass from Entity. See Domain
26+
* Driven Design, by Eric Evans, for more information on this pattern
27+
* and the difference between Entities and Value Objects.
2828
*
2929
* @author Lucas Ward
3030
* @author Dave Syer
@@ -75,22 +75,22 @@ public void setId(Long id) {
7575
}
7676

7777
/**
78-
* @return the version
78+
* @return the version.
7979
*/
8080
public Integer getVersion() {
8181
return version;
8282
}
8383

8484
/**
85-
* Public setter for the version needed only by repository methods.
86-
* @param version the version to set
85+
* Public setter for the version. Needed only by repository methods.
86+
* @param version The version to set.
8787
*/
8888
public void setVersion(Integer version) {
8989
this.version = version;
9090
}
9191

9292
/**
93-
* Increment the version number
93+
* Increment the version number.
9494
*/
9595
public void incrementVersion() {
9696
if (version == null) {
@@ -100,14 +100,18 @@ public void incrementVersion() {
100100
}
101101
}
102102

103+
/**
104+
* Creates a string representation of the {@code Entity},
105+
* including the {@code id}, {@code version}, and class name.
106+
*/
103107
@Override
104108
public String toString() {
105109
return String.format("%s: id=%d, version=%d", ClassUtils.getShortName(getClass()), id, version);
106110
}
107111

108112
/**
109-
* Attempt to establish identity based on id if both exist. If either id
110-
* does not exist use Object.equals().
113+
* Attempt to establish identity based on {@code id} if both exist. If either {@code id}
114+
* does not exist, use {@code Object.equals()}.
111115
*
112116
* @see java.lang.Object#equals(java.lang.Object)
113117
*/
@@ -130,13 +134,14 @@ public boolean equals(Object other) {
130134
}
131135

132136
/**
133-
* Use ID if it exists to establish hash code, otherwise fall back to
134-
* Object.hashCode(). Based on the same information as equals, so if that
135-
* changes, this will. N.B. this follows the contract of Object.hashCode(),
137+
* Use {@code id}, if it exists, to establish a hash code. Otherwise fall back to
138+
* {@code Object.hashCode()}. It is based on the
139+
* same information as {@code equals}, so, if that
140+
* changes, this will. Note that this follows the contract of {@code Object.hashCode()}
136141
* but will cause problems for anyone adding an unsaved {@link Entity} to a
137-
* Set because Set.contains() will almost certainly return false for the
142+
* {@code Set} because {@code Set.contains()} almost certainly returns false for the
138143
* {@link Entity} after it is saved. Spring Batch does not store any of its
139-
* entities in Sets as a matter of course, so internally this is consistent.
144+
* entities in sets as a matter of course, so this is internally consistent.
140145
* Clients should not be exposed to unsaved entities.
141146
*
142147
* @see java.lang.Object#hashCode()

0 commit comments

Comments
 (0)