Move SuppressWarnings tag from for loop to method level to prevent compilation problems with IBM JDK 1.5

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1541722 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Thomas Neidhart 2013-11-13 21:14:15 +00:00
parent b34856498e
commit d73ff41fa1
2 changed files with 4 additions and 2 deletions

View File

@ -91,8 +91,9 @@ public class FilterIteratorTest<E> extends AbstractIteratorTest<E> {
}
}
@SuppressWarnings("unused")
public void testRepeatedNext() {
for (@SuppressWarnings("unused") final String element : array) {
for (final String element : array) {
iterator.next();
}
verifyNoMoreElements();

View File

@ -45,6 +45,7 @@ public class IteratorIterableTest extends BulkTest {
return iter;
}
@SuppressWarnings("unused")
public void testIterator() {
final Iterator<Integer> iter = createIterator();
final Iterable<Number> iterable = new IteratorIterable<Number>(iter);
@ -53,7 +54,7 @@ public class IteratorIterableTest extends BulkTest {
verifyIteration(iterable);
// second use
for (@SuppressWarnings("unused") final Number actual : iterable) {
for (final Number actual : iterable) {
fail("should not be able to iterate twice");
}
}