findbugs fixes

This commit is contained in:
robokaso
2008-11-24 12:41:19 +00:00
parent 3b71ae63fd
commit 690437e41a
5 changed files with 4 additions and 9 deletions

View File

@@ -76,7 +76,7 @@ public class CustomItemReaderTests extends TestCase {
assertEquals("2", itemReader.read());
}
public class CustomItemReader<T> implements ItemReader<T>, ItemStream {
public static class CustomItemReader<T> implements ItemReader<T>, ItemStream {
List<T> items;
int currentIndex = 0;
@@ -97,7 +97,7 @@ public class CustomItemReaderTests extends TestCase {
public void open(ExecutionContext executionContext) throws ItemStreamException {
if(executionContext.containsKey(CURRENT_INDEX)){
currentIndex = new Long(executionContext.getLong(CURRENT_INDEX)).intValue();
currentIndex = executionContext.getInt(CURRENT_INDEX);
}
else{
currentIndex = 0;
@@ -107,7 +107,7 @@ public class CustomItemReaderTests extends TestCase {
public void close(ExecutionContext executionContext) throws ItemStreamException {}
public void update(ExecutionContext executionContext) throws ItemStreamException {
executionContext.putLong(CURRENT_INDEX, new Long(currentIndex).longValue());
executionContext.putInt(CURRENT_INDEX, currentIndex);
};
}

View File

@@ -45,7 +45,7 @@ public class CustomItemWriterTests {
assertEquals(3, itemWriter.getOutput().size());
}
public class CustomItemWriter<T> implements ItemWriter<T> {
public static class CustomItemWriter<T> implements ItemWriter<T> {
List<T> output = TransactionAwareProxyFactory.createTransactionalList();

View File

@@ -52,7 +52,6 @@ public class AggregateItemReaderTests {
Object result = provider.read();
// it should be collection of 3 strings "line"
assertTrue(result instanceof Collection);
Collection<?> lines = (Collection<?>) result;
assertEquals(3, lines.size());

View File

@@ -106,8 +106,6 @@ public class OrderItemReaderTests {
// verify result
assertNotNull(result);
// result should be Order
assertTrue(result instanceof Order);
// verify whether order is constructed correctly
// Order object should contain same instances as returned by mapper