Re: cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler Generator.java Node.java SmapStratum.java SmapUtil.java
But really, all this is more academic than useful in practice: who do you think may need to single step over template text lines? :-) No idea. I'm just trying to make sure Bugzilla 22006 stays fixed. On the other hand if you want to WONTFIX that bad boy, I guess I don't have any good grounds for objecting; the SMAP spec doesn't seem to say anywhere that SMAPs need to be complete (or even non-empty? Now there's a way to save ourselves a bunch of work...). I see from another message that you've committed a fix for this. I'll test your code when I get a chance. Eric - Original Message - From: Kin-Man Chung [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, September 22, 2003 1:00 PM Subject: Re: cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler Generator.java Node.java SmapStratum.java SmapUtil.java The actual mapping before we optimize the smap is 1:41 2:42 6:43 6:44 8:45 8:46 which looks OK to me. But since we only do the smap at the beginnig of the template text, and assume the the input line count is 1, the result is what you have noticed. I'll see if I can add some code to compute the input line ranges, but it is going to be messy. :( But really, all this is more academic than useful in practice: who do you think may need to single step over template text lines? :-) -Kin-man Date: Sat, 20 Sep 2003 00:18:14 -0700 From: Eric Carmichael [EMAIL PROTECTED] Subject: Re: cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler Generator.java Node.java SmapStratum.java SmapUtil.java X-Originating-IP: [64.203.49.21] To: Tomcat Developers List [EMAIL PROTECTED] X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Priority: 3 X-MSMail-priority: Normal X-Originating-Email: [EMAIL PROTECTED] X-OriginalArrivalTime: 20 Sep 2003 07:18:18.0787 (UTC) FILETIME=[5DB22F30:01C37F47] cal/cal1.jsp from the jsp-examples webapp starts like this: HTML !-- Copyright (c) 1999 The Apache Software Foundation. All rights reserved. -- HEADTITLE Before this commit, cal1.jsp's SMAP started like this: *L 1,2:41 3:42 4:42 5:42 6:43,2 Now it starts like this: *L 1,2:41 6:43,2 I think the reason lines 3, 4, and 5 aren't being SMAPped is that you only add LineInfos inside if (breakAtLF || count 0) {. This adds LineInfos when the output line advances, but not when the input line alone advances. To SMAP template text fully, you have to add a LineInfo every time the line number advances in the input file or the output file. Eric - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, September 16, 2003 10:46 AM Subject: cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler Generator.java Node.java SmapStratum.java SmapUtil.java kinman 2003/09/16 10:46:44 Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java Node.java SmapStratum.java SmapUtil.java Log: - For template texts that generate multiple Java lines, addidtional mapping informantion are kept in the TemplateText node, to aide SMAP generation. Revision ChangesPath 1.208 +23 -14 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator .jav a Index: Generator.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler /Gen erator.java,v retrieving revision 1.207 retrieving revision 1.208 diff -u -r1.207 -r1.208 --- Generator.java 15 Sep 2003 13:43:54 - 1.207 +++ Generator.java 16 Sep 2003 17:46:43 - 1.208 @@ -1867,21 +1867,25 @@ return; } -if (ctxt.getOptions().genStringAsCharArray()) { -if (textSize = 3) { - // Spcial case small text strings - n.setBeginJavaLine(out.getJavaLine()); - out.printil(out.write( + quote(text.charAt(0)) + );); - if (textSize 1) { - out.printil(out.write( + quote(text.charAt(1)) + );); +if (textSize = 3) { + // Special case small text strings + n.setBeginJavaLine(out.getJavaLine()); + int lineInc = 0; + for (int i = 0; i textSize; i++) { + char ch = text.charAt(i); + out.printil(out.write( + quote(ch) + );); + if (i 0) { + n.addSmap(lineInc); } - if (textSize 2) { - out.printil(out.write( + quote(text.charAt(2)) + );); + if (ch
Re: [VOTE] 5.0.12 stability rating
Remy Maucherat wrote: ballot [ ] Alpha [X] Beta /ballot Eric - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler Generator.java
This SMAPs all declaration nodes, including the ones tacked on to the root node by ELFunctionMapper.java. So for instance the SMAP for jsp2/el/functions.jsp from the jsp-examples webapp ends with 43,6:120 1,3:10 1,5:13 thus SMAPping %@ taglib prefix=my uri=http://jakarta.apache.org/tomcat/jsp2-example-taglib% to static private org.apache.jasper.runtime.ProtectedFunctionMapper _jspx_fnmap_0; static private org.apache.jasper.runtime.ProtectedFunctionMapper _jspx_fnmap_1; and static { _jspx_fnmap_0= org.apache.jasper.runtime.ProtectedFunctionMapper.getMapForFunction(my:reverse, jsp2.examples.el.Functions.class, reverse, new Class[] {java.lang.String.class}); _jspx_fnmap_1= org.apache.jasper.runtime.ProtectedFunctionMapper.getMapForFunction(my:countVowels, jsp2.examples.el.Functions.class, numVowels, new Class[] {java.lang.String.class}); } which is clearly wrong. Eric - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, September 19, 2003 4:38 PM Subject: cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler Generator.java kinman 2003/09/19 16:38:09 Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java Log: - Make sure scriptlet declarations get properly mapped. This fixes 22833 Revision ChangesPath 1.211 +7 -6 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java Index: Generator.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v retrieving revision 1.210 retrieving revision 1.211 diff -u -r1.210 -r1.211 --- Generator.java 19 Sep 2003 18:30:09 - 1.210 +++ Generator.java 19 Sep 2003 23:38:08 - 1.211 @@ -196,9 +196,7 @@ */ public void visit(Node.PageDirective n) throws JasperException { -if (!getServletInfoGenerated) { -getServletInfoGenerated = true; -} else { +if (getServletInfoGenerated) { return; } @@ -206,6 +204,7 @@ if (info == null) return; +getServletInfoGenerated = true; out.printil(public String getServletInfo() {); out.pushIndent(); out.printin(return ); @@ -217,8 +216,10 @@ } public void visit(Node.Declaration n) throws JasperException { +n.setBeginJavaLine(out.getJavaLine()); out.printMultiLn(new String(n.getText())); out.println(); +n.setEndJavaLine(out.getJavaLine()); } // Custom Tags may contain declarations from tag plugins. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources messages.properties
SMAP generation is one of the area that does not got enough test and use. You seem to be one of the few who actually look at it. Are you doing anything with it? Nope. Just trying to make myself useful. Eric - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources messages.properties
Unfortunately, not having a debugger that uses SMP, it is hard to automate SMAP testing. You pretty much has to manually eyeball the files to verify its correctness. I think netbeans is planning to use tomcat 5 for its next major, so we'll expect more use there. In the wake of Bugzilla #22277, I wrote some tests that compare the HTML and SMAP produced by various JSPs to a previously established baseline (like I believe ant run-tester does with HTML). Great for picking up on regressions (that's how I caught the small text string problem), but of course the disadvantage is that they also complain about perfectly valid changes, and manually eyeballing the files is the only way to tell the difference. Eric - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources messages.properties
But this also shows that tight coupling between Generator and SmapUtil is flagile and error prone. I think it would be a better design if we decouple these two modules somehow. We could create additional data structure that captures the mapping info for template texts, with Generator its producer and SmapUtil its comsumer. What do you think? I'll think about this more. I thought about this a bit when I was copying the line feed logic from Generator.java to SmapUtil.java to fix the line mappings for template text nodes, because I didn't like duplicating code, but I didn't see an alternative except to move the SMAPping into Generator. How would your producer/consumer approach differ from that? If a data structure that captures mapping info is what's needed, we already have SmapStratum performing that function, so I don't see much difference between having Generator produce a new mapping info data structure and just having Generator produce the SMAP directly. BTW, the reason for if (textSize = 3) is for performance optimization. out.write('\n') should be faster than out.write(\n) so it's OK that you move into the if (ctxt.getOptions().genStringAsCharArray()) block, for now; but it should really be applied in all cases. Maybe we can write all out.write()'s in a single line, so that the mapping is not changed? Or we can revisit this later. Yeah, I didn't know if putting if (textSize = 3) outside the if (ctxt.getOptions().genStringAsCharArray()) block was intentional or not, which is why I was hesitant to commit my fix. Thanks for clarifying. I don't have a problem changing the SMAPs as long as we don't break them, so do whatever you think best on the Generator side, and I'll just try to make sure to check for SMAP regressions before the next release. Eric - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources messages.properties
This change leads to incorrect SMAPs of TemplateText nodes with 3 or fewer characters, because the if (textSize = 3) logic isn't mirrored in SmapUtil.java. Moving the if (textSize = 3) block into the if (ctxt.getOptions().genStringAsCharArray()) block seems to be a quick way to fix the problem for genStrAsCharArray=false (which, if genStrAsCharArray=true is still experimental, is the only case that really matters), but I haven't followed this thread closely enough to feel confident committing that change. Eric - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, September 09, 2003 2:46 PM Subject: cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources messages.properties kinman 2003/09/09 14:46:22 Modified:jasper2/src/share/org/apache/jasper EmbeddedServletOptions.java JspC.java Options.java jasper2/src/share/org/apache/jasper/compiler Generator.java jasper2/src/share/org/apache/jasper/resources messages.properties Log: - Add an compilation option to generate writing char arrays instead of Strings for template texts. OK, I'm committing the code experimentally. Please try it out and see if it improves performance. To turn it on, set the initParam genStrAsCharArray to true. Revision ChangesPath 1.6 +28 -3 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/EmbeddedServletOpt ions.java Index: EmbeddedServletOptions.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/Embedded ServletOptions.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- EmbeddedServletOptions.java 6 Aug 2003 20:04:05 - 1.5 +++ EmbeddedServletOptions.java 9 Sep 2003 21:46:22 - 1.6 @@ -157,6 +157,11 @@ private boolean isSmapDumped = false; /** + * Are Text strings to be generated as char arrays? + */ +private boolean genStringAsCharArray = false; + +/** * I want to see my generated servlets. Which directory are they * in? */ @@ -290,6 +295,13 @@ } /** + * Are Text strings to be generated as char arrays? + */ +public boolean genStringAsCharArray() { +return this.genStringAsCharArray; +} + +/** * Class ID for use in the plugin tag when the browser is IE. */ public String getIeClassId() { @@ -513,6 +525,19 @@ } else { if (log.isWarnEnabled()) { log.warn(Localizer.getMessage(jsp.warning.dumpSmap)); +} +} +} + +String genCharArray = config.getInitParameter(genStrAsCharArray); +if (genCharArray != null) { +if (genCharArray.equalsIgnoreCase(true)) { +genStringAsCharArray = true; +} else if (genCharArray.equalsIgnoreCase(false)) { +genStringAsCharArray = false; +} else { +if (log.isWarnEnabled()) { + log.warn(Localizer.getMessage(jsp.warning.genchararray)); } } } 1.60 +10 -3 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspC.java Index: JspC.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspC.jav a,v retrieving revision 1.59 retrieving revision 1.60 diff -u -r1.59 -r1.60 --- JspC.java 2 Sep 2003 21:40:00 - 1.59 +++ JspC.java 9 Sep 2003 21:46:22 - 1.60 @@ -408,6 +408,13 @@ return false; } +/** + * Are Text strings to be generated as char arrays? + */ +public boolean genStringAsCharArray() { +return false; +} + public String getIeClassId() { return ieClassId; } 1.18 +8 -3 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/Options.java Index: Options.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/Options. java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- Options.java 2 Sep 2003 21:40:00 - 1.17 +++ Options.java 9 Sep 2003 21:46:22 - 1.18 @@ -191,4 +191,9 @@ * Obtain a Tag Plugin Manager */ public TagPluginManager getTagPluginManager(); + +/** + * Are Text strings to be generated as char arrays? + */ +public boolean genStringAsCharArray(); } 1.205 +91 -11 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator .java Index:
Re: [VOTE] New committer: Eric Carmichael
+1, welcome on board Thanks, happy to be here. If he like Xerces, he can jump on that side too ;-) -- Jeanfrancois I'm going to stick to Tomcat 5/Jasper 2 while there are still bugs there that I can do something about. After that, well, Xerces can't be any less glamorous than SMAPping Finally, while I have the floor, I'd like to ask for guidance on Bugzilla #21390, which has been pending longer than any of the other Tomcat 5/Jasper 2 bugs. It can be fixed in two very different ways, and I don't know which way is the right way. I've written the spec folks to ask for clarification, but I haven't had a response, so I'm hoping someone on this list can direct me. Eric - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [5.0.8] Tag soon
(hopefully, we'll have a good quality build this time :) ) To that end, could someone add xml/xml.jsp from the jsp-examples webapp (or something like it) to tester? There isn't very much XML coverage in tester, and this particular jsp would have flagged bugs 22277 and 21366 before they made it into a release, so it seems like a good addition. I would help with this, but I don't think I'll have time before Remy starts tagging. If this is still pending post 5.0.8 (and no one's come up with a good reason why it shouldn't be done), I'll work on it. Eric - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [VOTE] 5.0.7 stability rating
Remy Maucherat wrote: Note 2: As far as I am concerned, the 5.0.7 build is feature complete (ie, my TODO list is empty). FYI, there are still a handful of TODOs in the Jasper code, at least one of which (need to check for uniqueness of attribute name, variable name-given, and variable alias) is required for spec compliance. Eric - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]