diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/interceptor/RepeatOperationsInterceptorTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/interceptor/RepeatOperationsInterceptorTests.java index 7b10e551d..2ca42bef6 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/interceptor/RepeatOperationsInterceptorTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/interceptor/RepeatOperationsInterceptorTests.java @@ -66,7 +66,7 @@ public class RepeatOperationsInterceptorTests extends TestCase { } public void testSetTemplate() throws Exception { - final List calls = new ArrayList(); + final List calls = new ArrayList(); interceptor.setRepeatOperations(new RepeatOperations() { public ExitStatus iterate(RepeatCallback callback) { try { @@ -85,7 +85,7 @@ public class RepeatOperationsInterceptorTests extends TestCase { } public void testCallbackNotExecuted() throws Exception { - final List calls = new ArrayList(); + final List calls = new ArrayList(); interceptor.setRepeatOperations(new RepeatOperations() { public ExitStatus iterate(RepeatCallback callback) { calls.add(null); @@ -157,7 +157,7 @@ public class RepeatOperationsInterceptorTests extends TestCase { public void testInterceptorChainWithRetry() throws Exception { ((Advised) service).addAdvice(interceptor); - final List list = new ArrayList(); + final List list = new ArrayList(); ((Advised) service).addAdvice(new MethodInterceptor() { public Object invoke(MethodInvocation invocation) throws Throwable { list.add("chain"); diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/listener/CompositeRepeatListenerTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/listener/CompositeRepeatListenerTests.java index 838c950c0..bb990a163 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/listener/CompositeRepeatListenerTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/listener/CompositeRepeatListenerTests.java @@ -33,7 +33,7 @@ public class CompositeRepeatListenerTests extends TestCase { private CompositeRepeatListener listener = new CompositeRepeatListener(); private RepeatContext context = new RepeatContextSupport(null); - private List list = new ArrayList(); + private List list = new ArrayList(); /** * Test method for {@link CompositeRepeatListener#setListeners(RepeatListener[])}. diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/listener/RepeatListenerTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/listener/RepeatListenerTests.java index 7260928ca..6ef18e118 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/listener/RepeatListenerTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/listener/RepeatListenerTests.java @@ -35,7 +35,7 @@ public class RepeatListenerTests extends TestCase { public void testBeforeInterceptors() throws Exception { RepeatTemplate template = new RepeatTemplate(); - final List calls = new ArrayList(); + final List calls = new ArrayList(); template.setListeners(new RepeatListener[] { new RepeatListenerSupport() { public void before(RepeatContext context) { calls.add("1"); @@ -61,7 +61,7 @@ public class RepeatListenerTests extends TestCase { public void testBeforeInterceptorCanVeto() throws Exception { RepeatTemplate template = new RepeatTemplate(); - final List calls = new ArrayList(); + final List calls = new ArrayList(); template.registerListener(new RepeatListenerSupport() { public void before(RepeatContext context) { calls.add("1"); @@ -81,7 +81,7 @@ public class RepeatListenerTests extends TestCase { public void testAfterInterceptors() throws Exception { RepeatTemplate template = new RepeatTemplate(); - final List calls = new ArrayList(); + final List calls = new ArrayList(); template.setListeners(new RepeatListener[] { new RepeatListenerSupport() { public void after(RepeatContext context, ExitStatus result) { calls.add("1"); @@ -105,7 +105,7 @@ public class RepeatListenerTests extends TestCase { public void testOpenInterceptors() throws Exception { RepeatTemplate template = new RepeatTemplate(); - final List calls = new ArrayList(); + final List calls = new ArrayList(); template.setListeners(new RepeatListener[] { new RepeatListenerSupport() { public void open(RepeatContext context) { calls.add("1"); @@ -128,7 +128,7 @@ public class RepeatListenerTests extends TestCase { public void testSingleOpenInterceptor() throws Exception { RepeatTemplate template = new RepeatTemplate(); - final List calls = new ArrayList(); + final List calls = new ArrayList(); template.registerListener(new RepeatListenerSupport() { public void open(RepeatContext context) { calls.add("1"); @@ -147,7 +147,7 @@ public class RepeatListenerTests extends TestCase { public void testCloseInterceptors() throws Exception { RepeatTemplate template = new RepeatTemplate(); - final List calls = new ArrayList(); + final List calls = new ArrayList(); template.setListeners(new RepeatListener[] { new RepeatListenerSupport() { public void close(RepeatContext context) { calls.add("1"); @@ -172,7 +172,7 @@ public class RepeatListenerTests extends TestCase { public void testOnErrorInterceptors() throws Exception { RepeatTemplate template = new RepeatTemplate(); - final List calls = new ArrayList(); + final List calls = new ArrayList(); template.setListeners(new RepeatListener[] { new RepeatListenerSupport() { public void onError(RepeatContext context, Throwable t) { calls.add("1"); @@ -199,7 +199,7 @@ public class RepeatListenerTests extends TestCase { public void testOnErrorInterceptorsPrecedence() throws Exception { RepeatTemplate template = new RepeatTemplate(); - final List calls = new ArrayList(); + final List calls = new ArrayList(); template.setListeners(new RepeatListener[] { new RepeatListenerSupport() { public void after(RepeatContext context, ExitStatus result) { calls.add("1"); @@ -228,8 +228,8 @@ public class RepeatListenerTests extends TestCase { public void testAsynchronousOnErrorInterceptorsPrecedence() throws Exception { TaskExecutorRepeatTemplate template = new TaskExecutorRepeatTemplate(); template.setTaskExecutor(new SimpleAsyncTaskExecutor()); - final List calls = new ArrayList(); - final List fails = new ArrayList(); + final List calls = new ArrayList(); + final List fails = new ArrayList(); template.setListeners(new RepeatListener[] { new RepeatListenerSupport() { public void after(RepeatContext context, ExitStatus result) { calls.add("1"); diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/AsynchronousRepeatTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/AsynchronousRepeatTests.java index ec4a38cd1..eb3927409 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/AsynchronousRepeatTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/AsynchronousRepeatTests.java @@ -39,7 +39,7 @@ public class AsynchronousRepeatTests extends AbstractTradeBatchTests { template.setTaskExecutor(new SimpleAsyncTaskExecutor()); final String threadName = Thread.currentThread().getName(); - final Set threadNames = new HashSet(); + final Set threadNames = new HashSet(); final RepeatCallback callback = new RepeatCallback() { public ExitStatus doInIteration(RepeatContext context) throws Exception { @@ -75,7 +75,7 @@ public class AsynchronousRepeatTests extends AbstractTradeBatchTests { jobTemplate.setTaskExecutor(taskExecutor); final String threadName = Thread.currentThread().getName(); - final Set threadNames = new HashSet(); + final Set threadNames = new HashSet(); final RepeatCallback stepCallback = new ItemReaderRepeatCallback(provider, processor) { public ExitStatus doInIteration(RepeatContext context) throws Exception { diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/SimpleRepeatTemplateTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/SimpleRepeatTemplateTests.java index 2e959e39c..2154e7ffe 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/SimpleRepeatTemplateTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/support/SimpleRepeatTemplateTests.java @@ -96,7 +96,7 @@ public class SimpleRepeatTemplateTests extends AbstractTradeBatchTests { */ public void testContextClosedOnNormalCompletion() throws Exception { - final List list = new ArrayList(); + final List list = new ArrayList(); final RepeatContext context = new RepeatContextSupport(null) { public void close() { @@ -128,7 +128,7 @@ public class SimpleRepeatTemplateTests extends AbstractTradeBatchTests { */ public void testContextClosedOnAbnormalCompletion() throws Exception { - final List list = new ArrayList(); + final List list = new ArrayList(); final RepeatContext context = new RepeatContextSupport(null) { public void close() { @@ -166,7 +166,7 @@ public class SimpleRepeatTemplateTests extends AbstractTradeBatchTests { */ public void testExceptionHandlerCalledOnAbnormalCompletion() throws Exception { - final List list = new ArrayList(); + final List list = new ArrayList(); template.setExceptionHandler(new ExceptionHandler() { public void handleException(RepeatContext context, Throwable throwable) throws RuntimeException { diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/backoff/DummySleeper.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/backoff/DummySleeper.java index cf0991079..7cc3cba64 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/backoff/DummySleeper.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/backoff/DummySleeper.java @@ -27,21 +27,21 @@ import java.util.List; */ public class DummySleeper implements Sleeper { - private List backOffs = new ArrayList(); + private List backOffs = new ArrayList(); /** * Public getter for the long. * @return the lastBackOff */ public long getLastBackOff() { - return ((Long) backOffs.get(backOffs.size()-1)).longValue(); + return backOffs.get(backOffs.size()-1).longValue(); } public long[] getBackOffs() { long[] result = new long[backOffs.size()]; int i = 0; - for (Iterator iterator = backOffs.iterator(); iterator.hasNext();) { - Long value = (Long) iterator.next(); + for (Iterator iterator = backOffs.iterator(); iterator.hasNext();) { + Long value = iterator.next(); result[i++] =value.longValue(); } return result ; diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/callback/RecoveryRetryCallbackTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/callback/RecoveryRetryCallbackTests.java index 24cbda858..2b73a78fe 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/callback/RecoveryRetryCallbackTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/callback/RecoveryRetryCallbackTests.java @@ -32,7 +32,7 @@ import org.springframework.batch.retry.support.RetryTemplate; public class RecoveryRetryCallbackTests extends TestCase { - List calls = new ArrayList(); + List calls = new ArrayList(); int count = 0; diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/interceptor/RetryOperationsInterceptorTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/interceptor/RetryOperationsInterceptorTests.java index de2829516..657e4df1e 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/interceptor/RetryOperationsInterceptorTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/interceptor/RetryOperationsInterceptorTests.java @@ -67,7 +67,7 @@ public class RetryOperationsInterceptorTests extends TestCase { public void testInterceptorChainWithRetry() throws Exception { ((Advised) service).addAdvice(interceptor); - final List list = new ArrayList(); + final List list = new ArrayList(); ((Advised) service).addAdvice(new MethodInterceptor() { public Object invoke(MethodInvocation invocation) throws Throwable { list.add("chain"); diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/interceptor/StatefulRetryOperationsInterceptorTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/interceptor/StatefulRetryOperationsInterceptorTests.java index 7a7fa3cd5..e60c9f68f 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/interceptor/StatefulRetryOperationsInterceptorTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/interceptor/StatefulRetryOperationsInterceptorTests.java @@ -96,7 +96,7 @@ public class StatefulRetryOperationsInterceptorTests extends TestCase { public void testInterceptorChainWithRetry() throws Exception { ((Advised) service).addAdvice(interceptor); - final List list = new ArrayList(); + final List list = new ArrayList(); ((Advised) service).addAdvice(new MethodInterceptor() { public Object invoke(MethodInvocation invocation) throws Throwable { list.add("chain"); @@ -130,7 +130,7 @@ public class StatefulRetryOperationsInterceptorTests extends TestCase { assertTrue("Wrong message: " + message, message.startsWith("Not enough calls")); } assertEquals(1, count); - Collection result = transformer.transform("foo"); + Collection result = transformer.transform("foo"); assertEquals(2, count); assertEquals(1, result.size()); } @@ -198,7 +198,7 @@ public class StatefulRetryOperationsInterceptorTests extends TestCase { return Collections.singleton(data); } }); - Collection result = transformer.transform("foo"); + Collection result = transformer.transform("foo"); assertEquals(2, count); assertEquals(1, result.size()); } @@ -219,12 +219,12 @@ public class StatefulRetryOperationsInterceptorTests extends TestCase { } public static interface Transformer { - Collection transform(String in) throws Exception; + Collection transform(String in) throws Exception; } public static class TransformerImpl implements Transformer { - public Collection transform(String in) throws Exception { + public Collection transform(String in) throws Exception { count++; if (count < 2) { throw new Exception("Not enough calls: " + count); diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/listener/RetryListenerTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/listener/RetryListenerTests.java index 7e0289534..452d2c14e 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/listener/RetryListenerTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/listener/RetryListenerTests.java @@ -34,7 +34,7 @@ public class RetryListenerTests extends TestCase { int count = 0; - List list = new ArrayList(); + List list = new ArrayList(); public void testOpenInterceptors() throws Exception { template.setListeners(new RetryListener[] { new RetryListenerSupport() { diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/policy/CompositeRetryPolicyTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/policy/CompositeRetryPolicyTests.java index 22dfea6e6..ea315c9df 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/policy/CompositeRetryPolicyTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/policy/CompositeRetryPolicyTests.java @@ -75,7 +75,7 @@ public class CompositeRetryPolicyTests extends TestCase { } public void testNonTrivialPoliciesClose() throws Exception { - final List list = new ArrayList(); + final List list = new ArrayList(); CompositeRetryPolicy policy = new CompositeRetryPolicy(); policy.setPolicies(new RetryPolicy[] { new MockRetryPolicySupport() { public void close(RetryContext context) { @@ -93,7 +93,7 @@ public class CompositeRetryPolicyTests extends TestCase { } public void testExceptionOnPoliciesClose() throws Exception { - final List list = new ArrayList(); + final List list = new ArrayList(); CompositeRetryPolicy policy = new CompositeRetryPolicy(); policy.setPolicies(new RetryPolicy[] { new MockRetryPolicySupport() { public void close(RetryContext context) { diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/policy/ExceptionClassifierRetryPolicyTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/policy/ExceptionClassifierRetryPolicyTests.java index a626d3966..bc455fd41 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/policy/ExceptionClassifierRetryPolicyTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/policy/ExceptionClassifierRetryPolicyTests.java @@ -44,7 +44,7 @@ public class ExceptionClassifierRetryPolicyTests extends TestCase { } public void testNullPolicies() throws Exception { - policy.setPolicyMap(new HashMap()); + policy.setPolicyMap(new HashMap()); try { policy.open(null, null); fail("Expected IllegalArgumentException"); @@ -55,7 +55,7 @@ public class ExceptionClassifierRetryPolicyTests extends TestCase { } public void testNullContext() throws Exception { - Map map = new HashMap(); + Map map = new HashMap(); map.put(ExceptionClassifierSupport.DEFAULT, new NeverRetryPolicy()); policy.setPolicyMap(map); @@ -67,7 +67,7 @@ public class ExceptionClassifierRetryPolicyTests extends TestCase { public void testClassifierOperates() throws Exception { - Map map = new HashMap(); + Map map = new HashMap(); map.put(ExceptionClassifierSupport.DEFAULT, new AlwaysRetryPolicy()); map.put("foo", new NeverRetryPolicy()); policy.setPolicyMap(map); diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/policy/RecoveryRetryPolicyTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/policy/RecoveryRetryPolicyTests.java index 1b76b54e5..ac62ab0e5 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/policy/RecoveryRetryPolicyTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/retry/policy/RecoveryRetryPolicyTests.java @@ -37,7 +37,7 @@ public class RecoveryRetryPolicyTests extends TestCase { private int count = 0; - private List list = new ArrayList(); + private List list = new ArrayList(); public void testOpenSunnyDay() throws Exception { diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/SubclassExceptionClassifierTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/SubclassExceptionClassifierTests.java index 478384260..bc80df59c 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/SubclassExceptionClassifierTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/SubclassExceptionClassifierTests.java @@ -69,7 +69,7 @@ public class SubclassExceptionClassifierTests extends TestCase { } public void testClassifyAncestorMatch() { - classifier.setTypeMap(new LinkedHashMap() {{ + classifier.setTypeMap(new LinkedHashMap, String>() {{ put(Exception.class, "bar"); put(IllegalArgumentException.class, "foo"); put(RuntimeException.class, "bucket"); diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/transaction/TransactionAwareListFactoryTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/transaction/TransactionAwareListFactoryTests.java index 00a545b6e..2ba3c81ab 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/transaction/TransactionAwareListFactoryTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/transaction/TransactionAwareListFactoryTests.java @@ -32,10 +32,11 @@ public class TransactionAwareListFactoryTests extends TestCase { TransactionTemplate transactionTemplate = new TransactionTemplate(new ResourcelessTransactionManager()); - List list; + List list; + @SuppressWarnings("unchecked") protected void setUp() throws Exception { - list = (List) factory.createInstance(); + list = (List) factory.createInstance(); } public void testAdd() { diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/transaction/TransactionAwareMapFactoryTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/transaction/TransactionAwareMapFactoryTests.java index baefd006a..50995684b 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/transaction/TransactionAwareMapFactoryTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/transaction/TransactionAwareMapFactoryTests.java @@ -31,15 +31,16 @@ public class TransactionAwareMapFactoryTests extends TestCase { TransactionTemplate transactionTemplate = new TransactionTemplate(new ResourcelessTransactionManager()); - Map map; + Map map; + @SuppressWarnings("unchecked") protected void setUp() throws Exception { - Map seed = new HashMap(); + Map seed = new HashMap(); seed.put("foo", "oof"); seed.put("bar", "bar"); seed.put("spam", "maps"); factory = new TransactionAwareProxyFactory(seed); - map = (Map) factory.createInstance(); + map = (Map) factory.createInstance(); } public void testAdd() { diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/transaction/TransactionAwareProxyFactoryTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/transaction/TransactionAwareProxyFactoryTests.java index d5ff8d343..f8b12ab56 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/transaction/TransactionAwareProxyFactoryTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/transaction/TransactionAwareProxyFactoryTests.java @@ -22,22 +22,23 @@ import java.util.Set; import junit.framework.TestCase; +@SuppressWarnings("unchecked") public class TransactionAwareProxyFactoryTests extends TestCase { - + public void testCreateList() throws Exception { - List list = TransactionAwareProxyFactory.createTransactionalList(); + List list = TransactionAwareProxyFactory.createTransactionalList(); list.add("foo"); assertEquals(1, list.size()); } public void testCreateSet() throws Exception { - Set set = TransactionAwareProxyFactory.createTransactionalSet(); + Set set = TransactionAwareProxyFactory.createTransactionalSet(); set.add("foo"); assertEquals(1, set.size()); } public void testCreateMap() throws Exception { - Map map = TransactionAwareProxyFactory.createTransactionalMap(); + Map map = TransactionAwareProxyFactory.createTransactionalMap(); map.put("foo", "bar"); assertEquals(1, map.size()); } diff --git a/spring-batch-infrastructure/src/test/java/test/jdbc/datasource/InitializingDataSourceFactoryBean.java b/spring-batch-infrastructure/src/test/java/test/jdbc/datasource/InitializingDataSourceFactoryBean.java index b5e410af7..c4cf618d7 100644 --- a/spring-batch-infrastructure/src/test/java/test/jdbc/datasource/InitializingDataSourceFactoryBean.java +++ b/spring-batch-infrastructure/src/test/java/test/jdbc/datasource/InitializingDataSourceFactoryBean.java @@ -17,7 +17,6 @@ package test.jdbc.datasource; import java.io.IOException; -import java.util.Iterator; import java.util.List; import javax.sql.DataSource; @@ -99,6 +98,7 @@ public class InitializingDataSourceFactoryBean extends AbstractFactoryBean { TransactionTemplate transactionTemplate = new TransactionTemplate(new DataSourceTransactionManager(dataSource)); transactionTemplate.execute(new TransactionCallback() { + @SuppressWarnings("unchecked") public Object doInTransaction(TransactionStatus status) { JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); String[] scripts; @@ -122,10 +122,9 @@ public class InitializingDataSourceFactoryBean extends AbstractFactoryBean { } - private String stripComments(List list) { + private String stripComments(List list) { StringBuffer buffer = new StringBuffer(); - for (Iterator iter = list.iterator(); iter.hasNext();) { - String line = (String) iter.next(); + for (String line : list) { if (!line.startsWith("//") && !line.startsWith("--")) { buffer.append(line + "\n"); } @@ -133,7 +132,7 @@ public class InitializingDataSourceFactoryBean extends AbstractFactoryBean { return buffer.toString(); } - public Class getObjectType() { + public Class getObjectType() { return DataSource.class; }