Date: Wed, 05 Sep 2001 14:22:21 -0700 (PDT)
From: Kin-Man Chung <[EMAIL PROTECTED]>
Subject: [PATH] Tag attributes of type char and short bug
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
MIME-version: 1.0
Content-transfer-encoding: 7BIT
Content-MD5: NTIF51okQsoUB2BTXXgn/Q==

This patch fixes 3366 and 3381.  This fix was provided by the submitter
[EMAIL PROTECTED]  This fix looks good.


Index: TagBeginGenerator.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/T
agBeginGenerator.java,v
retrieving revision 1.14
diff -u -r1.14 TagBeginGenerator.java
--- TagBeginGenerator.java      2001/07/23 19:57:32     1.14
+++ TagBeginGenerator.java      2001/09/05 21:05:28
@@ -260,7 +260,7 @@
             return "new Byte((byte)" + Byte.valueOf(s).toString() + ")";
         } else if (c == char.class) {
             // non-normative, because a normative method would fail to compile
-            if (s.length() > 1) {
+            if (s.length() > 0) {
                 char ch = s.charAt(0);
                 // this trick avoids escaping issues
                 return "((char) " + (int) ch + ")";
@@ -293,7 +293,7 @@
         } else if (c == Integer.class) {
             return "new Integer(" + Integer.valueOf(s).toString() + ")";
         } else if (c == short.class) {
-            return Short.valueOf(s).toString();
+            return "((short)" + Short.valueOf(s).toString() + ")";
         } else if (c == Short.class) {
             return "new Short(" + Short.valueOf(s).toString() + ")";
         } else if (c == long.class) {


Reply via email to