From 4a6bde09a6559bc5163bbb362b73fb83ab45c280 Mon Sep 17 00:00:00 2001 From: Matthew Jason Benson Date: Tue, 21 Sep 2010 18:48:53 +0000 Subject: [PATCH] move private method to end git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@999539 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/commons/lang3/AnnotationUtils.java | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/main/java/org/apache/commons/lang3/AnnotationUtils.java b/src/main/java/org/apache/commons/lang3/AnnotationUtils.java index 6b5c18eea..9f0a9c92a 100644 --- a/src/main/java/org/apache/commons/lang3/AnnotationUtils.java +++ b/src/main/java/org/apache/commons/lang3/AnnotationUtils.java @@ -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;