diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StepParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StepParser.java index b7a8d327c..35ac216de 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StepParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StepParser.java @@ -236,9 +236,9 @@ public class StepParser { boolean isFaultTolerant = false; + // TODO determine if step should be fault-tolerant String faultTolerant = element.getAttribute("fault-tolerant"); - // TODO determine if step should be fault-tolerant String skipLimit = element.getAttribute("skip-limit"); if (!isFaultTolerant) { isFaultTolerant = checkIntValueForFaultToleranceNeeded(skipLimit); diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/MapJobExplorerFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/MapJobExplorerFactoryBean.java index 0e7372276..079da015b 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/MapJobExplorerFactoryBean.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/MapJobExplorerFactoryBean.java @@ -28,7 +28,6 @@ public class MapJobExplorerFactoryBean extends AbstractJobExplorerFactoryBean { @Override protected StepExecutionDao createStepExecutionDao() throws Exception { - // TODO Auto-generated method stub return new MapStepExecutionDao(); } diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/SplitState.java b/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/SplitState.java index 590e04d86..2097cfa3d 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/SplitState.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/job/flow/support/state/SplitState.java @@ -18,6 +18,7 @@ package org.springframework.batch.core.job.flow.support.state; import java.util.ArrayList; import java.util.Collection; import java.util.concurrent.Callable; +import java.util.concurrent.Future; import java.util.concurrent.FutureTask; import org.springframework.batch.core.job.flow.Flow; @@ -69,7 +70,7 @@ public class SplitState extends AbstractState { @Override public String handle(final FlowExecutor executor) throws Exception { - Collection> tasks = new ArrayList>(); + Collection> tasks = new ArrayList>(); for (final Flow flow : flows) { @@ -92,8 +93,8 @@ public class SplitState extends AbstractState { Collection results = new ArrayList(); - // TODO: could use a CompletionSerice? - for (FutureTask task : tasks) { + // TODO: could use a CompletionService + for (Future task : tasks) { results.add(task.get()); } diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/TaskExecutorPartitionHandler.java b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/TaskExecutorPartitionHandler.java index 8d7824737..aee1ee972 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/TaskExecutorPartitionHandler.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/partition/support/TaskExecutorPartitionHandler.java @@ -5,6 +5,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.Set; import java.util.concurrent.Callable; +import java.util.concurrent.Future; import java.util.concurrent.FutureTask; import org.springframework.batch.core.BatchStatus; @@ -49,7 +50,7 @@ public class TaskExecutorPartitionHandler implements PartitionHandler, Initializ public Collection handle(StepExecutionSplitter stepExecutionSplitter, StepExecution masterStepExecution) throws Exception { - Set> tasks = new HashSet>(gridSize); + Set> tasks = new HashSet>(gridSize); Collection result = new ArrayList(); @@ -71,8 +72,7 @@ public class TaskExecutorPartitionHandler implements PartitionHandler, Initializ ExitStatus exitStatus = ExitStatus.FAILED .addExitDescription("TaskExecutor rejected the task for this step."); /* - * This stepExecution hasn't been saved yet, but we'll set the - * status anyway in case the caller is tracking it through the + * Set the status in case the caller is tracking it through the * JobExecution. */ stepExecution.setStatus(BatchStatus.FAILED); @@ -82,8 +82,7 @@ public class TaskExecutorPartitionHandler implements PartitionHandler, Initializ } - for (FutureTask task : tasks) { - // TODO: timeout / heart beat + for (Future task : tasks) { result.add(task.get()); } return result; diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/JobRepository.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/JobRepository.java index 76ca5e21f..c4990b69a 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/JobRepository.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/JobRepository.java @@ -54,7 +54,7 @@ public interface JobRepository { * returned in a new {@link JobInstance}, associated with the * {@link JobExecution}. If no previous instance is found, the execution * will be associated with a new {@link JobInstance} - * @param jobName TODO + * @param jobName the name of the job that is to be executed * @param jobParameters the runtime parameters for the job * * @return a valid job {@link JobExecution} for the arguments provided diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcJobInstanceDao.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcJobInstanceDao.java index 31d7c4933..8200d1cfb 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcJobInstanceDao.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcJobInstanceDao.java @@ -53,9 +53,9 @@ public class JdbcJobInstanceDao extends AbstractJdbcBatchMetadataDao implements private static final String FIND_JOBS_WITH_EMPTY_KEY = "SELECT JOB_INSTANCE_ID, JOB_NAME from %PREFIX%JOB_INSTANCE where JOB_NAME = ? and (JOB_KEY = ? OR JOB_KEY is NULL)"; private static final String GET_JOB_FROM_ID = "SELECT JOB_INSTANCE_ID, JOB_NAME, JOB_KEY, VERSION from %PREFIX%JOB_INSTANCE where JOB_INSTANCE_ID = ?"; - - private static final String GET_JOB_FROM_EXECUTION_ID = "SELECT ji.JOB_INSTANCE_ID, JOB_NAME, JOB_KEY, ji.VERSION from %PREFIX%JOB_INSTANCE ji, " + - "%PREFIX%JOB_EXECUTION je where JOB_EXECUTION_ID = ? and ji.JOB_INSTANCE_ID = je.JOB_INSTANCE_ID"; + + private static final String GET_JOB_FROM_EXECUTION_ID = "SELECT ji.JOB_INSTANCE_ID, JOB_NAME, JOB_KEY, ji.VERSION from %PREFIX%JOB_INSTANCE ji, " + + "%PREFIX%JOB_EXECUTION je where JOB_EXECUTION_ID = ? and ji.JOB_INSTANCE_ID = je.JOB_INSTANCE_ID"; private static final String FIND_PARAMS_FROM_ID = "SELECT JOB_INSTANCE_ID, KEY_NAME, TYPE_CD, " + "STRING_VAL, DATE_VAL, LONG_VAL, DOUBLE_VAL from %PREFIX%JOB_PARAMS where JOB_INSTANCE_ID = ?"; @@ -182,7 +182,10 @@ public class JdbcJobInstanceDao extends AbstractJdbcBatchMetadataDao implements /* * (non-Javadoc) - * @see org.springframework.batch.core.repository.dao.JobInstanceDao#getJobInstance(java.lang.Long) + * + * @see + * org.springframework.batch.core.repository.dao.JobInstanceDao#getJobInstance + * (java.lang.Long) */ public JobInstance getJobInstance(Long instanceId) { @@ -217,7 +220,7 @@ public class JdbcJobInstanceDao extends AbstractJdbcBatchMetadataDao implements else if (type == ParameterType.DATE) { value = new JobParameter(rs.getTimestamp(5)); } - // TODO: assert that value is not null? + // No need to assert that value is not null because it's an enum map.put(rs.getString(2), value); } }; @@ -228,7 +231,10 @@ public class JdbcJobInstanceDao extends AbstractJdbcBatchMetadataDao implements /* * (non-Javadoc) - * @see org.springframework.batch.core.repository.dao.JobInstanceDao#getJobNames() + * + * @see + * org.springframework.batch.core.repository.dao.JobInstanceDao#getJobNames + * () */ public List getJobNames() { return getJdbcTemplate().query(getQuery(FIND_JOB_NAMES), new ParameterizedRowMapper() { @@ -240,8 +246,9 @@ public class JdbcJobInstanceDao extends AbstractJdbcBatchMetadataDao implements /* * (non-Javadoc) - * @see org.springframework.batch.core.repository.dao.JobInstanceDao#getLastJobInstances(java.lang.String, - * int) + * + * @seeorg.springframework.batch.core.repository.dao.JobInstanceDao# + * getLastJobInstances(java.lang.String, int) */ public List getLastJobInstances(String jobName, final int count) { @@ -267,14 +274,19 @@ public class JdbcJobInstanceDao extends AbstractJdbcBatchMetadataDao implements return result; } - - /* (non-Javadoc) - * @see org.springframework.batch.core.repository.dao.JobInstanceDao#getJobInstance(org.springframework.batch.core.JobExecution) + + /* + * (non-Javadoc) + * + * @see + * org.springframework.batch.core.repository.dao.JobInstanceDao#getJobInstance + * (org.springframework.batch.core.JobExecution) */ public JobInstance getJobInstance(JobExecution jobExecution) { - + try { - return getJdbcTemplate().queryForObject(getQuery(GET_JOB_FROM_EXECUTION_ID), new JobInstanceRowMapper(), jobExecution.getId()); + return getJdbcTemplate().queryForObject(getQuery(GET_JOB_FROM_EXECUTION_ID), new JobInstanceRowMapper(), + jobExecution.getId()); } catch (EmptyResultDataAccessException e) { return null; @@ -303,18 +315,17 @@ public class JdbcJobInstanceDao extends AbstractJdbcBatchMetadataDao implements private final class JobInstanceRowMapper implements ParameterizedRowMapper { private JobParameters jobParameters; - + public JobInstanceRowMapper() { } - + public JobInstanceRowMapper(JobParameters jobParameters) { this.jobParameters = jobParameters; } - - + public JobInstance mapRow(ResultSet rs, int rowNum) throws SQLException { Long id = rs.getLong(1); - if(jobParameters == null){ + if (jobParameters == null) { jobParameters = getJobParameters(id); } JobInstance jobInstance = new JobInstance(rs.getLong(1), jobParameters, rs.getString(2)); diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/scope/StepScope.java b/spring-batch-core/src/main/java/org/springframework/batch/core/scope/StepScope.java index f219b6d83..0efc8724e 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/scope/StepScope.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/scope/StepScope.java @@ -228,7 +228,8 @@ public class StepScope implements Scope, BeanFactoryPostProcessor, Ordered { private static BeanDefinitionHolder createScopedProxy(String beanName, BeanDefinition definition, BeanDefinitionRegistry registry, boolean proxyTargetClass) { - // TODO: detect presence of Spring 3.0 and use ScopedPoxyUtils instead + // TODO: (for Batch 2.1) detect presence of Spring 3.0 and use + // ScopedPoxyUtils instead // Create the scoped proxy... BeanDefinitionHolder proxyHolder = PlaceholderProxyFactoryBean.createScopedProxy(new BeanDefinitionHolder( diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/scope/context/StepScopeManager.java b/spring-batch-core/src/main/java/org/springframework/batch/core/scope/context/StepScopeManager.java index 28caa6944..d07057e32 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/scope/context/StepScopeManager.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/scope/context/StepScopeManager.java @@ -14,7 +14,6 @@ import org.springframework.batch.core.StepExecution; * @author Dave Syer * */ -// TODO: bin this? @Aspect public class StepScopeManager { diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/TestIncrementer.java b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/TestIncrementer.java index bb665dfb2..5363f60b4 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/TestIncrementer.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/TestIncrementer.java @@ -6,7 +6,6 @@ import org.springframework.batch.core.JobParametersIncrementer; public class TestIncrementer implements JobParametersIncrementer{ public JobParameters getNext(JobParameters parameters) { - // TODO Auto-generated method stub return null; } diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/listener/StepListenerMethodInterceptorTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/listener/StepListenerMethodInterceptorTests.java index daf00c04e..d4889f086 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/listener/StepListenerMethodInterceptorTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/listener/StepListenerMethodInterceptorTests.java @@ -106,24 +106,20 @@ public class StepListenerMethodInterceptorTests { } public Object[] getArguments() { - // TODO Auto-generated method stub return null; } public AccessibleObject getStaticPart() { - // TODO Auto-generated method stub return null; } public Object getThis() { - // TODO Auto-generated method stub return null; } public Object proceed() throws Throwable { - // TODO Auto-generated method stub return null; } } -} +} \ No newline at end of file diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/TaskletStepExceptionTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/TaskletStepExceptionTests.java index d8fbc830c..220912f83 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/TaskletStepExceptionTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/TaskletStepExceptionTests.java @@ -272,7 +272,6 @@ public class TaskletStepExceptionTests { } public JobExecution getLastJobExecution(String jobName, JobParameters jobParameters) { - // TODO Auto-generated method stub return null; } }