move private method to end

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@999539 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Matthew Jason Benson 2010-09-21 18:48:53 +00:00
parent bbdc0722a8
commit 4a6bde09a6
1 changed files with 16 additions and 16 deletions

View File

@ -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;