Author: markt Date: Mon Jun 15 16:07:20 2009 New Revision: 784835 URL: http://svn.apache.org/viewvc?rev=784835&view=rev Log: Remove some unused Jasper code.
Modified: tomcat/trunk/java/org/apache/jasper/compiler/JavacErrorDetail.java tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java tomcat/trunk/java/org/apache/jasper/compiler/JspUtil.java tomcat/trunk/java/org/apache/jasper/compiler/Mark.java tomcat/trunk/java/org/apache/jasper/compiler/Node.java tomcat/trunk/java/org/apache/jasper/compiler/ServletWriter.java tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java Modified: tomcat/trunk/java/org/apache/jasper/compiler/JavacErrorDetail.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/JavacErrorDetail.java?rev=784835&r1=784834&r2=784835&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/compiler/JavacErrorDetail.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/JavacErrorDetail.java Mon Jun 15 16:07:20 2009 @@ -71,18 +71,9 @@ * @param jspBeginLineNum The start line number of the JSP element * responsible for the compilation error * @param errMsg The compilation error message + * @param ctxt The compilation context */ public JavacErrorDetail(String javaFileName, - int javaLineNum, - String jspFileName, - int jspBeginLineNum, - StringBuffer errMsg) { - - this(javaFileName, javaLineNum, jspFileName, jspBeginLineNum, errMsg, - null); - } - - public JavacErrorDetail(String javaFileName, int javaLineNum, String jspFileName, int jspBeginLineNum, Modified: tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java?rev=784835&r1=784834&r2=784835&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java Mon Jun 15 16:07:20 2009 @@ -24,8 +24,6 @@ import java.util.List; import java.util.Vector; import java.util.jar.JarFile; -import java.net.URL; -import java.net.MalformedURLException; import org.apache.jasper.JasperException; import org.apache.jasper.JspCompilationContext; @@ -227,21 +225,6 @@ current = new Mark(mark); } - boolean matchesIgnoreCase(String string) throws JasperException { - Mark mark = mark(); - int ch = 0; - int i = 0; - do { - ch = nextChar(); - if (Character.toLowerCase((char) ch) != string.charAt(i++)) { - reset(mark); - return false; - } - } while (i < string.length()); - reset(mark); - return true; - } - /** * search the stream for a match to a string * @param string The string to match @@ -474,21 +457,6 @@ /** - * Gets the URL for the given path name. - * - * @param path Path name - * - * @return URL for the given path name. - * - * @exception MalformedURLException if the path name is not given in - * the correct form - */ - URL getResource(String path) throws MalformedURLException { - return context.getResource(path); - } - - - /** * Parse utils - Is current character a token delimiter ? * Delimiters are currently defined to be =, >, <, ", and ' or any * any space character as defined by <code>isSpace</code>. Modified: tomcat/trunk/java/org/apache/jasper/compiler/JspUtil.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/JspUtil.java?rev=784835&r1=784834&r2=784835&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/compiler/JspUtil.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/JspUtil.java Mon Jun 15 16:07:20 2009 @@ -17,7 +17,6 @@ package org.apache.jasper.compiler; -import java.io.CharArrayWriter; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; @@ -49,8 +48,6 @@ // Delimiters for request-time expressions (JSP and XML syntax) private static final String OPEN_EXPR = "<%="; private static final String CLOSE_EXPR = "%>"; - private static final String OPEN_EXPR_XML = "%="; - private static final String CLOSE_EXPR_XML = "%"; // private static ExpressionEvaluatorImpl expressionEvaluator // = new ExpressionEvaluatorImpl(); @@ -67,101 +64,6 @@ public static final int CHUNKSIZE = 1024; - public static char[] removeQuotes(char[] chars) { - CharArrayWriter caw = new CharArrayWriter(); - for (int i = 0; i < chars.length; i++) { - if (chars[i] == '%' && chars[i + 1] == '\\' && - chars[i + 2] == '>') { - caw.write('%'); - caw.write('>'); - i = i + 2; - } else { - caw.write(chars[i]); - } - } - return caw.toCharArray(); - } - - public static char[] escapeQuotes(char[] chars) { - // Prescan to convert %\> to %> - String s = new String(chars); - while (true) { - int n = s.indexOf("%\\>"); - if (n < 0) - break; - StringBuffer sb = new StringBuffer(s.substring(0, n)); - sb.append("%>"); - sb.append(s.substring(n + 3)); - s = sb.toString(); - } - chars = s.toCharArray(); - return (chars); - - // Escape all backslashes not inside a Java string literal - /* - CharArrayWriter caw = new CharArrayWriter(); - boolean inJavaString = false; - for (int i = 0; i < chars.length; i++) { - if (chars[i] == '"') inJavaString = !inJavaString; - // escape out the escape character - if (!inJavaString && (chars[i] == '\\')) caw.write('\\'); - caw.write(chars[i]); - } - return caw.toCharArray(); - */ - } - - /** - * Checks if the token is a runtime expression. In standard JSP syntax, a - * runtime expression starts with '<%' and ends with '%>'. When the JSP - * document is in XML syntax, a runtime expression starts with '%=' and ends - * with '%'. - * - * @param token The token to be checked - * @return whether the token is a runtime expression or not. - */ - public static boolean isExpression(String token, boolean isXml) { - String openExpr; - String closeExpr; - if (isXml) { - openExpr = OPEN_EXPR_XML; - closeExpr = CLOSE_EXPR_XML; - } else { - openExpr = OPEN_EXPR; - closeExpr = CLOSE_EXPR; - } - if (token.startsWith(openExpr) && token.endsWith(closeExpr)) { - return true; - } else { - return false; - } - } - - /** - * @return the "expression" part of a runtime expression, taking the - * delimiters out. - */ - public static String getExpr(String expression, boolean isXml) { - String returnString; - String openExpr; - String closeExpr; - if (isXml) { - openExpr = OPEN_EXPR_XML; - closeExpr = CLOSE_EXPR_XML; - } else { - openExpr = OPEN_EXPR; - closeExpr = CLOSE_EXPR; - } - int length = expression.length(); - if (expression.startsWith(openExpr) && expression.endsWith(closeExpr)) { - returnString = expression.substring(openExpr.length(), length - - closeExpr.length()); - } else { - returnString = ""; - } - return returnString; - } - /** * Takes a potential expression and converts it into XML form */ @@ -299,24 +201,6 @@ // XXX *could* move EL-syntax validation here... (sb) } - public static String escapeQueryString(String unescString) { - if (unescString == null) - return null; - - String escString = ""; - String shellSpChars = "\\\""; - - for (int index = 0; index < unescString.length(); index++) { - char nextChar = unescString.charAt(index); - - if (shellSpChars.indexOf(nextChar) != -1) - escString += "\\"; - - escString += nextChar; - } - return escString; - } - /** * Escape the 5 entities defined by XML. */ @@ -983,28 +867,6 @@ return false; } - /** - * Converts the given Xml name to a legal Java identifier. This is slightly - * more efficient than makeJavaIdentifier in that we only need to worry - * about '.', '-', and ':' in the string. We also assume that the resultant - * string is further concatenated with some prefix string so that we don't - * have to worry about it being a Java key word. - * - * @param name - * Identifier to convert - * - * @return Legal Java identifier corresponding to the given identifier - */ - public static final String makeXmlJavaIdentifier(String name) { - if (name.indexOf('-') >= 0) - name = replace(name, '-', "$1"); - if (name.indexOf('.') >= 0) - name = replace(name, '.', "$2"); - if (name.indexOf(':') >= 0) - name = replace(name, ':', "$3"); - return name; - } - static InputStreamReader getReader(String fname, String encoding, JarFile jarFile, JspCompilationContext ctxt, ErrorDispatcher err) throws JasperException, IOException { Modified: tomcat/trunk/java/org/apache/jasper/compiler/Mark.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/Mark.java?rev=784835&r1=784834&r2=784835&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/compiler/Mark.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/Mark.java Mon Jun 15 16:07:20 2009 @@ -219,10 +219,6 @@ return ctxt.getResource(getFile()); } - public String toShortString() { - return "("+line+","+col+")"; - } - public boolean equals(Object other) { if (other instanceof Mark) { Mark m = (Mark) other; @@ -234,23 +230,6 @@ } /** - * @return true if this Mark is greather than the <code>other</code> - * Mark, false otherwise. - */ - public boolean isGreater(Mark other) { - - boolean greater = false; - - if (this.line > other.line) { - greater = true; - } else if (this.line == other.line && this.col > other.col) { - greater = true; - } - - return greater; - } - - /** * Keep track of parser before parsing an included file. * This class keeps track of the parser before we switch to parsing an * included file. In other words, it's the parser's continuation to be @@ -261,7 +240,6 @@ int fileId; String fileName; String baseDir; - String encoding; char[] stream = null; IncludeState(int inCursor, int inLine, int inCol, int inFileId, Modified: tomcat/trunk/java/org/apache/jasper/compiler/Node.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/Node.java?rev=784835&r1=784834&r2=784835&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/compiler/Node.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/Node.java Mon Jun 15 16:07:20 2009 @@ -117,26 +117,6 @@ } /** - * Constructor. - * - * @param qName - * The action's qualified name - * @param localName - * The action's local name - * @param start - * The location of the jsp page - * @param parent - * The enclosing node - */ - public Node(String qName, String localName, Mark start, Node parent) { - this.qName = qName; - this.localName = localName; - this.startMark = start; - this.isDummy = (start == null); - addToParent(parent); - } - - /** * Constructor for Nodes parsed from standard syntax. * * @param qName @@ -1547,19 +1527,6 @@ this.jspAttrs = jspAttrs; } - public TagAttributeInfo getTagAttributeInfo(String name) { - TagInfo info = this.getTagInfo(); - if (info == null) - return null; - TagAttributeInfo[] tai = info.getAttributes(); - for (int i = 0; i < tai.length; i++) { - if (tai[i].getName().equals(name)) { - return tai[i]; - } - } - return null; - } - public JspAttribute[] getJspAttributes() { return jspAttrs; } Modified: tomcat/trunk/java/org/apache/jasper/compiler/ServletWriter.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/ServletWriter.java?rev=784835&r1=784834&r2=784835&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/compiler/ServletWriter.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/ServletWriter.java Mon Jun 15 16:07:20 2009 @@ -71,26 +71,6 @@ } /** - * Print a standard comment for echo outputed chunk. - * @param start The starting position of the JSP chunk being processed. - * @param stop The ending position of the JSP chunk being processed. - */ - public void printComment(Mark start, Mark stop, char[] chars) { - if (start != null && stop != null) { - println("// from="+start); - println("// to="+stop); - } - - if (chars != null) - for(int i = 0; i < chars.length;) { - printin(); - print("// "); - while (chars[i] != '\n' && i < chars.length) - writer.print(chars[i++]); - } - } - - /** * Prints the given string followed by '\n' */ public void println(String s) { Modified: tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java?rev=784835&r1=784834&r2=784835&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java (original) +++ tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java Mon Jun 15 16:07:20 2009 @@ -557,43 +557,6 @@ return escString; } - /** - * Decode an URL formatted string. - * @param encoded The string to decode. - * @return The decoded string. - */ - - public static String decode(String encoded) { - // speedily leave if we're not needed - if (encoded == null) return null; - if (encoded.indexOf('%') == -1 && encoded.indexOf('+') == -1) - return encoded; - - //allocate the buffer - use byte[] to avoid calls to new. - byte holdbuffer[] = new byte[encoded.length()]; - - int bufcount = 0; - - for (int count = 0; count < encoded.length(); count++) { - char cur = encoded.charAt(count); - if (cur == '%') { - holdbuffer[bufcount++] = - (byte)Integer.parseInt(encoded.substring(count+1,count+3),16); - if (count + 2 >= encoded.length()) - count = encoded.length(); - else - count += 2; - } else if (cur == '+') { - holdbuffer[bufcount++] = (byte) ' '; - } else { - holdbuffer[bufcount++] = (byte) cur; - } - } - // REVISIT -- remedy for Deprecated warning. - //return new String(holdbuffer,0,0,bufcount); - return new String(holdbuffer,0,bufcount); - } - // __begin lookupReadMethodMethod public static Object handleGetProperty(Object o, String prop) throws JasperException { --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org