On Wed, 2008-04-09 at 22:29 +0000, [EMAIL PROTECTED] wrote:
> Author: markt
> Date: Wed Apr  9 15:29:28 2008
> New Revision: 646571
> 
> URL: http://svn.apache.org/viewvc?rev=646571&view=rev
> Log:
> Clean up type checking code. Patch provided by Konstantin Kolinko.
> 
> Modified:
>     tomcat/trunk/java/org/apache/el/parser/AstNegative.java

> Modified: tomcat/trunk/java/org/apache/el/parser/AstNegative.java
> URL: 
> http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/el/parser/AstNegative.java?rev=646571&r1=646570&r2=646571&view=diff
> ==============================================================================
> --- tomcat/trunk/java/org/apache/el/parser/AstNegative.java (original)
> +++ tomcat/trunk/java/org/apache/el/parser/AstNegative.java Wed Apr  9 
> 15:29:28 2008
> @@ -59,23 +59,22 @@
>              }
>              return new Long(-Long.parseLong((String) obj));
>          }
> -        Class type = obj.getClass();
> -        if (obj instanceof Long || Long.TYPE == type) {
> +        if (obj instanceof Long) {
>              return new Long(-((Long) obj).longValue());
>          }
> -        if (obj instanceof Double || Double.TYPE == type) {
> +        if (obj instanceof Double) {
>              return new Double(-((Double) obj).doubleValue());
>          }
> -        if (obj instanceof Integer || Integer.TYPE == type) {
> +        if (obj instanceof Integer) {
>              return new Integer(-((Integer) obj).intValue());
>          }
> -        if (obj instanceof Float || Float.TYPE == type) {
> +        if (obj instanceof Float) {
>              return new Float(-((Float) obj).floatValue());
>          }
> -        if (obj instanceof Short || Short.TYPE == type) {
> +        if (obj instanceof Short) {
>              return new Short((short) -((Short) obj).shortValue());
>          }
> -        if (obj instanceof Byte || Byte.TYPE == type) {
> +        if (obj instanceof Byte) {
>              return new Byte((byte) -((Byte) obj).byteValue());
>          }
>          Long num = (Long) coerceToNumber(obj, Long.class);

Possible problem: this class is apparently generated code. Not sure if
it should really be modified.

Rémy



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to