Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 72867 invoked from network); 8 Apr 2008 22:01:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Apr 2008 22:01:10 -0000 Received: (qmail 38903 invoked by uid 500); 8 Apr 2008 22:01:06 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 38855 invoked by uid 500); 8 Apr 2008 22:01:06 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 38844 invoked by uid 99); 8 Apr 2008 22:01:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Apr 2008 15:01:06 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of knst.kolinko@gmail.com designates 74.125.46.154 as permitted sender) Received: from [74.125.46.154] (HELO yw-out-1718.google.com) (74.125.46.154) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Apr 2008 22:00:25 +0000 Received: by yw-out-1718.google.com with SMTP id 9so417713ywk.54 for ; Tue, 08 Apr 2008 15:00:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=hszmnxcHtAfokkGAAJBxmE5V76AZUs8a2rulzpEeYCo=; b=vdPRU6R0ZBgT1IqWYr3bEih176abqkRTqnjaCoklskQWathxPvnetoBPKEzqz57nkdjdc6LhMIxjW7xEzVXDvVArDtNI17O0Adon/Jr4nbOyYCWMj9aeJWx20cbIV2SMBMxJzLn2tUcYEm2BShFXs59tJNlNH1SM3QVlXtKR9SM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=b8aQD/Ry+4O7/6ogFlx+ZM0xo+Byni1u8v46GlFEEeiyyO3tr3RWtS/431+ecFJvVSRYIgS4kUqPZXBJlJbmD2ij5ZATdIRY7kK1RsnlTHurK4dhsHHcYkkoggpw0y9ISme8ZYi4dTlyro9PzANxuiqI/jhg/7xrln6aP9SG2NQ= Received: by 10.150.143.14 with SMTP id q14mr4313935ybd.44.1207692030035; Tue, 08 Apr 2008 15:00:30 -0700 (PDT) Received: by 10.150.139.15 with HTTP; Tue, 8 Apr 2008 15:00:29 -0700 (PDT) Message-ID: <427155180804081500u3dff65dvdfc3f50f6bf725fa@mail.gmail.com> Date: Wed, 9 Apr 2008 02:00:29 +0400 From: "Konstantin Kolinko" To: "Tomcat Developers List" Subject: Re: svn commit: r646076 - /tomcat/trunk/java/org/apache/el/lang/ELArithmetic.java In-Reply-To: <20080408212504.CA81C1A9832@eris.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080408212504.CA81C1A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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. >From the sources: o.a.el.lang.ELArithmetic.isNumberType() is used in o.a.el.lang.ELSupport.checkType() and that is used in o.a.jasper.compiler.Validator.checkXmlAttributes() Looking into Validator.checkXmlAttributes(), there is "expectedClass = JspUtil.toClass(expectedType, loader);" and the value returned by JspUtil.toClass() may be "long.class" or other primitive class. It is from reading the sources. Have not run it though. 2008/4/9 : > Modified: tomcat/trunk/java/org/apache/el/lang/ELArithmetic.java > URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/el/lang/ELArithmetic.java?rev=646076&r1=646075&r2=646076&view=diff > ============================================================================== > --- tomcat/trunk/java/org/apache/el/lang/ELArithmetic.java (original) > +++ tomcat/trunk/java/org/apache/el/lang/ELArithmetic.java Tue Apr 8 14:25:04 2008 > @@ -326,8 +326,8 @@ > return (obj != null && isNumberType(obj.getClass())); > } > > - public final static boolean isNumberType(final Class type) { > - return type == (java.lang.Long.class) || type == Long.TYPE || type == ... > + public final static boolean isNumberType(final Class type) { > + return (Number.class.isAssignableFrom(type)); > } > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org