tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Konstantin Kolinko" <knst.koli...@gmail.com>
Subject Re: svn commit: r646076 - /tomcat/trunk/java/org/apache/el/lang/ELArithmetic.java
Date Wed, 09 Apr 2008 01:53:17 GMT
Surely, there are irregularities.

There are many places where java.lang.Class instance is not a
parameter to the method, but obtained in place by calling
obj.getClass().  In such cases comparing object's class against
primitive type classes is meaningless.

I've created a patch to clean them:
https://issues.apache.org/bugzilla/attachment.cgi?id=21797

Comparing against primitive types is only meaningful in method
isNumberType(Class) of ELArithmetic and several methods in ELSupport,
where the Class argument is passed explicitly.


What is the history of this code before rev. 389146 of 2006-03-27 when
/tomcat/tc6.0.x/trunk was created?


2008/4/9 Mark Thomas <markt@apache.org>:
> Konstantin Kolinko wrote:
>
> > Well, obviously the new code is not equivalent to the old one, because
> > Long.TYPE and other TYPE constants are the classes for the primitive
> > types (long, int etc.), and those are not an instance of
> > java.lang.Number.
> >
>
>  Yep my bad. I mis-read what my IDE was telling me. That explains some of
> the original code but not all of it. Any ideas?
>
>  Mark
>
>
>  PS Better patch to follow shortly.
>
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>  For additional commands, e-mail: dev-help@tomcat.apache.org
>
>

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


Mime
View raw message