cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler SmapStratum.java
ecarmich2003/08/30 20:46:29 Modified:jasper2/src/share/org/apache/jasper/compiler SmapStratum.java Log: Don't combine LineInfos from different files Revision ChangesPath 1.10 +4 -2 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/SmapStratum.java Index: SmapStratum.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/SmapStratum.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- SmapStratum.java 30 Aug 2003 21:51:50 - 1.9 +++ SmapStratum.java 31 Aug 2003 03:46:29 - 1.10 @@ -216,7 +216,8 @@ while (i lineData.size() - 1) { LineInfo li = (LineInfo)lineData.get(i); LineInfo liNext = (LineInfo)lineData.get(i + 1); -if (liNext.inputStartLine == li.inputStartLine +if (!liNext.lineFileIDSet + liNext.inputStartLine == li.inputStartLine liNext.inputLineCount == 1 li.inputLineCount == 1 liNext.outputStartLine @@ -238,7 +239,8 @@ while (i lineData.size() - 1) { LineInfo li = (LineInfo)lineData.get(i); LineInfo liNext = (LineInfo)lineData.get(i + 1); -if (liNext.inputStartLine == li.inputStartLine + li.inputLineCount +if (!liNext.lineFileIDSet + liNext.inputStartLine == li.inputStartLine + li.inputLineCount liNext.outputLineIncrement == li.outputLineIncrement liNext.outputStartLine == li.outputStartLine - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler SmapStratum.java
ecarmich2003/08/30 14:51:50 Modified:jasper2/src/share/org/apache/jasper/compiler SmapStratum.java Log: Remove tabs Revision ChangesPath 1.9 +159 -149 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/SmapStratum.java Index: SmapStratum.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/SmapStratum.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- SmapStratum.java 12 Aug 2003 16:19:52 - 1.8 +++ SmapStratum.java 30 Aug 2003 21:51:50 - 1.9 @@ -53,7 +53,7 @@ * information on the Apache Software Foundation, please see * http://www.apache.org/. * - */ + */ package org.apache.jasper.compiler; @@ -77,76 +77,78 @@ * a particular stratum. */ public static class LineInfo { - private int inputStartLine = -1; - private int outputStartLine = -1; - private int lineFileID = 0; - private int inputLineCount = 1; - private int outputLineIncrement = 1; - private boolean lineFileIDSet = false; - - /** Sets InputStartLine. */ - public void setInputStartLine(int inputStartLine) { - if (inputStartLine 0) - throw new IllegalArgumentException( + inputStartLine); - this.inputStartLine = inputStartLine; - } - - /** Sets OutputStartLine. */ - public void setOutputStartLine(int outputStartLine) { - if (outputStartLine 0) - throw new IllegalArgumentException( + outputStartLine); - this.outputStartLine = outputStartLine; - } - - /** - * Sets lineFileID. Should be called only when different from - * that of prior LineInfo object (in any given context) or 0 - * if the current LineInfo has no (logical) predecessor. - * ttLineInfo/tt will print this file number no matter what. - */ - public void setLineFileID(int lineFileID) { - if (lineFileID 0) - throw new IllegalArgumentException( + lineFileID); - this.lineFileID = lineFileID; - this.lineFileIDSet = true; - } - - /** Sets InputLineCount. */ - public void setInputLineCount(int inputLineCount) { - if (inputLineCount 0) - throw new IllegalArgumentException( + inputLineCount); - this.inputLineCount = inputLineCount; - } - - /** Sets OutputLineIncrement. */ - public void setOutputLineIncrement(int outputLineIncrement) { - if (outputLineIncrement 0) - throw new IllegalArgumentException( + outputLineIncrement); - this.outputLineIncrement = outputLineIncrement; - } +private int inputStartLine = -1; +private int outputStartLine = -1; +private int lineFileID = 0; +private int inputLineCount = 1; +private int outputLineIncrement = 1; +private boolean lineFileIDSet = false; + +/** Sets InputStartLine. */ +public void setInputStartLine(int inputStartLine) { +if (inputStartLine 0) +throw new IllegalArgumentException( + inputStartLine); +this.inputStartLine = inputStartLine; +} + +/** Sets OutputStartLine. */ +public void setOutputStartLine(int outputStartLine) { +if (outputStartLine 0) +throw new IllegalArgumentException( + outputStartLine); +this.outputStartLine = outputStartLine; +} + +/** + * Sets lineFileID. Should be called only when different from + * that of prior LineInfo object (in any given context) or 0 + * if the current LineInfo has no (logical) predecessor. + * ttLineInfo/tt will print this file number no matter what. + */ +public void setLineFileID(int lineFileID) { +if (lineFileID 0) +throw new IllegalArgumentException( + lineFileID); +this.lineFileID = lineFileID; +this.lineFileIDSet = true; +} + +/** Sets InputLineCount. */ +public void setInputLineCount(int inputLineCount) { +if (inputLineCount 0) +throw new IllegalArgumentException( + inputLineCount); +this.inputLineCount = inputLineCount; +} + +/** Sets OutputLineIncrement. */ +public void setOutputLineIncrement(int outputLineIncrement) { +if (outputLineIncrement 0) +throw new IllegalArgumentException( + outputLineIncrement); +this.outputLineIncrement = outputLineIncrement; +} /** * Retrieves the current
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler SmapStratum.java
remm2003/08/10 01:35:39 Modified:jasper2/src/share/org/apache/jasper/compiler SmapStratum.java Log: - Apply workaround for failure in optimizeLineSection() when there are entries with an outputStartLine of 0. Submitted by Eric Carmichael. Revision ChangesPath 1.7 +8 -0 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/SmapStratum.java Index: SmapStratum.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/SmapStratum.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- SmapStratum.java 9 Aug 2003 19:19:37 - 1.6 +++ SmapStratum.java 10 Aug 2003 08:35:39 - 1.7 @@ -276,6 +276,14 @@ throw new IllegalArgumentException( inputFileName: + inputFileName); +//Jasper incorrectly SMAPs certain Nodes, giving them an +//outputStartLine of 0. This can cause a fatal error in +//optimizeLineSection, making it impossible for Jasper to +//compile the JSP. Until we can fix the underlying +//SMAPping problem, we simply ignore the flawed SMAP entries. +if (outputStartLine == 0) +return; + // build the LineInfo LineInfo li = new LineInfo(); li.setInputStartLine(inputStartLine); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler SmapStratum.java
remm2003/08/12 09:19:52 Modified:jasper2/src/share/org/apache/jasper/compiler SmapStratum.java Log: - Don't merge SMAP entries in the outptStartLines aren't consecutive (note: the input numbers are still incorrect, for example when using a tag invocation and it has been extracted out of the main _jspService). Revision ChangesPath 1.8 +7 -5 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/SmapStratum.java Index: SmapStratum.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/SmapStratum.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- SmapStratum.java 10 Aug 2003 08:35:39 - 1.7 +++ SmapStratum.java 12 Aug 2003 16:19:52 - 1.8 @@ -208,7 +208,7 @@ * Combines consecutive LineInfos wherever possible */ public void optimizeLineSection() { - + //Incorporate each LineInfo into the previous LineInfo's //outputLineIncrement, if possible int i=0; @@ -216,15 +216,17 @@ LineInfo li = (LineInfo)lineData.get(i); LineInfo liNext = (LineInfo)lineData.get(i+1); if (liNext.inputStartLine == li.inputStartLine - liNext.inputLineCount==1 - li.inputLineCount==1) { -li.setOutputLineIncrement(liNext.outputStartLine - li.outputStartLine + liNext.outputLineIncrement); + liNext.inputLineCount==1 + li.inputLineCount==1 + liNext.outputStartLine == li.outputStartLine + li.inputLineCount*li.outputLineIncrement) { +li.setOutputLineIncrement +(liNext.outputStartLine - li.outputStartLine + liNext.outputLineIncrement); lineData.remove(i+1); } else { i++; } } - + //Incorporate each LineInfo into the previous LineInfo's //inputLineCount, if possible i=0; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler SmapStratum.java SmapUtil.java
luehe 2003/07/31 09:56:20 Modified:jasper2/src/share/org/apache/jasper/compiler SmapStratum.java SmapUtil.java Log: Fixed 21168 (Incorrect paths in generated SMAP file entries) Applied (slightly modified) patch provided by [EMAIL PROTECTED] Revision ChangesPath 1.5 +7 -1 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/SmapStratum.java Index: SmapStratum.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/SmapStratum.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- SmapStratum.java 16 Apr 2003 22:05:31 - 1.4 +++ SmapStratum.java 31 Jul 2003 16:56:20 - 1.5 @@ -282,7 +282,13 @@ for (int i = 0; i bound; i++) { if (filePathList.get(i) != null) { out.append(+ + i + + fileNameList.get(i) + \n); - out.append(filePathList.get(i) + \n); +// Source paths must be relative, not absolute, so we +// remove the leading /, if one exists. +String filePath = (String)filePathList.get(i); +if (filePath.startsWith(/)) { +filePath = filePath.substring(1); +} +out.append(filePath + \n); } else { out.append(i + + fileNameList.get(i) + \n); } 1.15 +1 -1 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/SmapUtil.java Index: SmapUtil.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/SmapUtil.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- SmapUtil.java 30 May 2003 21:48:14 - 1.14 +++ SmapUtil.java 31 Jul 2003 16:56:20 - 1.15 @@ -152,7 +152,7 @@ * Returns an unqualified version of the given file path. */ private static String unqualify(String path) { - return path.substring(path.lastIndexOf(/) + 1); + return path.substring(path.lastIndexOf(File.separator) + 1); } /** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]