Fix PMD warnings.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1476589 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Thomas Neidhart 2013-04-27 14:35:38 +00:00
parent cca574ea06
commit bca5b3c0ff
5 changed files with 10 additions and 13 deletions

View File

@ -1047,13 +1047,13 @@ public class IteratorUtils {
return it; return it;
} }
} }
} catch (final RuntimeException e) { } catch (final RuntimeException e) { // NOPMD
// ignore // ignore
} catch (final NoSuchMethodException e) { } catch (final NoSuchMethodException e) { // NOPMD
// ignore // ignore
} catch (final IllegalAccessException e) { } catch (final IllegalAccessException e) { // NOPMD
// ignore // ignore
} catch (final InvocationTargetException e) { } catch (final InvocationTargetException e) { // NOPMD
// ignore // ignore
} }
return singletonIterator(obj); return singletonIterator(obj);

View File

@ -190,7 +190,7 @@ public class MapUtils {
try { try {
final String text = (String) answer; final String text = (String) answer;
return NumberFormat.getInstance().parse(text); return NumberFormat.getInstance().parse(text);
} catch (final ParseException e) { } catch (final ParseException e) { // NOPMD
// failure means null is returned // failure means null is returned
} }
} }

View File

@ -138,7 +138,7 @@ public class ObjectGraphIterator<E> implements Iterator<E> {
return; return;
} }
if (currentIterator == null) { if (currentIterator == null) {
if (root == null) { if (root == null) { // NOPMD
// do nothing, hasNext will be false // do nothing, hasNext will be false
} else { } else {
if (transformer == null) { if (transformer == null) {
@ -191,11 +191,8 @@ public class ObjectGraphIterator<E> implements Iterator<E> {
} }
findNext(next); findNext(next);
} }
if (hasNext) { // if we havn't found the next value and iterators are not yet exhausted
// next value found if (!hasNext && !stack.isEmpty()) {
} else if (stack.isEmpty()) {
// all iterators exhausted
} else {
// current iterator exhausted, go up a level // current iterator exhausted, go up a level
currentIterator = stack.pop(); currentIterator = stack.pop();
findNextByIterator(currentIterator); findNextByIterator(currentIterator);

View File

@ -431,7 +431,7 @@ public class CursorableLinkedList<E> extends AbstractLinkedList<E> implements Se
public void remove() { public void remove() {
// overridden, as the nodeRemoved() method updates the iterator // overridden, as the nodeRemoved() method updates the iterator
// state in the parent.removeNode() call below // state in the parent.removeNode() call below
if (current == null && currentRemovedByAnother) { if (current == null && currentRemovedByAnother) { // NOPMD
// quietly ignore, as the last returned node was removed // quietly ignore, as the last returned node was removed
// by the list or some other iterator // by the list or some other iterator
// by ignoring it, we keep this iterator independent from // by ignoring it, we keep this iterator independent from

View File

@ -150,7 +150,7 @@ public final class StaticBucketMap<K, V> extends AbstractIterableMap<K, V> {
* the number of buckets. * the number of buckets.
* </p> * </p>
*/ */
private final int getHash(final Object key) { private int getHash(final Object key) {
if (key == null) { if (key == null) {
return 0; return 0;
} }