diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/AbstractJobExplorerFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/AbstractJobExplorerFactoryBean.java index a6219d8d1..06acf8d1a 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/AbstractJobExplorerFactoryBean.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/AbstractJobExplorerFactoryBean.java @@ -34,8 +34,7 @@ import org.springframework.beans.factory.FactoryBean; * @author Dave Syer * @since 2.0 */ -@SuppressWarnings("rawtypes") -public abstract class AbstractJobExplorerFactoryBean implements FactoryBean { +public abstract class AbstractJobExplorerFactoryBean implements FactoryBean { /** * @return fully configured {@link JobInstanceDao} implementation. diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/JobExplorerFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/JobExplorerFactoryBean.java index f60b57920..28978572e 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/JobExplorerFactoryBean.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/explore/support/JobExplorerFactoryBean.java @@ -16,8 +16,7 @@ package org.springframework.batch.core.explore.support; -import javax.sql.DataSource; - +import org.springframework.batch.core.explore.JobExplorer; import org.springframework.batch.core.repository.ExecutionContextSerializer; import org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao; import org.springframework.batch.core.repository.dao.ExecutionContextDao; @@ -39,6 +38,8 @@ import org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer import org.springframework.jdbc.support.lob.LobHandler; import org.springframework.util.Assert; +import javax.sql.DataSource; + /** * A {@link FactoryBean} that automates the creation of a * {@link SimpleJobExplorer} using JDBC DAO implementations. Requires the user @@ -71,7 +72,7 @@ implements InitializingBean { * A custom implementation of the {@link ExecutionContextSerializer}. * The default, if not injected, is the {@link XStreamExecutionContextStringSerializer}. * - * @param serializer + * @param serializer used to serialize/deserialize an {@link org.springframework.batch.item.ExecutionContext} * @see ExecutionContextSerializer */ public void setSerializer(ExecutionContextSerializer serializer) { @@ -91,7 +92,7 @@ implements InitializingBean { /** * Sets the table prefix for all the batch meta-data tables. * - * @param tablePrefix + * @param tablePrefix prefix for the batch meta-data tables */ public void setTablePrefix(String tablePrefix) { this.tablePrefix = tablePrefix; @@ -101,7 +102,7 @@ implements InitializingBean { * The lob handler to use when saving {@link ExecutionContext} instances. * Defaults to null which works for most databases. * - * @param lobHandler + * @param lobHandler Large object handler for saving {@link org.springframework.batch.item.ExecutionContext} */ public void setLobHandler(LobHandler lobHandler) { this.lobHandler = lobHandler; @@ -122,7 +123,7 @@ implements InitializingBean { } } - private Object getTarget() throws Exception { + private JobExplorer getTarget() throws Exception { return new SimpleJobExplorer(createJobInstanceDao(), createJobExecutionDao(), createStepExecutionDao(), createExecutionContextDao()); @@ -170,7 +171,7 @@ implements InitializingBean { } @Override - public Object getObject() throws Exception { + public JobExplorer getObject() throws Exception { return getTarget(); } } 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 b8df7e977..51799b918 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 @@ -16,6 +16,7 @@ package org.springframework.batch.core.explore.support; +import org.springframework.batch.core.explore.JobExplorer; import org.springframework.batch.core.repository.dao.ExecutionContextDao; import org.springframework.batch.core.repository.dao.JobExecutionDao; import org.springframework.batch.core.repository.dao.JobInstanceDao; @@ -39,7 +40,7 @@ public class MapJobExplorerFactoryBean extends AbstractJobExplorerFactoryBean im /** * Create an instance with the provided {@link MapJobRepositoryFactoryBean} * as a source of Dao instances. - * @param repositoryFactory + * @param repositoryFactory provides the used {@link org.springframework.batch.core.repository.JobRepository} */ public MapJobExplorerFactoryBean(MapJobRepositoryFactoryBean repositoryFactory) { this.repositoryFactory = repositoryFactory; @@ -92,7 +93,7 @@ public class MapJobExplorerFactoryBean extends AbstractJobExplorerFactoryBean im } @Override - public Object getObject() throws Exception { + public JobExplorer getObject() throws Exception { return new SimpleJobExplorer(createJobInstanceDao(), createJobExecutionDao(), createStepExecutionDao(), createExecutionContextDao()); } diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/explore/support/JobExplorerFactoryBeanTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/explore/support/JobExplorerFactoryBeanTests.java index 28a05bbac..746d24476 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/explore/support/JobExplorerFactoryBeanTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/explore/support/JobExplorerFactoryBeanTests.java @@ -15,17 +15,16 @@ */ package org.springframework.batch.core.explore.support; -import static junit.framework.Assert.assertTrue; -import static junit.framework.Assert.fail; -import static org.mockito.Mockito.mock; -import static org.junit.Assert.assertNotNull; - -import javax.sql.DataSource; - import org.junit.Before; import org.junit.Test; import org.springframework.batch.core.explore.JobExplorer; -import org.springframework.batch.core.explore.support.JobExplorerFactoryBean; + +import javax.sql.DataSource; + +import static junit.framework.Assert.assertTrue; +import static junit.framework.Assert.fail; +import static org.junit.Assert.assertNotNull; +import static org.mockito.Mockito.mock; /** * @author Dave Syer @@ -70,7 +69,7 @@ public class JobExplorerFactoryBeanTests { public void testCreateExplorer() throws Exception { factory.afterPropertiesSet(); - JobExplorer explorer = (JobExplorer) factory.getObject(); + JobExplorer explorer = factory.getObject(); assertNotNull(explorer); }