You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Kin-Man Chung <Ki...@Eng.Sun.COM> on 2001/09/20 23:23:40 UTC

[PATCH] TC4.0 Throws NPE in JakartaCommentGenerator

This patch fixes the NPE raised when a jsp:useBean has a non empty body.
However, it does not "fix" the problem reported in #3740, since I couldn't
reproduce the same bug, though the test now works!


misto% runsocks cvs diff -u Parser.java
Index: Parser.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/P
arser.java,v
retrieving revision 1.13
diff -u -r1.13 Parser.java
--- Parser.java 2001/09/15 01:18:10     1.13
+++ Parser.java 2001/09/20 20:55:57
@@ -1096,11 +1096,12 @@
        boolean noJspElement = false;
        while (reader.hasMoreInput()) {
 
+            if (tmplStart == null)
+                tmplStart = reader.mark();
+            if (tmplStop == null)
+                tmplStop = reader.mark();
+
             if (until != null && reader.matches(until)) {
-                if (tmplStart == null)
-                    tmplStart = reader.mark();
-                if (tmplStop == null)
-                    tmplStop = reader.mark();
                 return;
             }