You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mb...@apache.org on 2010/09/21 20:48:53 UTC

svn commit: r999539 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/AnnotationUtils.java

Author: mbenson
Date: Tue Sep 21 18:48:53 2010
New Revision: 999539

URL: http://svn.apache.org/viewvc?rev=999539&view=rev
Log:
move private method to end

Modified:
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/AnnotationUtils.java

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/AnnotationUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/AnnotationUtils.java?rev=999539&r1=999538&r2=999539&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/AnnotationUtils.java (original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/AnnotationUtils.java Tue Sep 21 18:48:53 2010
@@ -169,22 +169,6 @@ public class AnnotationUtils {
         return builder.build();
     }
 
-    //besides modularity, this has the advantage of autoboxing primitives:
-    private static int hashMember(String name, Object value) throws IllegalArgumentException,
-            IllegalAccessException, InvocationTargetException {
-        int part1 = name.hashCode() * 127;
-        if (value == null) {
-            return part1;
-        }
-        if (value.getClass().isArray()) {
-            return part1 ^ arrayMemberHash(value.getClass().getComponentType(), value);
-        }
-        if (value instanceof Annotation) {
-            return part1 ^ hashCode((Annotation) value);
-        }
-        return part1 ^ value.hashCode();
-    }
-
     /**
      * Learn whether the specified type is permitted as an annotation member.
      * These include {@link String}, {@link Class}, primitive types,
@@ -203,6 +187,22 @@ public class AnnotationUtils {
                 || String.class.equals(type) || Class.class.equals(type);
     }
 
+    //besides modularity, this has the advantage of autoboxing primitives:
+    private static int hashMember(String name, Object value) throws IllegalArgumentException,
+            IllegalAccessException, InvocationTargetException {
+        int part1 = name.hashCode() * 127;
+        if (value == null) {
+            return part1;
+        }
+        if (value.getClass().isArray()) {
+            return part1 ^ arrayMemberHash(value.getClass().getComponentType(), value);
+        }
+        if (value instanceof Annotation) {
+            return part1 ^ hashCode((Annotation) value);
+        }
+        return part1 ^ value.hashCode();
+    }
+
     private static boolean memberEquals(Class<?> type, Object o1, Object o2) {
         if (o1 == o2) {
             return true;