Author: aogburn
Date: 2013-01-21 13:47:40 -0500 (Mon, 21 Jan 2013)
New Revision: 2152
Modified:
branches/JBOSSWEB_7_0_17_FINAL_BZ-902421/java/org/apache/el/util/ReflectionUtil.java
branches/JBOSSWEB_7_0_17_FINAL_BZ-902421/test/build.properties.default
Log:
[BZ-902421] committing fix backported from AS7-3177
Modified:
branches/JBOSSWEB_7_0_17_FINAL_BZ-902421/java/org/apache/el/util/ReflectionUtil.java
===================================================================
---
branches/JBOSSWEB_7_0_17_FINAL_BZ-902421/java/org/apache/el/util/ReflectionUtil.java 2013-01-21
16:28:13 UTC (rev 2151)
+++
branches/JBOSSWEB_7_0_17_FINAL_BZ-902421/java/org/apache/el/util/ReflectionUtil.java 2013-01-21
18:47:40 UTC (rev 2152)
@@ -250,7 +250,6 @@
return match;
}
- @SuppressWarnings("null")
private static Method resolveAmbiguousMethod(Set<Method> candidates,
Class<?>[] paramTypes) {
// Identify which parameter isn't an exact match
@@ -267,6 +266,11 @@
}
}
+ if (nonMatchClass == null) {
+ // Null will always be ambiguous
+ return null;
+ }
+
for (Method c : candidates) {
if (c.getParameterTypes()[nonMatchIndex] ==
paramTypes[nonMatchIndex]) {
@@ -294,6 +298,12 @@
// src will always be an object
private static boolean isAssignableFrom(Class<?> src, Class<?> target) {
+ // Short-cut. null is always assignable to an object and in EL null
+ // can always be coerced to a valid value for a primitive
+ if (src == null) {
+ return true;
+ }
+
Class<?> targetClass;
if (target.isPrimitive()) {
if (target == Boolean.TYPE) {
@@ -334,7 +344,11 @@
if (types != null) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < types.length; i++) {
- sb.append(types[i].getName()).append(", ");
+ if (types[i] == null) {
+ sb.append("null, ");
+ } else {
+ sb.append(types[i].getName()).append(", ");
+ }
}
if (sb.length() > 2) {
sb.setLength(sb.length() - 2);
Modified: branches/JBOSSWEB_7_0_17_FINAL_BZ-902421/test/build.properties.default
===================================================================
--- branches/JBOSSWEB_7_0_17_FINAL_BZ-902421/test/build.properties.default 2013-01-21
16:28:13 UTC (rev 2151)
+++ branches/JBOSSWEB_7_0_17_FINAL_BZ-902421/test/build.properties.default 2013-01-21
18:47:40 UTC (rev 2152)
@@ -1,4 +1,5 @@
# junit stuff
+base.path=/home/aaron/Desktop/code/deps/JBossWeb7.0
junit.version=4.10
junit.jar.loc=http://kent.dl.sourceforge.net/sourceforge/junit/junit-${ju...
junit.jar=${base.path}/junit-${junit.version}/junit-${junit.version}.jar