From 73d6d0095f5381c940cb9ebe47212719209f1abc Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Tue, 12 Aug 2008 22:19:46 +0000 Subject: [PATCH] removed unused code --- .../spel/reflection/ReflectionUtils.java | 72 ------------------- 1 file changed, 72 deletions(-) diff --git a/org.springframework.expression/src/main/java/org/springframework/expression/spel/reflection/ReflectionUtils.java b/org.springframework.expression/src/main/java/org/springframework/expression/spel/reflection/ReflectionUtils.java index 7b33b3bb62..e60238bb88 100644 --- a/org.springframework.expression/src/main/java/org/springframework/expression/spel/reflection/ReflectionUtils.java +++ b/org.springframework.expression/src/main/java/org/springframework/expression/spel/reflection/ReflectionUtils.java @@ -302,78 +302,6 @@ public class ReflectionUtils { } } - private static boolean isDouble(Class c) { - return c == Double.class || c == Double.TYPE; - } - - private static boolean isFloat(Class c) { - return c == Float.class || c == Float.TYPE; - } - - private static boolean isLong(Class c) { - return c == Long.class || c == Long.TYPE; - } - - private static boolean isInt(Class c) { - return c == Integer.class || c == Integer.TYPE; - } - - private static boolean isChar(Class c) { - return c == Character.class || c == Character.TYPE; - } - - private static boolean isShort(Class c) { - return c == Short.class || c == Short.TYPE; - } - - private static boolean isByte(Class c) { - return c == Byte.class || c == Byte.TYPE; - } - - /** - * Returns true if the input-type can be 'widened' to the target-type, according to the following allowed widenings: - * - * byte to short, int, long, float, or double
- * short to int, long, float, or double
- * char to int, long, float, or double
- * int to long, float, or double
- * long to float or double
- * float to double - */ - private static boolean isWidenableTo(Class targetType, Class inputType) { - if (inputType.isPrimitive()) { - if (inputType == Double.TYPE) { - return (isDouble(targetType)); - } else if (inputType == Long.TYPE) { - return (isDouble(targetType) || isFloat(targetType)); - } else if (inputType == Integer.TYPE) { - return isDouble(targetType) || isFloat(targetType) || isLong(targetType); - } else if (inputType == Character.TYPE) { - return isDouble(targetType) || isFloat(targetType) || isLong(targetType) || isInt(targetType); - } else if (inputType == Short.TYPE) { - return isDouble(targetType) || isFloat(targetType) || isLong(targetType) || isInt(targetType); - } else if (inputType == Byte.TYPE) { - return isDouble(targetType) || isFloat(targetType) || isLong(targetType) || isInt(targetType) - || isShort(targetType); - } - } else { - if (inputType == Double.class) { - return (isDouble(targetType)); - } else if (inputType == Long.class) { - return (isDouble(targetType) || isFloat(targetType)); - } else if (inputType == Integer.class) { - return isDouble(targetType) || isFloat(targetType) || isLong(targetType); - } else if (inputType == Character.class) { - return isDouble(targetType) || isFloat(targetType) || isLong(targetType) || isInt(targetType); - } else if (inputType == Short.class) { - return isDouble(targetType) || isFloat(targetType) || isLong(targetType) || isInt(targetType); - } else if (inputType == Byte.class) { - return isDouble(targetType) || isFloat(targetType) || isLong(targetType) || isInt(targetType) - || isShort(targetType); - } - } - return false; - } // TODO optimize impl private static boolean areBoxingCompatible(Class class1, Class class2) {