findbugs fixes
This commit is contained in:
@@ -98,7 +98,7 @@ public class JdbcStepExecutionDao extends AbstractJdbcBatchMetadataDao implement
|
||||
|
||||
String exitDescription = truncateExitDescription(stepExecution.getExitStatus().getExitDescription());
|
||||
|
||||
stepExecution.setId(new Long(stepExecutionIncrementer.nextLongValue()));
|
||||
stepExecution.setId(stepExecutionIncrementer.nextLongValue());
|
||||
stepExecution.incrementVersion(); // should be 0 now
|
||||
Object[] parameters = new Object[] { stepExecution.getId(), stepExecution.getVersion(),
|
||||
stepExecution.getStepName(), stepExecution.getJobExecutionId(), stepExecution.getStartTime(),
|
||||
|
||||
@@ -35,7 +35,7 @@ public class MapJobExecutionDao implements JobExecutionDao {
|
||||
|
||||
public void saveJobExecution(JobExecution jobExecution) {
|
||||
Assert.isTrue(jobExecution.getId() == null);
|
||||
Long newId = new Long(currentId++);
|
||||
Long newId = currentId++;
|
||||
jobExecution.setId(newId);
|
||||
jobExecution.incrementVersion();
|
||||
executionsById.put(newId, copy(jobExecution));
|
||||
@@ -128,6 +128,6 @@ public class MapJobExecutionDao implements JobExecutionDao {
|
||||
}
|
||||
|
||||
public void synchronizeStatus(JobExecution jobExecution) {
|
||||
// TODO Auto-generated method stub
|
||||
// no-op
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class MapJobInstanceDao implements JobInstanceDao {
|
||||
|
||||
Assert.state(getJobInstance(jobName, jobParameters) == null, "JobInstance must not already exist");
|
||||
|
||||
JobInstance jobInstance = new JobInstance(new Long(currentId++), jobParameters, jobName);
|
||||
JobInstance jobInstance = new JobInstance(currentId++, jobParameters, jobName);
|
||||
jobInstance.incrementVersion();
|
||||
jobInstances.add(jobInstance);
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ public class MapStepExecutionDao implements StepExecutionDao {
|
||||
executions = TransactionAwareProxyFactory.createTransactionalMap();
|
||||
executionsByJobExecutionId.put(stepExecution.getJobExecutionId(), executions);
|
||||
}
|
||||
stepExecution.setId(new Long(currentId++));
|
||||
stepExecution.setId(currentId++);
|
||||
stepExecution.incrementVersion();
|
||||
executions.put(stepExecution.getStepName(), copy(stepExecution));
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ public class SimpleJobRepositoryTests {
|
||||
|
||||
job.setSteps(stepConfigurations);
|
||||
|
||||
jobInstance = new JobInstance(new Long(1), jobParameters, job.getName());
|
||||
jobInstance = new JobInstance(1L, jobParameters, job.getName());
|
||||
|
||||
databaseStep1 = "dbStep1";
|
||||
databaseStep2 = "dbStep2";
|
||||
@@ -112,7 +112,7 @@ public class SimpleJobRepositoryTests {
|
||||
steps.add(databaseStep1);
|
||||
steps.add(databaseStep2);
|
||||
|
||||
jobExecution = new JobExecution(new JobInstance(new Long(1), jobParameters, job.getName()), new Long(1));
|
||||
jobExecution = new JobExecution(new JobInstance(1L, jobParameters, job.getName()), 1L);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -132,7 +132,7 @@ public class SimpleJobRepositoryTests {
|
||||
@Test
|
||||
public void testUpdateValidJobExecution() throws Exception {
|
||||
|
||||
JobExecution jobExecution = new JobExecution(new JobInstance(new Long(1), jobParameters, job.getName()), new Long(1));
|
||||
JobExecution jobExecution = new JobExecution(new JobInstance(1L, jobParameters, job.getName()), 1L);
|
||||
// new execution - call update on job dao
|
||||
jobExecutionDao.updateJobExecution(jobExecution);
|
||||
replay(jobExecutionDao);
|
||||
|
||||
@@ -61,7 +61,7 @@ public class StepExecutionResourceProxyTests extends TestCase {
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
|
||||
jobInstance = new JobInstance(new Long(0), new JobParameters(), "testJob");
|
||||
jobInstance = new JobInstance(0L, new JobParameters(), "testJob");
|
||||
JobExecution jobExecution = new JobExecution(jobInstance);
|
||||
Step step = new StepSupport("bar");
|
||||
stepExecution = jobExecution.createStepExecution(step.getName());
|
||||
@@ -95,7 +95,7 @@ public class StepExecutionResourceProxyTests extends TestCase {
|
||||
|
||||
public void testNonStandardFilePatternWithJobParameters() throws Exception {
|
||||
resource.setFilePattern("foo/data/%JOB_NAME%/%job.key%-foo");
|
||||
jobInstance = new JobInstance(new Long(0), new JobParametersBuilder().addString("job.key", "spam")
|
||||
jobInstance = new JobInstance(0L, new JobParametersBuilder().addString("job.key", "spam")
|
||||
.toJobParameters(), "testJob");
|
||||
JobExecution jobExecution = new JobExecution(jobInstance);
|
||||
Step step = new StepSupport("bar");
|
||||
@@ -122,7 +122,7 @@ public class StepExecutionResourceProxyTests extends TestCase {
|
||||
public void testLongJobParameter() throws Exception {
|
||||
|
||||
resource.setFilePattern("foo/data/%JOB_NAME%/%job.key(long)%-foo");
|
||||
jobInstance = new JobInstance(new Long(0), new JobParametersBuilder().addLong("job.key", 123L)
|
||||
jobInstance = new JobInstance(0L, new JobParametersBuilder().addLong("job.key", 123L)
|
||||
.toJobParameters(), "testJob");
|
||||
JobExecution jobExecution = new JobExecution(jobInstance);
|
||||
Step step = new StepSupport("bar");
|
||||
|
||||
@@ -51,7 +51,7 @@ public class StepExecutionSimpleCompletionPolicyTests extends TestCase {
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
|
||||
JobParameters jobParameters = new JobParametersBuilder().addLong("commit.interval", new Long(2L)).toJobParameters();
|
||||
JobParameters jobParameters = new JobParametersBuilder().addLong("commit.interval", 2L).toJobParameters();
|
||||
jobInstance = new JobInstance(new Long(0), jobParameters, "testJob");
|
||||
JobExecution jobExecution = new JobExecution(jobInstance);
|
||||
Step step = new StepSupport("bar");
|
||||
|
||||
@@ -39,7 +39,7 @@ public class AbstractStepTests {
|
||||
*/
|
||||
final List<String> events = new ArrayList<String>();
|
||||
|
||||
final StepExecution execution = new StepExecution(tested.getName(), new JobExecution(new JobInstance(new Long(1),
|
||||
final StepExecution execution = new StepExecution(tested.getName(), new JobExecution(new JobInstance(1L,
|
||||
new JobParameters(), "jobName")));
|
||||
|
||||
/**
|
||||
|
||||
@@ -35,7 +35,7 @@ public class NoWorkFoundStepExecutionListenerTests extends TestCase {
|
||||
public void testAfterStep() {
|
||||
StepExecution stepExecution = new StepExecution("NoProcessingStep",
|
||||
new JobExecution(
|
||||
new JobInstance(new Long(1), new JobParameters(), "NoProcessingJob")));
|
||||
new JobInstance(1L, new JobParameters(), "NoProcessingJob")));
|
||||
|
||||
stepExecution.setReadCount(0);
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ public class FaultTolerantStepFactoryBeanNonBufferingTests {
|
||||
factory.setSkipLimit(2);
|
||||
factory.setIsReaderTransactionalQueue(true);
|
||||
|
||||
JobInstance jobInstance = new JobInstance(new Long(1), new JobParameters(), "skipJob");
|
||||
JobInstance jobInstance = new JobInstance(1L, new JobParameters(), "skipJob");
|
||||
jobExecution = new JobExecution(jobInstance);
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ public class FaultTolerantStepFactoryBeanTests {
|
||||
factory.setSkippableExceptionClasses(skippableExceptions);
|
||||
factory.setSkipLimit(2);
|
||||
|
||||
JobInstance jobInstance = new JobInstance(new Long(1), new JobParameters(), "skipJob");
|
||||
JobInstance jobInstance = new JobInstance(1L, new JobParameters(), "skipJob");
|
||||
jobExecution = new JobExecution(jobInstance);
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ public class RepeatOperationsStepFactoryBeanTests extends TestCase {
|
||||
|
||||
private List<String> list;
|
||||
|
||||
private JobExecution jobExecution = new JobExecution(new JobInstance(new Long(0L), new JobParameters(), "job"));
|
||||
private JobExecution jobExecution = new JobExecution(new JobInstance(0L, new JobParameters(), "job"));
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
factory.setBeanName("RepeatOperationsStep");
|
||||
|
||||
@@ -92,7 +92,7 @@ public class AsyncTaskletStepTests {
|
||||
});
|
||||
|
||||
JobSupport job = new JobSupport("FOO");
|
||||
jobInstance = new JobInstance(new Long(0), new JobParameters(), job.getName());
|
||||
jobInstance = new JobInstance(0L, new JobParameters(), job.getName());
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ public class TaskletStepTests {
|
||||
step.setStepOperations(template);
|
||||
|
||||
job = new JobSupport("FOO");
|
||||
jobInstance = new JobInstance(new Long(0), new JobParameters(), job.getName());
|
||||
jobInstance = new JobInstance(0L, new JobParameters(), job.getName());
|
||||
|
||||
step.setTransactionManager(transactionManager);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user