tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r899769 - /tomcat/trunk/java/javax/el/ArrayELResolver.java
Date Fri, 15 Jan 2010 19:22:13 GMT
Author: markt
Date: Fri Jan 15 19:22:12 2010
New Revision: 899769

URL: http://svn.apache.org/viewvc?rev=899769&view=rev
Log:
Fix TCK failure. Trying to assign an object of the wrong type to an array should throw a ClassCaseException.

Modified:
    tomcat/trunk/java/javax/el/ArrayELResolver.java

Modified: tomcat/trunk/java/javax/el/ArrayELResolver.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/el/ArrayELResolver.java?rev=899769&r1=899768&r2=899769&view=diff
==============================================================================
--- tomcat/trunk/java/javax/el/ArrayELResolver.java (original)
+++ tomcat/trunk/java/javax/el/ArrayELResolver.java Fri Jan 15 19:22:12 2010
@@ -90,6 +90,14 @@
 
 			int idx = coerce(property);
 			checkBounds(base, idx);
+			if (value != null &&
+			        !base.getClass().getComponentType().isAssignableFrom(
+			                value.getClass())) {
+			    throw new ClassCastException(message(context,
+			            "objectNotAssignable",
+			            new Object[] {value.getClass().getName(),
+			            base.getClass().getComponentType().getName()}));
+			}
 			Array.set(base, idx, value);
 		}
 	}



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message