You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by tn...@apache.org on 2013/04/27 16:35:39 UTC

svn commit: r1476589 - in /commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4: IteratorUtils.java MapUtils.java iterators/ObjectGraphIterator.java list/CursorableLinkedList.java map/StaticBucketMap.java

Author: tn
Date: Sat Apr 27 14:35:38 2013
New Revision: 1476589

URL: http://svn.apache.org/r1476589
Log:
Fix PMD warnings.

Modified:
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/IteratorUtils.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/MapUtils.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/iterators/ObjectGraphIterator.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/list/CursorableLinkedList.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/StaticBucketMap.java

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/IteratorUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/IteratorUtils.java?rev=1476589&r1=1476588&r2=1476589&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/IteratorUtils.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/IteratorUtils.java Sat Apr 27 14:35:38 2013
@@ -1047,13 +1047,13 @@ public class IteratorUtils {
                     return it;
                 }
             }
-        } catch (final RuntimeException e) {
+        } catch (final RuntimeException e) { // NOPMD
             // ignore
-        } catch (final NoSuchMethodException e) {
+        } catch (final NoSuchMethodException e) { // NOPMD
             // ignore
-        } catch (final IllegalAccessException e) {
+        } catch (final IllegalAccessException e) { // NOPMD
             // ignore
-        } catch (final InvocationTargetException e) {
+        } catch (final InvocationTargetException e) { // NOPMD
             // ignore
         }
         return singletonIterator(obj);

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/MapUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/MapUtils.java?rev=1476589&r1=1476588&r2=1476589&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/MapUtils.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/MapUtils.java Sat Apr 27 14:35:38 2013
@@ -190,7 +190,7 @@ public class MapUtils {
                     try {
                         final String text = (String) answer;
                         return NumberFormat.getInstance().parse(text);
-                    } catch (final ParseException e) {
+                    } catch (final ParseException e) { // NOPMD
                         // failure means null is returned
                     }
                 }

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/iterators/ObjectGraphIterator.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/iterators/ObjectGraphIterator.java?rev=1476589&r1=1476588&r2=1476589&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/iterators/ObjectGraphIterator.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/iterators/ObjectGraphIterator.java Sat Apr 27 14:35:38 2013
@@ -138,7 +138,7 @@ public class ObjectGraphIterator<E> impl
             return;
         }
         if (currentIterator == null) {
-            if (root == null) {
+            if (root == null) { // NOPMD
                 // do nothing, hasNext will be false
             } else {
                 if (transformer == null) {
@@ -191,11 +191,8 @@ public class ObjectGraphIterator<E> impl
             }
             findNext(next);
         }
-        if (hasNext) {
-            // next value found
-        } else if (stack.isEmpty()) {
-            // all iterators exhausted
-        } else {
+        // if we havn't found the next value and iterators are not yet exhausted
+        if (!hasNext && !stack.isEmpty()) {
             // current iterator exhausted, go up a level
             currentIterator = stack.pop();
             findNextByIterator(currentIterator);

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/list/CursorableLinkedList.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/list/CursorableLinkedList.java?rev=1476589&r1=1476588&r2=1476589&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/list/CursorableLinkedList.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/list/CursorableLinkedList.java Sat Apr 27 14:35:38 2013
@@ -431,7 +431,7 @@ public class CursorableLinkedList<E> ext
         public void remove() {
             // overridden, as the nodeRemoved() method updates the iterator
             // 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
                 // by the list or some other iterator
                 // by ignoring it, we keep this iterator independent from

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/StaticBucketMap.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/StaticBucketMap.java?rev=1476589&r1=1476588&r2=1476589&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/StaticBucketMap.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/StaticBucketMap.java Sat Apr 27 14:35:38 2013
@@ -150,7 +150,7 @@ public final class StaticBucketMap<K, V>
      *   the number of buckets.
      * </p>
      */
-    private final int getHash(final Object key) {
+    private int getHash(final Object key) {
         if (key == null) {
             return 0;
         }