You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Remy Maucherat <re...@apache.org> on 2008/04/10 14:00:21 UTC

Re: svn commit: r646571 - in /tomcat/trunk/java/org/apache/el: lang/ELArithmetic.java lang/ELSupport.java parser/AstNegative.java

On Wed, 2008-04-09 at 22:29 +0000, markt@apache.org 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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r646571 - in /tomcat/trunk/java/org/apache/el: lang/ELArithmetic.java lang/ELSupport.java parser/AstNegative.java

Posted by Remy Maucherat <re...@apache.org>.
On Thu, 2008-04-10 at 19:01 +0100, Mark Thomas wrote:
> Remy Maucherat wrote:
> > On Wed, 2008-04-09 at 22:29 +0000, markt@apache.org 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
> > 
> > Possible problem: this class is apparently generated code. Not sure if
> > it should really be modified.
> 
> My preference is to keep the change. We can merge/overwrite if/when the 
> class is recreated. That said I am not going to die in a ditch over this 
> change.

Yes, keeping the change is better.

Rémy



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


Re: svn commit: r646571 - in /tomcat/trunk/java/org/apache/el: lang/ELArithmetic.java lang/ELSupport.java parser/AstNegative.java

Posted by Mark Thomas <ma...@apache.org>.
Remy Maucherat wrote:
> On Wed, 2008-04-09 at 22:29 +0000, markt@apache.org 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
> 
> Possible problem: this class is apparently generated code. Not sure if
> it should really be modified.

My preference is to keep the change. We can merge/overwrite if/when the 
class is recreated. That said I am not going to die in a ditch over this 
change.

Mark


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