From: markt Date: Thu, 5 Nov 2009 01:16:53 +0000 (+0000) Subject: Partial fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=48132 X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=d9a1a22eb4b8bb9a796683acf8f6a5d8b7f125f7;p=tomcat7.0 Partial fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=48132 Patch provided by sebb git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@832953 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/jasper/compiler/AntCompiler.java b/java/org/apache/jasper/compiler/AntCompiler.java index 9146a1967..b45946e7c 100644 --- a/java/org/apache/jasper/compiler/AntCompiler.java +++ b/java/org/apache/jasper/compiler/AntCompiler.java @@ -87,11 +87,13 @@ public class AntCompiler extends Compiler { protected StringBuilder reportBuf = new StringBuilder(); + @Override protected void printMessage(final String message, final PrintStream stream, final int priority) { } + @Override protected void log(String message) { reportBuf.append(message); reportBuf.append(System.getProperty("line.separator")); @@ -110,6 +112,7 @@ public class AntCompiler extends Compiler { /** * Compile the servlet from .java file to .class file */ + @Override protected void generateClass(String[] smap) throws FileNotFoundException, JasperException, Exception { @@ -384,107 +387,133 @@ public class AntCompiler extends Compiler { // ---------------------------------------------------- PrintStream Methods + @Override public void flush() { findStream().flush(); } + @Override public void close() { findStream().close(); } + @Override public boolean checkError() { return findStream().checkError(); } + @Override protected void setError() { //findStream().setError(); } + @Override public void write(int b) { findStream().write(b); } + @Override public void write(byte[] b) throws IOException { findStream().write(b); } + @Override public void write(byte[] buf, int off, int len) { findStream().write(buf, off, len); } + @Override public void print(boolean b) { findStream().print(b); } + @Override public void print(char c) { findStream().print(c); } + @Override public void print(int i) { findStream().print(i); } + @Override public void print(long l) { findStream().print(l); } + @Override public void print(float f) { findStream().print(f); } + @Override public void print(double d) { findStream().print(d); } + @Override public void print(char[] s) { findStream().print(s); } + @Override public void print(String s) { findStream().print(s); } + @Override public void print(Object obj) { findStream().print(obj); } + @Override public void println() { findStream().println(); } + @Override public void println(boolean x) { findStream().println(x); } + @Override public void println(char x) { findStream().println(x); } + @Override public void println(int x) { findStream().println(x); } + @Override public void println(long x) { findStream().println(x); } + @Override public void println(float x) { findStream().println(x); } + @Override public void println(double x) { findStream().println(x); } + @Override public void println(char[] x) { findStream().println(x); } + @Override public void println(String x) { findStream().println(x); } + @Override public void println(Object x) { findStream().println(x); } diff --git a/java/org/apache/jasper/compiler/Collector.java b/java/org/apache/jasper/compiler/Collector.java index 50b2b9de4..9fa4e4aa0 100644 --- a/java/org/apache/jasper/compiler/Collector.java +++ b/java/org/apache/jasper/compiler/Collector.java @@ -42,6 +42,7 @@ class Collector { private boolean setPropertySeen = false; private boolean hasScriptingVars = false; + @Override public void visit(Node.ParamAction n) throws JasperException { if (n.getValue().isExpression()) { scriptingElementSeen = true; @@ -49,6 +50,7 @@ class Collector { paramActionSeen = true; } + @Override public void visit(Node.IncludeAction n) throws JasperException { if (n.getPage().isExpression()) { scriptingElementSeen = true; @@ -57,6 +59,7 @@ class Collector { visitBody(n); } + @Override public void visit(Node.ForwardAction n) throws JasperException { if (n.getPage().isExpression()) { scriptingElementSeen = true; @@ -64,6 +67,7 @@ class Collector { visitBody(n); } + @Override public void visit(Node.SetProperty n) throws JasperException { if (n.getValue() != null && n.getValue().isExpression()) { scriptingElementSeen = true; @@ -71,6 +75,7 @@ class Collector { setPropertySeen = true; } + @Override public void visit(Node.UseBean n) throws JasperException { if (n.getBeanName() != null && n.getBeanName().isExpression()) { scriptingElementSeen = true; @@ -79,6 +84,7 @@ class Collector { visitBody(n); } + @Override public void visit(Node.PlugIn n) throws JasperException { if (n.getHeight() != null && n.getHeight().isExpression()) { scriptingElementSeen = true; @@ -89,6 +95,7 @@ class Collector { visitBody(n); } + @Override public void visit(Node.CustomTag n) throws JasperException { // Check to see what kinds of element we see as child elements checkSeen( n.getChildInfo(), n ); @@ -152,6 +159,7 @@ class Collector { hasScriptingVars = hasScriptingVars || hasScriptingVarsSave; } + @Override public void visit(Node.JspElement n) throws JasperException { if (n.getNameAttribute().isExpression()) scriptingElementSeen = true; @@ -166,22 +174,27 @@ class Collector { visitBody(n); } + @Override public void visit(Node.JspBody n) throws JasperException { checkSeen( n.getChildInfo(), n ); } + @Override public void visit(Node.NamedAttribute n) throws JasperException { checkSeen( n.getChildInfo(), n ); } + @Override public void visit(Node.Declaration n) throws JasperException { scriptingElementSeen = true; } + @Override public void visit(Node.Expression n) throws JasperException { scriptingElementSeen = true; } + @Override public void visit(Node.Scriptlet n) throws JasperException { scriptingElementSeen = true; } diff --git a/java/org/apache/jasper/compiler/Dumper.java b/java/org/apache/jasper/compiler/Dumper.java index 04f453f48..8c4549190 100644 --- a/java/org/apache/jasper/compiler/Dumper.java +++ b/java/org/apache/jasper/compiler/Dumper.java @@ -65,111 +65,132 @@ class Dumper { } } + @Override public void visit(Node.PageDirective n) throws JasperException { printAttributes("<%@ page", n.getAttributes(), "%>"); } + @Override public void visit(Node.TaglibDirective n) throws JasperException { printAttributes("<%@ taglib", n.getAttributes(), "%>"); } + @Override public void visit(Node.IncludeDirective n) throws JasperException { printAttributes("<%@ include", n.getAttributes(), "%>"); dumpBody(n); } + @Override public void visit(Node.Comment n) throws JasperException { printString("<%--", n.getText(), "--%>"); } + @Override public void visit(Node.Declaration n) throws JasperException { printString("<%!", n.getText(), "%>"); } + @Override public void visit(Node.Expression n) throws JasperException { printString("<%=", n.getText(), "%>"); } + @Override public void visit(Node.Scriptlet n) throws JasperException { printString("<%", n.getText(), "%>"); } + @Override public void visit(Node.IncludeAction n) throws JasperException { printAttributes(""); dumpBody(n); printString(""); } + @Override public void visit(Node.ForwardAction n) throws JasperException { printAttributes(""); dumpBody(n); printString(""); } + @Override public void visit(Node.GetProperty n) throws JasperException { printAttributes(""); } + @Override public void visit(Node.SetProperty n) throws JasperException { printAttributes(""); dumpBody(n); printString(""); } + @Override public void visit(Node.UseBean n) throws JasperException { printAttributes(""); dumpBody(n); printString(""); } + @Override public void visit(Node.PlugIn n) throws JasperException { printAttributes(""); dumpBody(n); printString(""); } + @Override public void visit(Node.ParamsAction n) throws JasperException { printAttributes(""); dumpBody(n); printString(""); } + @Override public void visit(Node.ParamAction n) throws JasperException { printAttributes(""); dumpBody(n); printString(""); } + @Override public void visit(Node.NamedAttribute n) throws JasperException { printAttributes(""); dumpBody(n); printString(""); } + @Override public void visit(Node.JspBody n) throws JasperException { printAttributes(""); dumpBody(n); printString(""); } + @Override public void visit(Node.ELExpression n) throws JasperException { printString( "${" + new String( n.getText() ) + "}" ); } + @Override public void visit(Node.CustomTag n) throws JasperException { printAttributes("<" + n.getQName(), n.getAttributes(), ">"); dumpBody(n); printString(""); } - public void visit(Node.UninterpretedTag n) throws JasperException { + @Override + public void visit(Node.UninterpretedTag n) throws JasperException { String tag = n.getQName(); printAttributes("<"+tag, n.getAttributes(), ">"); dumpBody(n); printString(""); } - public void visit(Node.TemplateText n) throws JasperException { + @Override + public void visit(Node.TemplateText n) throws JasperException { printString(new String(n.getText())); } diff --git a/java/org/apache/jasper/compiler/ELFunctionMapper.java b/java/org/apache/jasper/compiler/ELFunctionMapper.java index dd65bc5c0..252c2e4e6 100644 --- a/java/org/apache/jasper/compiler/ELFunctionMapper.java +++ b/java/org/apache/jasper/compiler/ELFunctionMapper.java @@ -70,37 +70,44 @@ public class ELFunctionMapper { */ private HashMap gMap = new HashMap(); + @Override public void visit(Node.ParamAction n) throws JasperException { doMap(n.getValue()); visitBody(n); } + @Override public void visit(Node.IncludeAction n) throws JasperException { doMap(n.getPage()); visitBody(n); } + @Override public void visit(Node.ForwardAction n) throws JasperException { doMap(n.getPage()); visitBody(n); } + @Override public void visit(Node.SetProperty n) throws JasperException { doMap(n.getValue()); visitBody(n); } + @Override public void visit(Node.UseBean n) throws JasperException { doMap(n.getBeanName()); visitBody(n); } + @Override public void visit(Node.PlugIn n) throws JasperException { doMap(n.getHeight()); doMap(n.getWidth()); visitBody(n); } + @Override public void visit(Node.JspElement n) throws JasperException { Node.JspAttribute[] attrs = n.getJspAttributes(); @@ -111,6 +118,7 @@ public class ELFunctionMapper { visitBody(n); } + @Override public void visit(Node.UninterpretedTag n) throws JasperException { Node.JspAttribute[] attrs = n.getJspAttributes(); @@ -120,6 +128,7 @@ public class ELFunctionMapper { visitBody(n); } + @Override public void visit(Node.CustomTag n) throws JasperException { Node.JspAttribute[] attrs = n.getJspAttributes(); for (int i = 0; attrs != null && i < attrs.length; i++) { @@ -128,6 +137,7 @@ public class ELFunctionMapper { visitBody(n); } + @Override public void visit(Node.ELExpression n) throws JasperException { doMap(n.getEL()); } @@ -150,6 +160,7 @@ public class ELFunctionMapper { ArrayList funcs = new ArrayList(); HashMap keyMap = new HashMap(); + @Override public void visit(ELNode.Function n) throws JasperException { String key = n.getPrefix() + ":" + n.getName(); if (! keyMap.containsKey(key)) { diff --git a/java/org/apache/jasper/compiler/ELNode.java b/java/org/apache/jasper/compiler/ELNode.java index 8d60c2196..166e3a4b2 100644 --- a/java/org/apache/jasper/compiler/ELNode.java +++ b/java/org/apache/jasper/compiler/ELNode.java @@ -52,6 +52,7 @@ abstract class ELNode { this.type = type; } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -76,6 +77,7 @@ abstract class ELNode { this.text = text; } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -97,6 +99,7 @@ abstract class ELNode { this.text = text; } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -125,6 +128,7 @@ abstract class ELNode { this.name = name; } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } diff --git a/java/org/apache/jasper/compiler/ELParser.java b/java/org/apache/jasper/compiler/ELParser.java index 045e9ab02..10879f464 100644 --- a/java/org/apache/jasper/compiler/ELParser.java +++ b/java/org/apache/jasper/compiler/ELParser.java @@ -320,6 +320,7 @@ public class ELParser { return 0; } + @Override public String toString() { return ""; } @@ -335,6 +336,7 @@ public class ELParser { this.id = id; } + @Override public String toString() { return id; } @@ -351,10 +353,12 @@ public class ELParser { this.ch = ch; } + @Override char toChar() { return ch; } + @Override public String toString() { return (new Character(ch)).toString(); } @@ -371,6 +375,7 @@ public class ELParser { this.value = v; } + @Override public String toString() { return value; } diff --git a/java/org/apache/jasper/compiler/ErrorDispatcher.java b/java/org/apache/jasper/compiler/ErrorDispatcher.java index ae9ee80c0..882575ed9 100644 --- a/java/org/apache/jasper/compiler/ErrorDispatcher.java +++ b/java/org/apache/jasper/compiler/ErrorDispatcher.java @@ -594,7 +594,8 @@ public class ErrorDispatcher { this.lineNum = lineNum; } - public void doVisit(Node n) throws JasperException { + @Override + public void doVisit(Node n) throws JasperException { if ((lineNum >= n.getBeginJavaLine()) && (lineNum < n.getEndJavaLine())) { found = n; diff --git a/java/org/apache/jasper/compiler/Generator.java b/java/org/apache/jasper/compiler/Generator.java index 4e11d40f7..40002dbf9 100644 --- a/java/org/apache/jasper/compiler/Generator.java +++ b/java/org/apache/jasper/compiler/Generator.java @@ -195,6 +195,7 @@ class Generator { * contains more than one page directive with an 'info' attribute, * their values match. */ + @Override public void visit(Node.PageDirective n) throws JasperException { if (getServletInfoGenerated) { @@ -216,6 +217,7 @@ class Generator { out.println(); } + @Override public void visit(Node.Declaration n) throws JasperException { n.setBeginJavaLine(out.getJavaLine()); out.printMultiLn(new String(n.getText())); @@ -224,6 +226,7 @@ class Generator { } // Custom Tags may contain declarations from tag plugins. + @Override public void visit(Node.CustomTag n) throws JasperException { if (n.useTagPlugin()) { if (n.getAtSTag() != null) { @@ -267,6 +270,7 @@ class Generator { * and adds it to the list of tag handler pool names unless it is * already contained in it. */ + @Override public void visit(Node.CustomTag n) throws JasperException { if (!n.implementsSimpleTag()) { @@ -332,6 +336,7 @@ class Generator { vars = new Vector(); } + @Override public void visit(Node.CustomTag n) throws JasperException { if (n.getCustomNestingLevel() > 0) { @@ -905,6 +910,7 @@ class Generator { this.separator = separator; } + @Override public void visit(Node.ParamAction n) throws JasperException { out.print(" + "); @@ -932,6 +938,7 @@ class Generator { } } + @Override public void visit(Node.Expression n) throws JasperException { n.setBeginJavaLine(out.getJavaLine()); out.printin("out.print("); @@ -940,6 +947,7 @@ class Generator { n.setEndJavaLine(out.getJavaLine()); } + @Override public void visit(Node.Scriptlet n) throws JasperException { n.setBeginJavaLine(out.getJavaLine()); out.printMultiLn(n.getText()); @@ -947,6 +955,7 @@ class Generator { n.setEndJavaLine(out.getJavaLine()); } + @Override public void visit(Node.ELExpression n) throws JasperException { n.setBeginJavaLine(out.getJavaLine()); if (!pageInfo.isELIgnored() && (n.getEL() != null)) { @@ -961,6 +970,7 @@ class Generator { n.setEndJavaLine(out.getJavaLine()); } + @Override public void visit(Node.IncludeAction n) throws JasperException { String flush = n.getTextAttribute("flush"); @@ -1050,6 +1060,7 @@ class Generator { return result; } + @Override public void visit(Node.ForwardAction n) throws JasperException { Node.JspAttribute page = n.getPage(); @@ -1094,6 +1105,7 @@ class Generator { // XXX Not sure if we can eliminate dead codes after this. } + @Override public void visit(Node.GetProperty n) throws JasperException { String name = n.getTextAttribute("name"); String property = n.getTextAttribute("property"); @@ -1139,6 +1151,7 @@ class Generator { n.setEndJavaLine(out.getJavaLine()); } + @Override public void visit(Node.SetProperty n) throws JasperException { String name = n.getTextAttribute("name"); String property = n.getTextAttribute("property"); @@ -1229,6 +1242,7 @@ class Generator { n.setEndJavaLine(out.getJavaLine()); } + @Override public void visit(Node.UseBean n) throws JasperException { String name = n.getTextAttribute("id"); @@ -1426,6 +1440,7 @@ class Generator { return " " + attr + "=\"" + value + '\"'; } + @Override public void visit(Node.PlugIn n) throws JasperException { /** @@ -1439,6 +1454,7 @@ class Generator { this.ie = ie; } + @Override public void visit(Node.ParamAction n) throws JasperException { String name = n.getTextAttribute("name"); @@ -1654,10 +1670,12 @@ class Generator { n.setEndJavaLine(out.getJavaLine()); } + @Override public void visit(Node.NamedAttribute n) throws JasperException { // Don't visit body of this tag - we already did earlier. } + @Override public void visit(Node.CustomTag n) throws JasperException { // Use plugin to generate more efficient code if there is one. @@ -1813,6 +1831,7 @@ class Generator { private static final String DOUBLE_QUOTE = "\\\""; + @Override public void visit(Node.UninterpretedTag n) throws JasperException { n.setBeginJavaLine(out.getJavaLine()); @@ -1871,6 +1890,7 @@ class Generator { n.setEndJavaLine(out.getJavaLine()); } + @Override public void visit(Node.JspElement n) throws JasperException { n.setBeginJavaLine(out.getJavaLine()); @@ -1938,6 +1958,7 @@ class Generator { } } + @Override public void visit(Node.TemplateText n) throws JasperException { String text = n.getText(); @@ -2046,6 +2067,7 @@ class Generator { n.setEndJavaLine(out.getJavaLine()); } + @Override public void visit(Node.JspBody n) throws JasperException { if (n.getBody() != null) { if (isSimpleTagHandler) { @@ -2059,6 +2081,7 @@ class Generator { } } + @Override public void visit(Node.InvokeAction n) throws JasperException { n.setBeginJavaLine(out.getJavaLine()); @@ -2108,6 +2131,7 @@ class Generator { n.setEndJavaLine(out.getJavaLine()); } + @Override public void visit(Node.DoBodyAction n) throws JasperException { n.setBeginJavaLine(out.getJavaLine()); @@ -2154,6 +2178,7 @@ class Generator { n.setEndJavaLine(out.getJavaLine()); } + @Override public void visit(Node.AttributeGenerator n) throws JasperException { Node.CustomTag tag = n.getTag(); Node.JspAttribute[] attrs = tag.getJspAttributes(); @@ -3958,6 +3983,7 @@ class Generator { return out; } + @Override public String toString() { return charWriter.toString(); } @@ -3977,10 +4003,12 @@ class Generator { try { body.visit(new Node.Visitor() { + @Override public void doVisit(Node n) { adjustJavaLine(n, offset); } + @Override public void visit(Node.CustomTag n) throws JasperException { Node.Nodes b = n.getBody(); @@ -4192,6 +4220,7 @@ class Generator { out.popIndent(); } + @Override public String toString() { return classBuffer.toString(); } diff --git a/java/org/apache/jasper/compiler/ImplicitTagLibraryInfo.java b/java/org/apache/jasper/compiler/ImplicitTagLibraryInfo.java index 049b0334a..a09662d03 100644 --- a/java/org/apache/jasper/compiler/ImplicitTagLibraryInfo.java +++ b/java/org/apache/jasper/compiler/ImplicitTagLibraryInfo.java @@ -180,6 +180,7 @@ class ImplicitTagLibraryInfo extends TagLibraryInfo { * @return The TagFileInfo corresponding to the given tag name, or null if * the given tag name is not implemented as a tag file */ + @Override public TagFileInfo getTagFile(String shortName) { TagFileInfo tagFile = super.getTagFile(shortName); @@ -210,6 +211,7 @@ class ImplicitTagLibraryInfo extends TagLibraryInfo { return tagFile; } + @Override public TagLibraryInfo[] getTagLibraryInfos() { Collection coll = pi.getTaglibs(); return coll.toArray(new TagLibraryInfo[0]); diff --git a/java/org/apache/jasper/compiler/JDTCompiler.java b/java/org/apache/jasper/compiler/JDTCompiler.java index 13a0c4f67..309681b49 100644 --- a/java/org/apache/jasper/compiler/JDTCompiler.java +++ b/java/org/apache/jasper/compiler/JDTCompiler.java @@ -64,6 +64,7 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler { /** * Compile the servlet from .java file to .class file */ + @Override protected void generateClass(String[] smap) throws FileNotFoundException, JasperException, Exception { diff --git a/java/org/apache/jasper/compiler/JasperTagInfo.java b/java/org/apache/jasper/compiler/JasperTagInfo.java index 8586d5e60..3136b0be9 100644 --- a/java/org/apache/jasper/compiler/JasperTagInfo.java +++ b/java/org/apache/jasper/compiler/JasperTagInfo.java @@ -52,6 +52,7 @@ class JasperTagInfo extends TagInfo { return dynamicAttrsMapName; } + @Override public boolean hasDynamicAttributes() { return dynamicAttrsMapName != null; } diff --git a/java/org/apache/jasper/compiler/JspDocumentParser.java b/java/org/apache/jasper/compiler/JspDocumentParser.java index 8379e428e..9feb10bb8 100644 --- a/java/org/apache/jasper/compiler/JspDocumentParser.java +++ b/java/org/apache/jasper/compiler/JspDocumentParser.java @@ -257,6 +257,7 @@ class JspDocumentParser * corresponding TagLibraryInfo object is added to the set of custom * tag libraries. */ + @Override public void startElement( String uri, String localName, @@ -451,6 +452,7 @@ class JspDocumentParser * * @throws SAXException */ + @Override public void characters(char[] buf, int offset, int len) { if (charBuffer == null) { @@ -607,6 +609,7 @@ class JspDocumentParser /* * Receives notification of the end of an element. */ + @Override public void endElement(String uri, String localName, String qName) throws SAXException { @@ -671,6 +674,7 @@ class JspDocumentParser * * @param locator the document locator */ + @Override public void setDocumentLocator(Locator locator) { this.locator = locator; } @@ -747,6 +751,7 @@ class JspDocumentParser /* * Receives notification of a non-recoverable error. */ + @Override public void fatalError(SAXParseException e) throws SAXException { throw e; } @@ -754,6 +759,7 @@ class JspDocumentParser /* * Receives notification of a recoverable error. */ + @Override public void error(SAXParseException e) throws SAXException { throw e; } @@ -761,6 +767,7 @@ class JspDocumentParser /* * Receives notification of the start of a Namespace mapping. */ + @Override public void startPrefixMapping(String prefix, String uri) throws SAXException { TagLibraryInfo taglibInfo; @@ -791,6 +798,7 @@ class JspDocumentParser /* * Receives notification of the end of a Namespace mapping. */ + @Override public void endPrefixMapping(String prefix) throws SAXException { if (directivesOnly) { diff --git a/java/org/apache/jasper/compiler/Mark.java b/java/org/apache/jasper/compiler/Mark.java index 2940a917d..d3b69adfe 100644 --- a/java/org/apache/jasper/compiler/Mark.java +++ b/java/org/apache/jasper/compiler/Mark.java @@ -200,6 +200,7 @@ final class Mark { return null; } + @Override public String toString() { return getFile()+"("+line+","+col+")"; } @@ -219,6 +220,7 @@ final class Mark { return ctxt.getResource(getFile()); } + @Override public boolean equals(Object other) { if (other instanceof Mark) { Mark m = (Mark) other; diff --git a/java/org/apache/jasper/compiler/Node.java b/java/org/apache/jasper/compiler/Node.java index a241a0f6b..2d4ea9f06 100644 --- a/java/org/apache/jasper/compiler/Node.java +++ b/java/org/apache/jasper/compiler/Node.java @@ -470,6 +470,7 @@ abstract class Node implements TagConstants { parentRoot = (Node.Root) r; } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -559,6 +560,7 @@ abstract class Node implements TagConstants { start, parent); } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -583,6 +585,7 @@ abstract class Node implements TagConstants { imports = new Vector(); } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -631,6 +634,7 @@ abstract class Node implements TagConstants { taglibAttrs, start, parent); } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -646,6 +650,7 @@ abstract class Node implements TagConstants { start, parent); } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -669,6 +674,7 @@ abstract class Node implements TagConstants { imports = new Vector(); } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -718,6 +724,7 @@ abstract class Node implements TagConstants { nonTaglibXmlnsAttrs, taglibAttrs, start, parent); } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -740,6 +747,7 @@ abstract class Node implements TagConstants { taglibAttrs, start, parent); } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -761,6 +769,7 @@ abstract class Node implements TagConstants { taglibAttrs, start, parent); } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -782,6 +791,7 @@ abstract class Node implements TagConstants { taglibAttrs, start, parent); } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -796,6 +806,7 @@ abstract class Node implements TagConstants { super(null, null, text, start, parent); } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -826,6 +837,7 @@ abstract class Node implements TagConstants { * * @return The text string */ + @Override public String getText() { String ret = text; if (ret == null) { @@ -847,6 +859,7 @@ abstract class Node implements TagConstants { * For the same reason as above, the source line information in the * contained TemplateText node should be used. */ + @Override public Mark getStart() { if (text == null && body != null && body.size() > 0) { return body.getNode(0).getStart(); @@ -872,6 +885,7 @@ abstract class Node implements TagConstants { start, parent); } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -893,6 +907,7 @@ abstract class Node implements TagConstants { start, parent); } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -913,6 +928,7 @@ abstract class Node implements TagConstants { start, parent); } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -933,6 +949,7 @@ abstract class Node implements TagConstants { this.type = type; } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -968,6 +985,7 @@ abstract class Node implements TagConstants { start, parent); } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -996,6 +1014,7 @@ abstract class Node implements TagConstants { start, parent); } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -1016,6 +1035,7 @@ abstract class Node implements TagConstants { taglibAttrs, start, parent); } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -1039,6 +1059,7 @@ abstract class Node implements TagConstants { taglibAttrs, start, parent); } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -1070,6 +1091,7 @@ abstract class Node implements TagConstants { taglibAttrs, start, parent); } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -1099,6 +1121,7 @@ abstract class Node implements TagConstants { taglibAttrs, start, parent); } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -1122,6 +1145,7 @@ abstract class Node implements TagConstants { taglibAttrs, start, parent); } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -1153,6 +1177,7 @@ abstract class Node implements TagConstants { taglibAttrs, start, parent); } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -1186,6 +1211,7 @@ abstract class Node implements TagConstants { taglibAttrs, start, parent); } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -1221,6 +1247,7 @@ abstract class Node implements TagConstants { start, parent); } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -1254,6 +1281,7 @@ abstract class Node implements TagConstants { taglibAttrs, start, parent); } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -1293,6 +1321,7 @@ abstract class Node implements TagConstants { taglibAttrs, start, parent); } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -1505,6 +1534,7 @@ abstract class Node implements TagConstants { this.implementsDynamicAttributes = tagInfo.hasDynamicAttributes(); } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -1792,6 +1822,7 @@ abstract class Node implements TagConstants { this.tag = tag; } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -1816,6 +1847,7 @@ abstract class Node implements TagConstants { start, parent); } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -1867,6 +1899,7 @@ abstract class Node implements TagConstants { } } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -1875,6 +1908,7 @@ abstract class Node implements TagConstants { return this.name; } + @Override public String getLocalName() { return this.localName; } @@ -1907,11 +1941,13 @@ abstract class Node implements TagConstants { * Since this method is only for attributes that are not rtexpr, we can * assume the body of the jsp:attribute is a template text. */ + @Override public String getText() { class AttributeVisitor extends Visitor { String attrValue = null; + @Override public void visit(TemplateText txt) { attrValue = new String(txt.getText()); } @@ -1956,6 +1992,7 @@ abstract class Node implements TagConstants { this.childInfo = new ChildInfo(); } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } @@ -1976,6 +2013,7 @@ abstract class Node implements TagConstants { super(null, null, text, start, parent); } + @Override public void accept(Visitor v) throws JasperException { v.visit(this); } diff --git a/java/org/apache/jasper/compiler/PageDataImpl.java b/java/org/apache/jasper/compiler/PageDataImpl.java index 5aa9b8a69..bf722c855 100644 --- a/java/org/apache/jasper/compiler/PageDataImpl.java +++ b/java/org/apache/jasper/compiler/PageDataImpl.java @@ -81,6 +81,7 @@ class PageDataImpl extends PageData implements TagConstants { * * @return the input stream of the XML view */ + @Override public InputStream getInputStream() { // Turn StringBuilder into InputStream try { @@ -123,7 +124,8 @@ class PageDataImpl extends PageData implements TagConstants { this.jspIdPrefix = "jsp"; } - public void visit(Node.Root n) throws JasperException { + @Override + public void visit(Node.Root n) throws JasperException { visitBody(n); if (n == root) { /* @@ -159,7 +161,8 @@ class PageDataImpl extends PageData implements TagConstants { } } - public void visit(Node.JspRoot n) throws JasperException { + @Override + public void visit(Node.JspRoot n) throws JasperException { addAttributes(n.getTaglibAttributes()); addAttributes(n.getNonTaglibXmlnsAttributes()); addAttributes(n.getAttributes()); @@ -171,7 +174,8 @@ class PageDataImpl extends PageData implements TagConstants { * Converts taglib directive into "xmlns:..." attribute of jsp:root * element. */ - public void visit(Node.TaglibDirective n) throws JasperException { + @Override + public void visit(Node.TaglibDirective n) throws JasperException { Attributes attrs = n.getAttributes(); if (attrs != null) { String qName = "xmlns:" + attrs.getValue("prefix"); @@ -256,7 +260,8 @@ class PageDataImpl extends PageData implements TagConstants { /* * Visits root node. */ - public void visit(Node.Root n) throws JasperException { + @Override + public void visit(Node.Root n) throws JasperException { if (n == this.root) { // top-level page appendXmlProlog(); @@ -277,40 +282,49 @@ class PageDataImpl extends PageData implements TagConstants { * Any nested jsp:root elements (from pages included via an * include directive) are ignored. */ - public void visit(Node.JspRoot n) throws JasperException { + @Override + public void visit(Node.JspRoot n) throws JasperException { visitBody(n); } - public void visit(Node.PageDirective n) throws JasperException { + @Override + public void visit(Node.PageDirective n) throws JasperException { appendPageDirective(n); } - public void visit(Node.IncludeDirective n) throws JasperException { + @Override + public void visit(Node.IncludeDirective n) throws JasperException { // expand in place visitBody(n); } - public void visit(Node.Comment n) throws JasperException { + @Override + public void visit(Node.Comment n) throws JasperException { // Comments are ignored in XML view } - public void visit(Node.Declaration n) throws JasperException { + @Override + public void visit(Node.Declaration n) throws JasperException { appendTag(n); } - public void visit(Node.Expression n) throws JasperException { + @Override + public void visit(Node.Expression n) throws JasperException { appendTag(n); } - public void visit(Node.Scriptlet n) throws JasperException { + @Override + public void visit(Node.Scriptlet n) throws JasperException { appendTag(n); } - public void visit(Node.JspElement n) throws JasperException { + @Override + public void visit(Node.JspElement n) throws JasperException { appendTag(n); } - public void visit(Node.ELExpression n) throws JasperException { + @Override + public void visit(Node.ELExpression n) throws JasperException { if (!n.getRoot().isXmlSyntax()) { buf.append("<").append(JSP_TEXT_ACTION); buf.append(" "); @@ -327,87 +341,107 @@ class PageDataImpl extends PageData implements TagConstants { buf.append("\n"); } - public void visit(Node.IncludeAction n) throws JasperException { + @Override + public void visit(Node.IncludeAction n) throws JasperException { appendTag(n); } - public void visit(Node.ForwardAction n) throws JasperException { + @Override + public void visit(Node.ForwardAction n) throws JasperException { appendTag(n); } - public void visit(Node.GetProperty n) throws JasperException { + @Override + public void visit(Node.GetProperty n) throws JasperException { appendTag(n); } - public void visit(Node.SetProperty n) throws JasperException { + @Override + public void visit(Node.SetProperty n) throws JasperException { appendTag(n); } - public void visit(Node.ParamAction n) throws JasperException { + @Override + public void visit(Node.ParamAction n) throws JasperException { appendTag(n); } - public void visit(Node.ParamsAction n) throws JasperException { + @Override + public void visit(Node.ParamsAction n) throws JasperException { appendTag(n); } - public void visit(Node.FallBackAction n) throws JasperException { + @Override + public void visit(Node.FallBackAction n) throws JasperException { appendTag(n); } - public void visit(Node.UseBean n) throws JasperException { + @Override + public void visit(Node.UseBean n) throws JasperException { appendTag(n); } - public void visit(Node.PlugIn n) throws JasperException { + @Override + public void visit(Node.PlugIn n) throws JasperException { appendTag(n); } + @Override public void visit(Node.NamedAttribute n) throws JasperException { appendTag(n); } + @Override public void visit(Node.JspBody n) throws JasperException { appendTag(n); } - public void visit(Node.CustomTag n) throws JasperException { + @Override + public void visit(Node.CustomTag n) throws JasperException { boolean resetDefaultNSSave = resetDefaultNS; appendTag(n, resetDefaultNS); resetDefaultNS = resetDefaultNSSave; } - public void visit(Node.UninterpretedTag n) throws JasperException { + @Override + public void visit(Node.UninterpretedTag n) throws JasperException { boolean resetDefaultNSSave = resetDefaultNS; appendTag(n, resetDefaultNS); resetDefaultNS = resetDefaultNSSave; } - public void visit(Node.JspText n) throws JasperException { + @Override + public void visit(Node.JspText n) throws JasperException { appendTag(n); } - public void visit(Node.DoBodyAction n) throws JasperException { + @Override + public void visit(Node.DoBodyAction n) throws JasperException { appendTag(n); } + @Override public void visit(Node.InvokeAction n) throws JasperException { appendTag(n); } - public void visit(Node.TagDirective n) throws JasperException { + @Override + public void visit(Node.TagDirective n) throws JasperException { appendTagDirective(n); } - public void visit(Node.AttributeDirective n) throws JasperException { + @Override + public void visit(Node.AttributeDirective n) throws JasperException { appendTag(n); } - public void visit(Node.VariableDirective n) throws JasperException { + @Override + public void visit(Node.VariableDirective n) throws JasperException { appendTag(n); } - public void visit(Node.TemplateText n) throws JasperException { + @Override + public void visit(Node.TemplateText n) throws JasperException { /* * If the template text came from a JSP page written in JSP syntax, * create a jsp:text element for it (JSP 5.3.2). diff --git a/java/org/apache/jasper/compiler/ScriptingVariabler.java b/java/org/apache/jasper/compiler/ScriptingVariabler.java index b9cce77ca..4a2f91e5c 100644 --- a/java/org/apache/jasper/compiler/ScriptingVariabler.java +++ b/java/org/apache/jasper/compiler/ScriptingVariabler.java @@ -41,7 +41,8 @@ class ScriptingVariabler { private int count; private Node.CustomTag parent; - public void visit(Node.CustomTag n) throws JasperException { + @Override + public void visit(Node.CustomTag n) throws JasperException { n.setCustomTagParent(parent); Node.CustomTag tmpParent = parent; parent = n; @@ -65,7 +66,8 @@ class ScriptingVariabler { scriptVars = new Hashtable(); } - public void visit(Node.CustomTag n) throws JasperException { + @Override + public void visit(Node.CustomTag n) throws JasperException { setScriptingVars(n, VariableInfo.AT_BEGIN); setScriptingVars(n, VariableInfo.NESTED); new ScriptingVariableVisitor(err).visitBody(n); diff --git a/java/org/apache/jasper/compiler/SmapGenerator.java b/java/org/apache/jasper/compiler/SmapGenerator.java index 21b559c6d..2c92bae0c 100644 --- a/java/org/apache/jasper/compiler/SmapGenerator.java +++ b/java/org/apache/jasper/compiler/SmapGenerator.java @@ -139,6 +139,7 @@ public class SmapGenerator { return out.toString(); } + @Override public String toString() { return getString(); } //********************************************************************* diff --git a/java/org/apache/jasper/compiler/SmapStratum.java b/java/org/apache/jasper/compiler/SmapStratum.java index 74942a90b..9b1fc09fb 100644 --- a/java/org/apache/jasper/compiler/SmapStratum.java +++ b/java/org/apache/jasper/compiler/SmapStratum.java @@ -106,6 +106,7 @@ public class SmapStratum { return out.toString(); } + @Override public String toString() { return getString(); } @@ -329,6 +330,7 @@ public class SmapStratum { return out.toString(); } + @Override public String toString() { return getString(); } diff --git a/java/org/apache/jasper/compiler/SmapUtil.java b/java/org/apache/jasper/compiler/SmapUtil.java index 767e3dce5..6f5ff343b 100644 --- a/java/org/apache/jasper/compiler/SmapUtil.java +++ b/java/org/apache/jasper/compiler/SmapUtil.java @@ -503,6 +503,7 @@ public class SmapUtil { this.innerClassMap = map; } + @Override public void visitBody(Node n) throws JasperException { SmapStratum smapSave = smap; String innerClass = n.getInnerClassName(); @@ -513,91 +514,110 @@ public class SmapUtil { smap = smapSave; } + @Override public void visit(Node.Declaration n) throws JasperException { doSmapText(n); } + @Override public void visit(Node.Expression n) throws JasperException { doSmapText(n); } + @Override public void visit(Node.Scriptlet n) throws JasperException { doSmapText(n); } + @Override public void visit(Node.IncludeAction n) throws JasperException { doSmap(n); visitBody(n); } + @Override public void visit(Node.ForwardAction n) throws JasperException { doSmap(n); visitBody(n); } + @Override public void visit(Node.GetProperty n) throws JasperException { doSmap(n); visitBody(n); } + @Override public void visit(Node.SetProperty n) throws JasperException { doSmap(n); visitBody(n); } + @Override public void visit(Node.UseBean n) throws JasperException { doSmap(n); visitBody(n); } + @Override public void visit(Node.PlugIn n) throws JasperException { doSmap(n); visitBody(n); } + @Override public void visit(Node.CustomTag n) throws JasperException { doSmap(n); visitBody(n); } + @Override public void visit(Node.UninterpretedTag n) throws JasperException { doSmap(n); visitBody(n); } + @Override public void visit(Node.JspElement n) throws JasperException { doSmap(n); visitBody(n); } + @Override public void visit(Node.JspText n) throws JasperException { doSmap(n); visitBody(n); } + @Override public void visit(Node.NamedAttribute n) throws JasperException { visitBody(n); } + @Override public void visit(Node.JspBody n) throws JasperException { doSmap(n); visitBody(n); } + @Override public void visit(Node.InvokeAction n) throws JasperException { doSmap(n); visitBody(n); } + @Override public void visit(Node.DoBodyAction n) throws JasperException { doSmap(n); visitBody(n); } + @Override public void visit(Node.ELExpression n) throws JasperException { doSmap(n); } + @Override public void visit(Node.TemplateText n) throws JasperException { Mark mark = n.getStart(); if (mark == null) { @@ -702,6 +722,7 @@ public class SmapUtil { HashMap map = new HashMap(); + @Override public void doVisit(Node n) { String inner = n.getInnerClassName(); if (inner != null && !map.containsKey(inner)) { diff --git a/java/org/apache/jasper/compiler/TagFileProcessor.java b/java/org/apache/jasper/compiler/TagFileProcessor.java index ed3a1e6e1..e1fd86c56 100644 --- a/java/org/apache/jasper/compiler/TagFileProcessor.java +++ b/java/org/apache/jasper/compiler/TagFileProcessor.java @@ -146,6 +146,7 @@ class TagFileProcessor { variableVector = new Vector(); } + @Override public void visit(Node.TagDirective n) throws JasperException { JspUtil.checkAttributes("Tag directive", n, tagDirectiveAttrs, err); @@ -188,6 +189,7 @@ class TagFileProcessor { return result; } + @Override public void visit(Node.AttributeDirective n) throws JasperException { JspUtil.checkAttributes("Attribute directive", n, @@ -287,6 +289,7 @@ class TagFileProcessor { checkUniqueName(attrName, ATTR_NAME, n, tagAttributeInfo); } + @Override public void visit(Node.VariableDirective n) throws JasperException { JspUtil.checkAttributes("Variable directive", n, @@ -637,6 +640,7 @@ class TagFileProcessor { this.pageInfo = compiler.getPageInfo(); } + @Override public void visit(Node.CustomTag n) throws JasperException { TagFileInfo tagFileInfo = n.getTagFileInfo(); if (tagFileInfo != null) { diff --git a/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java b/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java index 63725b324..2fc299af7 100644 --- a/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java +++ b/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java @@ -83,6 +83,7 @@ class TagLibraryInfoImpl extends TagLibraryInfo implements TagConstants { } } + @Override public String toString() { StringWriter sw = new StringWriter(); PrintWriter out = new PrintWriter(sw); @@ -205,6 +206,7 @@ class TagLibraryInfoImpl extends TagLibraryInfo implements TagConstants { } + @Override public TagLibraryInfo[] getTagLibraryInfos() { Collection coll = pi.getTaglibs(); return coll.toArray(new TagLibraryInfo[0]); diff --git a/java/org/apache/jasper/compiler/TagPluginManager.java b/java/org/apache/jasper/compiler/TagPluginManager.java index 926f3df97..c50fb3d8b 100644 --- a/java/org/apache/jasper/compiler/TagPluginManager.java +++ b/java/org/apache/jasper/compiler/TagPluginManager.java @@ -57,6 +57,7 @@ public class TagPluginManager { this.pageInfo = pageInfo; page.visit(new Node.Visitor() { + @Override public void visit(Node.CustomTag n) throws JasperException { invokePlugin(n); diff --git a/java/org/apache/jasper/compiler/TextOptimizer.java b/java/org/apache/jasper/compiler/TextOptimizer.java index 380cdff12..8221fbca4 100644 --- a/java/org/apache/jasper/compiler/TextOptimizer.java +++ b/java/org/apache/jasper/compiler/TextOptimizer.java @@ -40,6 +40,7 @@ public class TextOptimizer { pageInfo = compiler.getPageInfo(); } + @Override public void doVisit(Node n) throws JasperException { collectText(); } @@ -48,29 +49,36 @@ public class TextOptimizer { * The following directis are ignored in text concatenation */ + @Override public void visit(Node.PageDirective n) throws JasperException { } + @Override public void visit(Node.TagDirective n) throws JasperException { } + @Override public void visit(Node.TaglibDirective n) throws JasperException { } + @Override public void visit(Node.AttributeDirective n) throws JasperException { } + @Override public void visit(Node.VariableDirective n) throws JasperException { } /* * Don't concatenate text across body boundaries */ + @Override public void visitBody(Node n) throws JasperException { super.visitBody(n); collectText(); } + @Override public void visit(Node.TemplateText n) throws JasperException { if ((options.getTrimSpaces() || pageInfo.isTrimDirectiveWhitespaces()) && n.isAllSpace()) { diff --git a/java/org/apache/jasper/compiler/Validator.java b/java/org/apache/jasper/compiler/Validator.java index 55973553e..81a0f5e0a 100644 --- a/java/org/apache/jasper/compiler/Validator.java +++ b/java/org/apache/jasper/compiler/Validator.java @@ -90,6 +90,7 @@ class Validator { this.err = compiler.getErrorDispatcher(); } + @Override public void visit(Node.IncludeDirective n) throws JasperException { // Since pageDirectiveSeen flag only applies to the Current page // save it here and restore it after the file is included. @@ -99,6 +100,7 @@ class Validator { pageEncodingSeen = pageEncodingSeenSave; } + @Override public void visit(Node.PageDirective n) throws JasperException { JspUtil.checkAttributes("Page directive", n, pageDirectiveAttrs, @@ -233,6 +235,7 @@ class Validator { pageInfo.addImports(n.getImports()); } + @Override public void visit(Node.TagDirective n) throws JasperException { // Note: Most of the validation is done in TagFileProcessor // when it created a TagInfo object from the @@ -300,12 +303,14 @@ class Validator { pageInfo.addImports(n.getImports()); } + @Override public void visit(Node.AttributeDirective n) throws JasperException { // Do nothing, since this attribute directive has already been // validated by TagFileProcessor when it created a TagInfo object // from the tag file in which the directive appeared } + @Override public void visit(Node.VariableDirective n) throws JasperException { // Do nothing, since this variable directive has already been // validated by TagFileProcessor when it created a TagInfo object @@ -506,6 +511,7 @@ class Validator { this.loader = compiler.getCompilationContext().getClassLoader(); } + @Override public void visit(Node.JspRoot n) throws JasperException { JspUtil.checkAttributes("Jsp:root", n, jspRootAttrs, err); String version = n.getTextAttribute("version"); @@ -515,12 +521,14 @@ class Validator { visitBody(n); } + @Override public void visit(Node.IncludeDirective n) throws JasperException { JspUtil.checkAttributes("Include directive", n, includeDirectiveAttrs, err); visitBody(n); } + @Override public void visit(Node.TaglibDirective n) throws JasperException { JspUtil.checkAttributes("Taglib directive", n, taglibDirectiveAttrs, err); @@ -537,6 +545,7 @@ class Validator { } } + @Override public void visit(Node.ParamAction n) throws JasperException { JspUtil.checkAttributes("Param action", n, paramActionAttrs, err); // make sure the value of the 'name' attribute is not a @@ -547,6 +556,7 @@ class Validator { visitBody(n); } + @Override public void visit(Node.ParamsAction n) throws JasperException { // Make sure we've got at least one nested jsp:param Node.Nodes subElems = n.getBody(); @@ -556,6 +566,7 @@ class Validator { visitBody(n); } + @Override public void visit(Node.IncludeAction n) throws JasperException { JspUtil.checkAttributes("Include action", n, includeActionAttrs, err); @@ -564,6 +575,7 @@ class Validator { visitBody(n); } + @Override public void visit(Node.ForwardAction n) throws JasperException { JspUtil.checkAttributes("Forward", n, forwardActionAttrs, err); n.setPage(getJspAttribute(null, "page", null, null, n @@ -571,10 +583,12 @@ class Validator { visitBody(n); } + @Override public void visit(Node.GetProperty n) throws JasperException { JspUtil.checkAttributes("GetProperty", n, getPropertyAttrs, err); } + @Override public void visit(Node.SetProperty n) throws JasperException { JspUtil.checkAttributes("SetProperty", n, setPropertyAttrs, err); String property = n.getTextAttribute("property"); @@ -597,6 +611,7 @@ class Validator { visitBody(n); } + @Override public void visit(Node.UseBean n) throws JasperException { JspUtil.checkAttributes("UseBean", n, useBeanAttrs, err); @@ -630,6 +645,7 @@ class Validator { visitBody(n); } + @Override public void visit(Node.PlugIn n) throws JasperException { JspUtil.checkAttributes("Plugin", n, plugInAttrs, err); @@ -664,33 +680,39 @@ class Validator { visitBody(n); } + @Override public void visit(Node.NamedAttribute n) throws JasperException { JspUtil.checkAttributes("Attribute", n, attributeAttrs, err); visitBody(n); } + @Override public void visit(Node.JspBody n) throws JasperException { visitBody(n); } + @Override public void visit(Node.Declaration n) throws JasperException { if (pageInfo.isScriptingInvalid()) { err.jspError(n.getStart(), "jsp.error.no.scriptlets"); } } + @Override public void visit(Node.Expression n) throws JasperException { if (pageInfo.isScriptingInvalid()) { err.jspError(n.getStart(), "jsp.error.no.scriptlets"); } } + @Override public void visit(Node.Scriptlet n) throws JasperException { if (pageInfo.isScriptingInvalid()) { err.jspError(n.getStart(), "jsp.error.no.scriptlets"); } } + @Override public void visit(Node.ELExpression n) throws JasperException { // exit if we are ignoring EL all together if (pageInfo.isELIgnored()) @@ -721,6 +743,7 @@ class Validator { n.setEL(el); } + @Override public void visit(Node.UninterpretedTag n) throws JasperException { if (n.getNamedAttributeNodes().size() != 0) { err.jspError(n, "jsp.error.namedAttribute.invalidUse"); @@ -773,6 +796,7 @@ class Validator { return false; } + @Override public void visit(Node.CustomTag n) throws JasperException { TagInfo tagInfo = n.getTagInfo(); @@ -863,6 +887,7 @@ class Validator { visitBody(n); } + @Override public void visit(Node.JspElement n) throws JasperException { Attributes attrs = n.getAttributes(); @@ -911,6 +936,7 @@ class Validator { visitBody(n); } + @Override public void visit(Node.JspOutput n) throws JasperException { JspUtil.checkAttributes("jsp:output", n, jspOutputAttrs, err); @@ -975,6 +1001,7 @@ class Validator { } } + @Override public void visit(Node.InvokeAction n) throws JasperException { JspUtil.checkAttributes("Invoke", n, invokeAttrs, err); @@ -992,6 +1019,7 @@ class Validator { } } + @Override public void visit(Node.DoBodyAction n) throws JasperException { JspUtil.checkAttributes("DoBody", n, doBodyAttrs, err); @@ -1418,6 +1446,7 @@ class Validator { private static class NamedAttributeVisitor extends Node.Visitor { private boolean hasDynamicContent; + @Override public void doVisit(Node n) throws JasperException { if (!(n instanceof Node.JspText) && !(n instanceof Node.TemplateText)) { @@ -1468,6 +1497,7 @@ class Validator { this.n = n; } + @Override public void visit(ELNode.Function func) throws JasperException { String prefix = func.getPrefix(); String function = func.getName(); @@ -1599,6 +1629,7 @@ class Validator { fnmap.put(fnQName, method); } + @Override public Method resolveFunction(String prefix, String localName) { return this.fnmap.get(prefix + ":" + localName); } @@ -1611,6 +1642,7 @@ class Validator { this.fmapper = fmapper; } + @Override public void visit(ELNode.Function n) throws JasperException { Class c = null; @@ -1666,6 +1698,7 @@ class Validator { this.err = compiler.getErrorDispatcher(); } + @Override public void visit(Node.CustomTag n) throws JasperException { TagInfo tagInfo = n.getTagInfo(); if (tagInfo == null) { diff --git a/java/org/apache/jasper/el/ELContextImpl.java b/java/org/apache/jasper/el/ELContextImpl.java index f79955a8b..ccc296e48 100644 --- a/java/org/apache/jasper/el/ELContextImpl.java +++ b/java/org/apache/jasper/el/ELContextImpl.java @@ -36,6 +36,7 @@ import org.apache.jasper.Constants; public final class ELContextImpl extends ELContext { private final static FunctionMapper NullFunctionMapper = new FunctionMapper() { + @Override public Method resolveFunction(String prefix, String localName) { return null; } @@ -45,6 +46,7 @@ public final class ELContextImpl extends ELContext { private Map vars; + @Override public ValueExpression resolveVariable(String variable) { if (vars == null) { return null; @@ -52,6 +54,7 @@ public final class ELContextImpl extends ELContext { return vars.get(variable); } + @Override public ValueExpression setVariable(String variable, ValueExpression expression) { if (vars == null) @@ -71,6 +74,7 @@ public final class ELContextImpl extends ELContext { this(ELResolverImpl.getDefaultResolver()); if (Constants.IS_SECURITY_ENABLED) { functionMapper = new FunctionMapper() { + @Override public Method resolveFunction(String prefix, String localName) { return null; } @@ -84,14 +88,17 @@ public final class ELContextImpl extends ELContext { this.resolver = resolver; } + @Override public ELResolver getELResolver() { return this.resolver; } + @Override public FunctionMapper getFunctionMapper() { return this.functionMapper; } + @Override public VariableMapper getVariableMapper() { if (this.variableMapper == null) { this.variableMapper = new VariableMapperImpl(); diff --git a/java/org/apache/jasper/el/ELContextWrapper.java b/java/org/apache/jasper/el/ELContextWrapper.java index a0754c3ef..80e0a96a0 100644 --- a/java/org/apache/jasper/el/ELContextWrapper.java +++ b/java/org/apache/jasper/el/ELContextWrapper.java @@ -38,39 +38,48 @@ public final class ELContextWrapper extends ELContext { this.fnMapper = fnMapper; } + @Override public ELResolver getELResolver() { return this.target.getELResolver(); } + @Override public FunctionMapper getFunctionMapper() { if (this.fnMapper != null) return this.fnMapper; return this.target.getFunctionMapper(); } + @Override public VariableMapper getVariableMapper() { return this.target.getVariableMapper(); } + @Override public Object getContext(Class key) { return this.target.getContext(key); } + @Override public Locale getLocale() { return this.target.getLocale(); } + @Override public boolean isPropertyResolved() { return this.target.isPropertyResolved(); } + @Override public void putContext(Class key, Object contextObject) throws NullPointerException { this.target.putContext(key, contextObject); } + @Override public void setLocale(Locale locale) { this.target.setLocale(locale); } + @Override public void setPropertyResolved(boolean resolved) { this.target.setPropertyResolved(resolved); } diff --git a/java/org/apache/jasper/el/ELResolverImpl.java b/java/org/apache/jasper/el/ELResolverImpl.java index fcea32ad0..70dca5a08 100644 --- a/java/org/apache/jasper/el/ELResolverImpl.java +++ b/java/org/apache/jasper/el/ELResolverImpl.java @@ -51,7 +51,8 @@ public final class ELResolverImpl extends ELResolver { this.variableResolver = variableResolver; } - public Object getValue(ELContext context, Object base, Object property) + @Override + public Object getValue(ELContext context, Object base, Object property) throws NullPointerException, PropertyNotFoundException, ELException { if (context == null) { throw new NullPointerException(); @@ -75,7 +76,8 @@ public final class ELResolverImpl extends ELResolver { return null; } - public Class getType(ELContext context, Object base, Object property) + @Override + public Class getType(ELContext context, Object base, Object property) throws NullPointerException, PropertyNotFoundException, ELException { if (context == null) { throw new NullPointerException(); @@ -100,7 +102,8 @@ public final class ELResolverImpl extends ELResolver { return null; } - public void setValue(ELContext context, Object base, Object property, + @Override + public void setValue(ELContext context, Object base, Object property, Object value) throws NullPointerException, PropertyNotFoundException, PropertyNotWritableException, ELException { @@ -119,7 +122,8 @@ public final class ELResolverImpl extends ELResolver { } } - public boolean isReadOnly(ELContext context, Object base, Object property) + @Override + public boolean isReadOnly(ELContext context, Object base, Object property) throws NullPointerException, PropertyNotFoundException, ELException { if (context == null) { throw new NullPointerException(); @@ -133,11 +137,13 @@ public final class ELResolverImpl extends ELResolver { return getDefaultResolver().isReadOnly(context, base, property); } - public Iterator getFeatureDescriptors(ELContext context, Object base) { + @Override + public Iterator getFeatureDescriptors(ELContext context, Object base) { return getDefaultResolver().getFeatureDescriptors(context, base); } - public Class getCommonPropertyType(ELContext context, Object base) { + @Override + public Class getCommonPropertyType(ELContext context, Object base) { if (base == null) { return String.class; } diff --git a/java/org/apache/jasper/el/ExpressionEvaluatorImpl.java b/java/org/apache/jasper/el/ExpressionEvaluatorImpl.java index b0c11d73d..4260cc7f4 100644 --- a/java/org/apache/jasper/el/ExpressionEvaluatorImpl.java +++ b/java/org/apache/jasper/el/ExpressionEvaluatorImpl.java @@ -34,7 +34,8 @@ public final class ExpressionEvaluatorImpl extends ExpressionEvaluator { this.factory = factory; } - public Expression parseExpression(String expression, Class expectedType, + @Override + public Expression parseExpression(String expression, Class expectedType, FunctionMapper fMapper) throws ELException { try { ELContextImpl ctx = @@ -49,7 +50,8 @@ public final class ExpressionEvaluatorImpl extends ExpressionEvaluator { } } - public Object evaluate(String expression, Class expectedType, + @Override + public Object evaluate(String expression, Class expectedType, VariableResolver vResolver, FunctionMapper fMapper) throws ELException { return this.parseExpression(expression, expectedType, fMapper).evaluate(vResolver); diff --git a/java/org/apache/jasper/el/ExpressionImpl.java b/java/org/apache/jasper/el/ExpressionImpl.java index 107326dfb..82623fd3a 100644 --- a/java/org/apache/jasper/el/ExpressionImpl.java +++ b/java/org/apache/jasper/el/ExpressionImpl.java @@ -30,7 +30,8 @@ public final class ExpressionImpl extends Expression { this.ve = ve; } - public Object evaluate(VariableResolver vResolver) throws ELException { + @Override + public Object evaluate(VariableResolver vResolver) throws ELException { ELContext ctx = new ELContextImpl(new ELResolverImpl(vResolver)); return ve.getValue(ctx); } diff --git a/java/org/apache/jasper/el/FunctionMapperImpl.java b/java/org/apache/jasper/el/FunctionMapperImpl.java index 0cf84ecde..7e69332bf 100644 --- a/java/org/apache/jasper/el/FunctionMapperImpl.java +++ b/java/org/apache/jasper/el/FunctionMapperImpl.java @@ -28,7 +28,8 @@ public final class FunctionMapperImpl extends javax.el.FunctionMapper { this.fnMapper = fnMapper; } - public Method resolveFunction(String prefix, String localName) { + @Override + public Method resolveFunction(String prefix, String localName) { return this.fnMapper.resolveFunction(prefix, localName); } diff --git a/java/org/apache/jasper/el/JspMethodExpression.java b/java/org/apache/jasper/el/JspMethodExpression.java index b48e00342..9de7f00a5 100644 --- a/java/org/apache/jasper/el/JspMethodExpression.java +++ b/java/org/apache/jasper/el/JspMethodExpression.java @@ -44,6 +44,7 @@ public final class JspMethodExpression extends MethodExpression implements this.mark = mark; } + @Override public MethodInfo getMethodInfo(ELContext context) throws NullPointerException, PropertyNotFoundException, MethodNotFoundException, ELException { @@ -61,6 +62,7 @@ public final class JspMethodExpression extends MethodExpression implements } } + @Override public Object invoke(ELContext context, Object[] params) throws NullPointerException, PropertyNotFoundException, MethodNotFoundException, ELException { @@ -78,18 +80,22 @@ public final class JspMethodExpression extends MethodExpression implements } } + @Override public boolean equals(Object obj) { return this.target.equals(obj); } + @Override public int hashCode() { return this.target.hashCode(); } + @Override public String getExpressionString() { return this.target.getExpressionString(); } + @Override public boolean isLiteralText() { return this.target.isLiteralText(); } diff --git a/java/org/apache/jasper/el/JspValueExpression.java b/java/org/apache/jasper/el/JspValueExpression.java index d8c32a072..dccafba91 100644 --- a/java/org/apache/jasper/el/JspValueExpression.java +++ b/java/org/apache/jasper/el/JspValueExpression.java @@ -48,10 +48,12 @@ public final class JspValueExpression extends ValueExpression implements this.mark = mark; } + @Override public Class getExpectedType() { return this.target.getExpectedType(); } + @Override public Class getType(ELContext context) throws NullPointerException, PropertyNotFoundException, ELException { try { @@ -65,6 +67,7 @@ public final class JspValueExpression extends ValueExpression implements } } + @Override public boolean isReadOnly(ELContext context) throws NullPointerException, PropertyNotFoundException, ELException { try { @@ -78,6 +81,7 @@ public final class JspValueExpression extends ValueExpression implements } } + @Override public void setValue(ELContext context, Object value) throws NullPointerException, PropertyNotFoundException, PropertyNotWritableException, ELException { @@ -95,6 +99,7 @@ public final class JspValueExpression extends ValueExpression implements } } + @Override public Object getValue(ELContext context) throws NullPointerException, PropertyNotFoundException, ELException { try { @@ -108,18 +113,22 @@ public final class JspValueExpression extends ValueExpression implements } } + @Override public boolean equals(Object obj) { return this.target.equals(obj); } + @Override public int hashCode() { return this.target.hashCode(); } + @Override public String getExpressionString() { return this.target.getExpressionString(); } + @Override public boolean isLiteralText() { return this.target.isLiteralText(); } diff --git a/java/org/apache/jasper/runtime/BodyContentImpl.java b/java/org/apache/jasper/runtime/BodyContentImpl.java index 1c2a8e797..d99a4f793 100644 --- a/java/org/apache/jasper/runtime/BodyContentImpl.java +++ b/java/org/apache/jasper/runtime/BodyContentImpl.java @@ -65,6 +65,7 @@ public class BodyContentImpl extends BodyContent { /** * Write a single character. */ + @Override public void write(int c) throws IOException { if (writer != null) { writer.write(c); @@ -92,6 +93,7 @@ public class BodyContentImpl extends BodyContent { * @param off Offset from which to start reading characters * @param len Number of characters to write */ + @Override public void write(char[] cbuf, int off, int len) throws IOException { if (writer != null) { writer.write(cbuf, off, len); @@ -117,6 +119,7 @@ public class BodyContentImpl extends BodyContent { * Write an array of characters. This method cannot be inherited from the * Writer class because it must suppress I/O exceptions. */ + @Override public void write(char[] buf) throws IOException { if (writer != null) { writer.write(buf); @@ -132,6 +135,7 @@ public class BodyContentImpl extends BodyContent { * @param off Offset from which to start reading characters * @param len Number of characters to be written */ + @Override public void write(String s, int off, int len) throws IOException { if (writer != null) { writer.write(s, off, len); @@ -149,6 +153,7 @@ public class BodyContentImpl extends BodyContent { * Write a string. This method cannot be inherited from the Writer class * because it must suppress I/O exceptions. */ + @Override public void write(String s) throws IOException { if (writer != null) { writer.write(s); @@ -164,6 +169,7 @@ public class BodyContentImpl extends BodyContent { * * @throws IOException If an I/O error occurs */ + @Override public void newLine() throws IOException { if (writer != null) { writer.write(LINE_SEPARATOR); @@ -182,6 +188,7 @@ public class BodyContentImpl extends BodyContent { * @param b The boolean to be printed * @throws IOException */ + @Override public void print(boolean b) throws IOException { if (writer != null) { writer.write(b ? "true" : "false"); @@ -199,6 +206,7 @@ public class BodyContentImpl extends BodyContent { * @param c The char to be printed * @throws IOException */ + @Override public void print(char c) throws IOException { if (writer != null) { writer.write(String.valueOf(c)); @@ -217,6 +225,7 @@ public class BodyContentImpl extends BodyContent { * @param i The int to be printed * @throws IOException */ + @Override public void print(int i) throws IOException { if (writer != null) { writer.write(String.valueOf(i)); @@ -235,6 +244,7 @@ public class BodyContentImpl extends BodyContent { * @param l The long to be printed * @throws IOException */ + @Override public void print(long l) throws IOException { if (writer != null) { writer.write(String.valueOf(l)); @@ -253,6 +263,7 @@ public class BodyContentImpl extends BodyContent { * @param f The float to be printed * @throws IOException */ + @Override public void print(float f) throws IOException { if (writer != null) { writer.write(String.valueOf(f)); @@ -271,6 +282,7 @@ public class BodyContentImpl extends BodyContent { * @param d The double to be printed * @throws IOException */ + @Override public void print(double d) throws IOException { if (writer != null) { writer.write(String.valueOf(d)); @@ -290,6 +302,7 @@ public class BodyContentImpl extends BodyContent { * @throws NullPointerException If s is null * @throws IOException */ + @Override public void print(char[] s) throws IOException { if (writer != null) { writer.write(s); @@ -308,6 +321,7 @@ public class BodyContentImpl extends BodyContent { * @param s The String to be printed * @throws IOException */ + @Override public void print(String s) throws IOException { if (s == null) s = "null"; if (writer != null) { @@ -327,6 +341,7 @@ public class BodyContentImpl extends BodyContent { * @param obj The Object to be printed * @throws IOException */ + @Override public void print(Object obj) throws IOException { if (writer != null) { writer.write(String.valueOf(obj)); @@ -343,6 +358,7 @@ public class BodyContentImpl extends BodyContent { * * @throws IOException */ + @Override public void println() throws IOException { newLine(); } @@ -354,6 +370,7 @@ public class BodyContentImpl extends BodyContent { * * @throws IOException */ + @Override public void println(boolean x) throws IOException { print(x); println(); @@ -366,6 +383,7 @@ public class BodyContentImpl extends BodyContent { * * @throws IOException */ + @Override public void println(char x) throws IOException { print(x); println(); @@ -378,6 +396,7 @@ public class BodyContentImpl extends BodyContent { * * @throws IOException */ + @Override public void println(int x) throws IOException { print(x); println(); @@ -390,6 +409,7 @@ public class BodyContentImpl extends BodyContent { * * @throws IOException */ + @Override public void println(long x) throws IOException { print(x); println(); @@ -402,6 +422,7 @@ public class BodyContentImpl extends BodyContent { * * @throws IOException */ + @Override public void println(float x) throws IOException { print(x); println(); @@ -414,6 +435,7 @@ public class BodyContentImpl extends BodyContent { * * @throws IOException */ + @Override public void println(double x) throws IOException{ print(x); println(); @@ -426,6 +448,7 @@ public class BodyContentImpl extends BodyContent { * * @throws IOException */ + @Override public void println(char x[]) throws IOException { print(x); println(); @@ -438,6 +461,7 @@ public class BodyContentImpl extends BodyContent { * * @throws IOException */ + @Override public void println(String x) throws IOException { print(x); println(); @@ -450,6 +474,7 @@ public class BodyContentImpl extends BodyContent { * * @throws IOException */ + @Override public void println(Object x) throws IOException { print(x); println(); @@ -463,6 +488,7 @@ public class BodyContentImpl extends BodyContent { * * @throws IOException If an I/O error occurs */ + @Override public void clear() throws IOException { if (writer != null) { throw new IOException(); @@ -483,6 +509,7 @@ public class BodyContentImpl extends BodyContent { * * @throws IOException If an I/O error occurs */ + @Override public void clearBuffer() throws IOException { if (writer == null) { this.clear(); @@ -496,6 +523,7 @@ public class BodyContentImpl extends BodyContent { * * @throws IOException If an I/O error occurs */ + @Override public void close() throws IOException { if (writer != null) { writer.close(); @@ -509,6 +537,7 @@ public class BodyContentImpl extends BodyContent { * * @return the size of the buffer in bytes, or 0 is unbuffered. */ + @Override public int getBufferSize() { // According to the spec, the JspWriter returned by // JspContext.pushBody(java.io.Writer writer) must behave as @@ -520,6 +549,7 @@ public class BodyContentImpl extends BodyContent { /** * @return the number of bytes unused in the buffer */ + @Override public int getRemaining() { return (writer == null) ? bufferSize-nextChar : 0; } @@ -531,6 +561,7 @@ public class BodyContentImpl extends BodyContent { * * @return the value of this BodyJspWriter as a Reader */ + @Override public Reader getReader() { return (writer == null) ? new CharArrayReader (cb, 0, nextChar) : null; } @@ -542,6 +573,7 @@ public class BodyContentImpl extends BodyContent { * * @return the value of the BodyJspWriter as a String */ + @Override public String getString() { return (writer == null) ? new String(cb, 0, nextChar) : null; } @@ -554,6 +586,7 @@ public class BodyContentImpl extends BodyContent { * @param out The writer into which to place the contents of this body * evaluation */ + @Override public void writeOut(Writer out) throws IOException { if (writer == null) { out.write(cb, 0, nextChar); diff --git a/java/org/apache/jasper/runtime/HttpJspBase.java b/java/org/apache/jasper/runtime/HttpJspBase.java index 4acc0e470..207e670fd 100644 --- a/java/org/apache/jasper/runtime/HttpJspBase.java +++ b/java/org/apache/jasper/runtime/HttpJspBase.java @@ -43,6 +43,7 @@ public abstract class HttpJspBase protected HttpJspBase() { } + @Override public final void init(ServletConfig config) throws ServletException { @@ -51,10 +52,12 @@ public abstract class HttpJspBase _jspInit(); } + @Override public String getServletInfo() { return Localizer.getMessage("jsp.engine.info"); } + @Override public final void destroy() { jspDestroy(); _jspDestroy(); @@ -63,6 +66,7 @@ public abstract class HttpJspBase /** * Entry point into service. */ + @Override public final void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { diff --git a/java/org/apache/jasper/runtime/JspContextWrapper.java b/java/org/apache/jasper/runtime/JspContextWrapper.java index 11a3b2136..81ef9a427 100644 --- a/java/org/apache/jasper/runtime/JspContextWrapper.java +++ b/java/org/apache/jasper/runtime/JspContextWrapper.java @@ -93,13 +93,15 @@ public class JspContextWrapper extends PageContext implements VariableResolver { syncBeginTagFile(); } - public void initialize(Servlet servlet, ServletRequest request, + @Override + public void initialize(Servlet servlet, ServletRequest request, ServletResponse response, String errorPageURL, boolean needsSession, int bufferSize, boolean autoFlush) throws IOException, IllegalStateException, IllegalArgumentException { } - public Object getAttribute(String name) { + @Override + public Object getAttribute(String name) { if (name == null) { throw new NullPointerException(Localizer @@ -109,7 +111,8 @@ public class JspContextWrapper extends PageContext implements VariableResolver { return pageAttributes.get(name); } - public Object getAttribute(String name, int scope) { + @Override + public Object getAttribute(String name, int scope) { if (name == null) { throw new NullPointerException(Localizer @@ -123,7 +126,8 @@ public class JspContextWrapper extends PageContext implements VariableResolver { return invokingJspCtxt.getAttribute(name, scope); } - public void setAttribute(String name, Object value) { + @Override + public void setAttribute(String name, Object value) { if (name == null) { throw new NullPointerException(Localizer @@ -137,7 +141,8 @@ public class JspContextWrapper extends PageContext implements VariableResolver { } } - public void setAttribute(String name, Object value, int scope) { + @Override + public void setAttribute(String name, Object value, int scope) { if (name == null) { throw new NullPointerException(Localizer @@ -155,7 +160,8 @@ public class JspContextWrapper extends PageContext implements VariableResolver { } } - public Object findAttribute(String name) { + @Override + public Object findAttribute(String name) { if (name == null) { throw new NullPointerException(Localizer @@ -178,7 +184,8 @@ public class JspContextWrapper extends PageContext implements VariableResolver { return o; } - public void removeAttribute(String name) { + @Override + public void removeAttribute(String name) { if (name == null) { throw new NullPointerException(Localizer @@ -193,7 +200,8 @@ public class JspContextWrapper extends PageContext implements VariableResolver { invokingJspCtxt.removeAttribute(name, APPLICATION_SCOPE); } - public void removeAttribute(String name, int scope) { + @Override + public void removeAttribute(String name, int scope) { if (name == null) { throw new NullPointerException(Localizer @@ -207,7 +215,8 @@ public class JspContextWrapper extends PageContext implements VariableResolver { } } - public int getAttributesScope(String name) { + @Override + public int getAttributesScope(String name) { if (name == null) { throw new NullPointerException(Localizer @@ -221,7 +230,8 @@ public class JspContextWrapper extends PageContext implements VariableResolver { } } - public Enumeration getAttributeNamesInScope(int scope) { + @Override + public Enumeration getAttributeNamesInScope(int scope) { if (scope == PAGE_SCOPE) { return new Enumerator(pageAttributes.keySet().iterator()); } @@ -229,85 +239,104 @@ public class JspContextWrapper extends PageContext implements VariableResolver { return invokingJspCtxt.getAttributeNamesInScope(scope); } - public void release() { + @Override + public void release() { invokingJspCtxt.release(); } - public JspWriter getOut() { + @Override + public JspWriter getOut() { return invokingJspCtxt.getOut(); } - public HttpSession getSession() { + @Override + public HttpSession getSession() { return invokingJspCtxt.getSession(); } - public Object getPage() { + @Override + public Object getPage() { return invokingJspCtxt.getPage(); } - public ServletRequest getRequest() { + @Override + public ServletRequest getRequest() { return invokingJspCtxt.getRequest(); } - public ServletResponse getResponse() { + @Override + public ServletResponse getResponse() { return invokingJspCtxt.getResponse(); } - public Exception getException() { + @Override + public Exception getException() { return invokingJspCtxt.getException(); } - public ServletConfig getServletConfig() { + @Override + public ServletConfig getServletConfig() { return invokingJspCtxt.getServletConfig(); } - public ServletContext getServletContext() { + @Override + public ServletContext getServletContext() { return invokingJspCtxt.getServletContext(); } - public void forward(String relativeUrlPath) throws ServletException, + @Override + public void forward(String relativeUrlPath) throws ServletException, IOException { invokingJspCtxt.forward(relativeUrlPath); } - public void include(String relativeUrlPath) throws ServletException, + @Override + public void include(String relativeUrlPath) throws ServletException, IOException { invokingJspCtxt.include(relativeUrlPath); } - public void include(String relativeUrlPath, boolean flush) + @Override + public void include(String relativeUrlPath, boolean flush) throws ServletException, IOException { invokingJspCtxt.include(relativeUrlPath, false); } - public VariableResolver getVariableResolver() { + @Override + public VariableResolver getVariableResolver() { return this; } - public BodyContent pushBody() { + @Override + public BodyContent pushBody() { return invokingJspCtxt.pushBody(); } - public JspWriter pushBody(Writer writer) { + @Override + public JspWriter pushBody(Writer writer) { return invokingJspCtxt.pushBody(writer); } - public JspWriter popBody() { + @Override + public JspWriter popBody() { return invokingJspCtxt.popBody(); } - public ExpressionEvaluator getExpressionEvaluator() { + @Override + public ExpressionEvaluator getExpressionEvaluator() { return invokingJspCtxt.getExpressionEvaluator(); } - public void handlePageException(Exception ex) throws IOException, + @Override + public void handlePageException(Exception ex) throws IOException, ServletException { // Should never be called since handleException() called with a // Throwable in the generated servlet. handlePageException((Throwable) ex); } - public void handlePageException(Throwable t) throws IOException, + @Override + public void handlePageException(Throwable t) throws IOException, ServletException { invokingJspCtxt.handlePageException(t); } @@ -444,7 +473,8 @@ public class JspContextWrapper extends PageContext implements VariableResolver { //private ELContextImpl elContext; - public ELContext getELContext() { + @Override + public ELContext getELContext() { // instead decorate!!! return this.invokingJspCtxt.getELContext(); diff --git a/java/org/apache/jasper/runtime/JspFactoryImpl.java b/java/org/apache/jasper/runtime/JspFactoryImpl.java index 241517538..3378ae004 100644 --- a/java/org/apache/jasper/runtime/JspFactoryImpl.java +++ b/java/org/apache/jasper/runtime/JspFactoryImpl.java @@ -50,6 +50,7 @@ public class JspFactoryImpl extends JspFactory { private ThreadLocal localPool = new ThreadLocal(); + @Override public PageContext getPageContext(Servlet servlet, ServletRequest request, ServletResponse response, String errorPageURL, boolean needsSession, int bufferSize, boolean autoflush) { @@ -66,6 +67,7 @@ public class JspFactoryImpl extends JspFactory { } } + @Override public void releasePageContext(PageContext pc) { if( pc == null ) return; @@ -78,8 +80,10 @@ public class JspFactoryImpl extends JspFactory { } } + @Override public JspEngineInfo getEngineInfo() { return new JspEngineInfo() { + @Override public String getSpecificationVersion() { return SPEC_VERSION; } @@ -198,6 +202,7 @@ public class JspFactoryImpl extends JspFactory { } + @Override public JspApplicationContext getJspApplicationContext( final ServletContext context) { if (Constants.IS_SECURITY_ENABLED) { diff --git a/java/org/apache/jasper/runtime/JspFragmentHelper.java b/java/org/apache/jasper/runtime/JspFragmentHelper.java index 38d26d34b..f0054bb36 100644 --- a/java/org/apache/jasper/runtime/JspFragmentHelper.java +++ b/java/org/apache/jasper/runtime/JspFragmentHelper.java @@ -54,6 +54,7 @@ public abstract class JspFragmentHelper this.parentTag = parentTag; } + @Override public JspContext getJspContext() { return this.jspContext; } diff --git a/java/org/apache/jasper/runtime/JspWriterImpl.java b/java/org/apache/jasper/runtime/JspWriterImpl.java index 823b6f5cc..acdeaacaf 100644 --- a/java/org/apache/jasper/runtime/JspWriterImpl.java +++ b/java/org/apache/jasper/runtime/JspWriterImpl.java @@ -141,6 +141,7 @@ public class JspWriterImpl extends JspWriter { /** * Discard the output buffer. */ + @Override public final void clear() throws IOException { if ((bufferSize == 0) && (out != null)) // clear() is illegal after any unbuffered output (JSP.5.5) @@ -153,6 +154,7 @@ public class JspWriterImpl extends JspWriter { nextChar = 0; } + @Override public void clearBuffer() throws IOException { if (bufferSize == 0) throw new IllegalStateException( @@ -169,6 +171,7 @@ public class JspWriterImpl extends JspWriter { * Flush the stream. * */ + @Override public void flush() throws IOException { flushBuffer(); if (out != null) { @@ -180,6 +183,7 @@ public class JspWriterImpl extends JspWriter { * Close the stream. * */ + @Override public void close() throws IOException { if (response == null || closed) // multiple calls to close is OK @@ -194,6 +198,7 @@ public class JspWriterImpl extends JspWriter { /** * @return the number of bytes unused in the buffer */ + @Override public int getRemaining() { return bufferSize - nextChar; } @@ -208,6 +213,7 @@ public class JspWriterImpl extends JspWriter { /** * Write a single character. */ + @Override public void write(int c) throws IOException { ensureOpen(); if (bufferSize == 0) { @@ -247,6 +253,7 @@ public class JspWriterImpl extends JspWriter { * @param off Offset from which to start reading characters * @param len Number of characters to write */ + @Override public void write(char cbuf[], int off, int len) throws IOException { @@ -297,6 +304,7 @@ public class JspWriterImpl extends JspWriter { * Write an array of characters. This method cannot be inherited from the * Writer class because it must suppress I/O exceptions. */ + @Override public void write(char buf[]) throws IOException { write(buf, 0, buf.length); } @@ -308,6 +316,7 @@ public class JspWriterImpl extends JspWriter { * @param off Offset from which to start reading characters * @param len Number of characters to be written */ + @Override public void write(String s, int off, int len) throws IOException { ensureOpen(); if (bufferSize == 0) { @@ -333,6 +342,7 @@ public class JspWriterImpl extends JspWriter { * Write a string. This method cannot be inherited from the Writer class * because it must suppress I/O exceptions. */ + @Override public void write(String s) throws IOException { // Simple fix for Bugzilla 35410 // Calling the other write function so as to init the buffer anyways @@ -354,6 +364,7 @@ public class JspWriterImpl extends JspWriter { * @exception IOException If an I/O error occurs */ + @Override public void newLine() throws IOException { write(lineSeparator); } @@ -370,6 +381,7 @@ public class JspWriterImpl extends JspWriter { * * @param b The boolean to be printed */ + @Override public void print(boolean b) throws IOException { write(b ? "true" : "false"); } @@ -382,6 +394,7 @@ public class JspWriterImpl extends JspWriter { * * @param c The char to be printed */ + @Override public void print(char c) throws IOException { write(String.valueOf(c)); } @@ -395,6 +408,7 @@ public class JspWriterImpl extends JspWriter { * * @param i The int to be printed */ + @Override public void print(int i) throws IOException { write(String.valueOf(i)); } @@ -408,6 +422,7 @@ public class JspWriterImpl extends JspWriter { * * @param l The long to be printed */ + @Override public void print(long l) throws IOException { write(String.valueOf(l)); } @@ -421,6 +436,7 @@ public class JspWriterImpl extends JspWriter { * * @param f The float to be printed */ + @Override public void print(float f) throws IOException { write(String.valueOf(f)); } @@ -434,6 +450,7 @@ public class JspWriterImpl extends JspWriter { * * @param d The double to be printed */ + @Override public void print(double d) throws IOException { write(String.valueOf(d)); } @@ -448,6 +465,7 @@ public class JspWriterImpl extends JspWriter { * * @throws NullPointerException If s is null */ + @Override public void print(char s[]) throws IOException { write(s); } @@ -461,6 +479,7 @@ public class JspWriterImpl extends JspWriter { * * @param s The String to be printed */ + @Override public void print(String s) throws IOException { if (s == null) { s = "null"; @@ -477,6 +496,7 @@ public class JspWriterImpl extends JspWriter { * * @param obj The Object to be printed */ + @Override public void print(Object obj) throws IOException { write(String.valueOf(obj)); } @@ -493,6 +513,7 @@ public class JspWriterImpl extends JspWriter { * println() writes to the sink directly instead of through the * write method... */ + @Override public void println() throws IOException { newLine(); } @@ -502,6 +523,7 @@ public class JspWriterImpl extends JspWriter { * as though it invokes {@link #print(boolean)} and then * {@link #println()}. */ + @Override public void println(boolean x) throws IOException { print(x); println(); @@ -512,6 +534,7 @@ public class JspWriterImpl extends JspWriter { * though it invokes {@link #print(char)} and then {@link * #println()}. */ + @Override public void println(char x) throws IOException { print(x); println(); @@ -522,6 +545,7 @@ public class JspWriterImpl extends JspWriter { * though it invokes {@link #print(int)} and then {@link * #println()}. */ + @Override public void println(int x) throws IOException { print(x); println(); @@ -532,6 +556,7 @@ public class JspWriterImpl extends JspWriter { * as though it invokes {@link #print(long)} and then * {@link #println()}. */ + @Override public void println(long x) throws IOException { print(x); println(); @@ -542,6 +567,7 @@ public class JspWriterImpl extends JspWriter { * behaves as though it invokes {@link #print(float)} and then * {@link #println()}. */ + @Override public void println(float x) throws IOException { print(x); println(); @@ -552,6 +578,7 @@ public class JspWriterImpl extends JspWriter { * line. This method behaves as though it invokes {@link * #print(double)} and then {@link #println()}. */ + @Override public void println(double x) throws IOException { print(x); println(); @@ -562,6 +589,7 @@ public class JspWriterImpl extends JspWriter { * behaves as though it invokes {@link #print(char[])} and then * {@link #println()}. */ + @Override public void println(char x[]) throws IOException { print(x); println(); @@ -572,6 +600,7 @@ public class JspWriterImpl extends JspWriter { * though it invokes {@link #print(String)} and then * {@link #println()}. */ + @Override public void println(String x) throws IOException { print(x); println(); @@ -582,6 +611,7 @@ public class JspWriterImpl extends JspWriter { * though it invokes {@link #print(Object)} and then * {@link #println()}. */ + @Override public void println(Object x) throws IOException { print(x); println(); diff --git a/java/org/apache/jasper/runtime/PageContextImpl.java b/java/org/apache/jasper/runtime/PageContextImpl.java index 6e01523a1..f9eafa7b2 100644 --- a/java/org/apache/jasper/runtime/PageContextImpl.java +++ b/java/org/apache/jasper/runtime/PageContextImpl.java @@ -116,7 +116,8 @@ public class PageContextImpl extends PageContext { this.depth = -1; } - public void initialize(Servlet servlet, ServletRequest request, + @Override + public void initialize(Servlet servlet, ServletRequest request, ServletResponse response, String errorPageURL, boolean needsSession, int bufferSize, boolean autoFlush) throws IOException { @@ -173,7 +174,8 @@ public class PageContextImpl extends PageContext { isIncluded = request.getAttribute("javax.servlet.include.servlet_path") != null; } - public void release() { + @Override + public void release() { out = baseOut; try { if (isIncluded) { @@ -206,7 +208,8 @@ public class PageContextImpl extends PageContext { } } - public Object getAttribute(final String name) { + @Override + public Object getAttribute(final String name) { if (name == null) { throw new NullPointerException(Localizer @@ -230,7 +233,8 @@ public class PageContextImpl extends PageContext { return attributes.get(name); } - public Object getAttribute(final String name, final int scope) { + @Override + public Object getAttribute(final String name, final int scope) { if (name == null) { throw new NullPointerException(Localizer @@ -273,7 +277,8 @@ public class PageContextImpl extends PageContext { } } - public void setAttribute(final String name, final Object attribute) { + @Override + public void setAttribute(final String name, final Object attribute) { if (name == null) { throw new NullPointerException(Localizer @@ -300,7 +305,8 @@ public class PageContextImpl extends PageContext { } } - public void setAttribute(final String name, final Object o, final int scope) { + @Override + public void setAttribute(final String name, final Object o, final int scope) { if (name == null) { throw new NullPointerException(Localizer @@ -351,7 +357,8 @@ public class PageContextImpl extends PageContext { } } - public void removeAttribute(final String name, final int scope) { + @Override + public void removeAttribute(final String name, final int scope) { if (name == null) { throw new NullPointerException(Localizer @@ -396,7 +403,8 @@ public class PageContextImpl extends PageContext { } } - public int getAttributesScope(final String name) { + @Override + public int getAttributesScope(final String name) { if (name == null) { throw new NullPointerException(Localizer @@ -438,7 +446,8 @@ public class PageContextImpl extends PageContext { return 0; } - public Object findAttribute(final String name) { + @Override + public Object findAttribute(final String name) { if (SecurityUtil.isPackageProtectionEnabled()) { return AccessController.doPrivileged( new PrivilegedAction() { @@ -485,7 +494,8 @@ public class PageContextImpl extends PageContext { return context.getAttribute(name); } - public Enumeration getAttributeNamesInScope(final int scope) { + @Override + public Enumeration getAttributeNamesInScope(final int scope) { if (SecurityUtil.isPackageProtectionEnabled()) { return AccessController.doPrivileged( new PrivilegedAction>() { @@ -521,7 +531,8 @@ public class PageContextImpl extends PageContext { } } - public void removeAttribute(final String name) { + @Override + public void removeAttribute(final String name) { if (name == null) { throw new NullPointerException(Localizer @@ -554,11 +565,13 @@ public class PageContextImpl extends PageContext { removeAttribute(name, APPLICATION_SCOPE); } - public JspWriter getOut() { + @Override + public JspWriter getOut() { return out; } - public HttpSession getSession() { + @Override + public HttpSession getSession() { return session; } @@ -566,19 +579,23 @@ public class PageContextImpl extends PageContext { return servlet; } - public ServletConfig getServletConfig() { + @Override + public ServletConfig getServletConfig() { return config; } - public ServletContext getServletContext() { + @Override + public ServletContext getServletContext() { return config.getServletContext(); } - public ServletRequest getRequest() { + @Override + public ServletRequest getRequest() { return request; } - public ServletResponse getResponse() { + @Override + public ServletResponse getResponse() { return response; } @@ -589,7 +606,8 @@ public class PageContextImpl extends PageContext { * * @return The Exception associated with this page context, if any. */ - public Exception getException() { + @Override + public Exception getException() { Throwable t = JspRuntimeLibrary.getThrowable(request); // Only wrap if needed @@ -600,7 +618,8 @@ public class PageContextImpl extends PageContext { return (Exception) t; } - public Object getPage() { + @Override + public Object getPage() { return servlet; } @@ -619,13 +638,15 @@ public class PageContextImpl extends PageContext { return path; } - public void include(String relativeUrlPath) throws ServletException, + @Override + public void include(String relativeUrlPath) throws ServletException, IOException { JspRuntimeLibrary .include(request, response, relativeUrlPath, out, true); } - public void include(final String relativeUrlPath, final boolean flush) + @Override + public void include(final String relativeUrlPath, final boolean flush) throws ServletException, IOException { if (SecurityUtil.isPackageProtectionEnabled()) { try { @@ -655,11 +676,13 @@ public class PageContextImpl extends PageContext { flush); } - public VariableResolver getVariableResolver() { + @Override + public VariableResolver getVariableResolver() { return new VariableResolverImpl(this.getELContext()); } - public void forward(final String relativeUrlPath) throws ServletException, + @Override + public void forward(final String relativeUrlPath) throws ServletException, IOException { if (SecurityUtil.isPackageProtectionEnabled()) { try { @@ -715,11 +738,13 @@ public class PageContextImpl extends PageContext { } } - public BodyContent pushBody() { + @Override + public BodyContent pushBody() { return (BodyContent) pushBody(null); } - public JspWriter pushBody(Writer writer) { + @Override + public JspWriter pushBody(Writer writer) { depth++; if (depth >= outs.length) { BodyContentImpl[] newOuts = new BodyContentImpl[depth + 1]; @@ -740,7 +765,8 @@ public class PageContextImpl extends PageContext { return outs[depth]; } - public JspWriter popBody() { + @Override + public JspWriter popBody() { depth--; if (depth >= 0) { out = outs[depth]; @@ -760,18 +786,21 @@ public class PageContextImpl extends PageContext { * Container must return a valid instance of an ExpressionEvaluator that can * parse EL expressions. */ - public ExpressionEvaluator getExpressionEvaluator() { + @Override + public ExpressionEvaluator getExpressionEvaluator() { return new ExpressionEvaluatorImpl(this.applicationContext.getExpressionFactory()); } - public void handlePageException(Exception ex) throws IOException, + @Override + public void handlePageException(Exception ex) throws IOException, ServletException { // Should never be called since handleException() called with a // Throwable in the generated servlet. handlePageException((Throwable) ex); } - public void handlePageException(final Throwable t) throws IOException, + @Override + public void handlePageException(final Throwable t) throws IOException, ServletException { if (t == null) throw new NullPointerException("null Throwable"); @@ -947,7 +976,8 @@ public class PageContextImpl extends PageContext { return retValue; } - public ELContext getELContext() { + @Override + public ELContext getELContext() { if (this.elContext == null) { this.elContext = this.applicationContext.createELContext(this); } diff --git a/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java b/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java index 2d0892f11..7e363e882 100644 --- a/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java +++ b/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java @@ -54,6 +54,7 @@ public class PerThreadTagHandlerPool extends TagHandlerPool { perThreadDataVector = new Vector(); } + @Override protected void init(ServletConfig config) { maxSize = Constants.MAX_POOL_SIZE; String maxSizeS = getOption(config, OPTION_MAXSIZE, null); @@ -65,6 +66,7 @@ public class PerThreadTagHandlerPool extends TagHandlerPool { } perThread = new ThreadLocal() { + @Override protected PerThreadData initialValue() { PerThreadData ptd = new PerThreadData(); ptd.handlers = new Tag[maxSize]; @@ -85,6 +87,7 @@ public class PerThreadTagHandlerPool extends TagHandlerPool { * * @throws JspException if a tag handler cannot be instantiated */ + @Override public Tag get(Class handlerClass) throws JspException { PerThreadData ptd = perThread.get(); if(ptd.current >=0 ) { @@ -105,6 +108,7 @@ public class PerThreadTagHandlerPool extends TagHandlerPool { * * @param handler Tag handler to add to this tag handler pool */ + @Override public void reuse(Tag handler) { PerThreadData ptd = perThread.get(); if (ptd.current < (ptd.handlers.length - 1)) { @@ -117,6 +121,7 @@ public class PerThreadTagHandlerPool extends TagHandlerPool { /** * Calls the release() method of all tag handlers in this tag handler pool. */ + @Override public void release() { Enumeration enumeration = perThreadDataVector.elements(); while (enumeration.hasMoreElements()) { diff --git a/java/org/apache/jasper/runtime/ProtectedFunctionMapper.java b/java/org/apache/jasper/runtime/ProtectedFunctionMapper.java index 8a1d14146..725714fed 100644 --- a/java/org/apache/jasper/runtime/ProtectedFunctionMapper.java +++ b/java/org/apache/jasper/runtime/ProtectedFunctionMapper.java @@ -185,6 +185,7 @@ public final class ProtectedFunctionMapper extends javax.el.FunctionMapper * the short name of the function * @return the result of the method mapping. Null means no entry found. */ + @Override public Method resolveFunction(String prefix, String localName) { if (this.fnmap != null) { return this.fnmap.get(prefix + ":" + localName); diff --git a/java/org/apache/jasper/runtime/ServletResponseWrapperInclude.java b/java/org/apache/jasper/runtime/ServletResponseWrapperInclude.java index 098e7038d..85725ee1c 100644 --- a/java/org/apache/jasper/runtime/ServletResponseWrapperInclude.java +++ b/java/org/apache/jasper/runtime/ServletResponseWrapperInclude.java @@ -55,10 +55,12 @@ public class ServletResponseWrapperInclude extends HttpServletResponseWrapper { /** * Returns a wrapper around the JspWriter of the including page. */ + @Override public PrintWriter getWriter() throws IOException { return printWriter; } + @Override public ServletOutputStream getOutputStream() throws IOException { throw new IllegalStateException(); } @@ -67,6 +69,7 @@ public class ServletResponseWrapperInclude extends HttpServletResponseWrapper { * Clears the output buffer of the JspWriter associated with the including * page. */ + @Override public void resetBuffer() { try { jspWriter.clearBuffer(); diff --git a/java/org/apache/jasper/servlet/JasperLoader.java b/java/org/apache/jasper/servlet/JasperLoader.java index 5cb49ca09..826104068 100644 --- a/java/org/apache/jasper/servlet/JasperLoader.java +++ b/java/org/apache/jasper/servlet/JasperLoader.java @@ -57,6 +57,7 @@ public class JasperLoader extends URLClassLoader { * * @exception ClassNotFoundException if the class was not found */ + @Override public Class loadClass(String name) throws ClassNotFoundException { return (loadClass(name, false)); @@ -87,6 +88,7 @@ public class JasperLoader extends URLClassLoader { * * @exception ClassNotFoundException if the class was not found */ + @Override public Class loadClass(final String name, boolean resolve) throws ClassNotFoundException { @@ -136,6 +138,7 @@ public class JasperLoader extends URLClassLoader { * * @see java.lang.ClassLoader#getResourceAsStream(java.lang.String) */ + @Override public InputStream getResourceAsStream(String name) { InputStream is = parent.getResourceAsStream(name); if (is == null) { @@ -162,6 +165,7 @@ public class JasperLoader extends URLClassLoader { * @param codeSource Code source where the code was loaded from * @return PermissionCollection for CodeSource */ + @Override public final PermissionCollection getPermissions(CodeSource codeSource) { return permissionCollection; } diff --git a/java/org/apache/jasper/servlet/JspServlet.java b/java/org/apache/jasper/servlet/JspServlet.java index a0ed3e03f..862a8e4ce 100644 --- a/java/org/apache/jasper/servlet/JspServlet.java +++ b/java/org/apache/jasper/servlet/JspServlet.java @@ -69,6 +69,7 @@ public class JspServlet extends HttpServlet implements PeriodicEventListener { /* * Initializes this JspServlet. */ + @Override public void init(ServletConfig config) throws ServletException { super.init(config); @@ -208,6 +209,7 @@ public class JspServlet extends HttpServlet implements PeriodicEventListener { } + @Override public void service (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { @@ -273,6 +275,7 @@ public class JspServlet extends HttpServlet implements PeriodicEventListener { } + @Override public void destroy() { if (log.isDebugEnabled()) { log.debug("JspServlet.destroy()"); diff --git a/java/org/apache/jasper/tagplugins/jstl/Util.java b/java/org/apache/jasper/tagplugins/jstl/Util.java index 1e4e287a7..55c1a2201 100644 --- a/java/org/apache/jasper/tagplugins/jstl/Util.java +++ b/java/org/apache/jasper/tagplugins/jstl/Util.java @@ -256,6 +256,7 @@ public class Util { private StringWriter sw = new StringWriter(); private ByteArrayOutputStream bos = new ByteArrayOutputStream(); private ServletOutputStream sos = new ServletOutputStream() { + @Override public void write(int b) throws IOException { bos.write(b); } @@ -270,6 +271,7 @@ public class Util { // TODO Auto-generated constructor stub } + @Override public PrintWriter getWriter() { if (isStreamUsed) throw new IllegalStateException("Unexpected internal error during <import>: " + @@ -278,6 +280,7 @@ public class Util { return new PrintWriter(sw); } + @Override public ServletOutputStream getOutputStream() { if (isWriterUsed) throw new IllegalStateException("Unexpected internal error during <import>: " + @@ -287,19 +290,23 @@ public class Util { } /** Has no effect. */ + @Override public void setContentType(String x) { // ignore } /** Has no effect. */ + @Override public void setLocale(Locale x) { // ignore } + @Override public void setStatus(int status) { this.status = status; } + @Override public int getStatus() { return status; } diff --git a/java/org/apache/jasper/xmlparser/ASCIIReader.java b/java/org/apache/jasper/xmlparser/ASCIIReader.java index 7c3ca2d12..3c145bd71 100644 --- a/java/org/apache/jasper/xmlparser/ASCIIReader.java +++ b/java/org/apache/jasper/xmlparser/ASCIIReader.java @@ -83,6 +83,7 @@ public class ASCIIReader * * @exception IOException If an I/O error occurs */ + @Override public int read() throws IOException { int b0 = fInputStream.read(); if (b0 > 0x80) { @@ -106,6 +107,7 @@ public class ASCIIReader * * @exception IOException If an I/O error occurs */ + @Override public int read(char ch[], int offset, int length) throws IOException { if (length > fBuffer.length) { length = fBuffer.length; @@ -132,6 +134,7 @@ public class ASCIIReader * * @exception IOException If an I/O error occurs */ + @Override public long skip(long n) throws IOException { return fInputStream.skip(n); } // skip(long):long @@ -145,6 +148,7 @@ public class ASCIIReader * * @exception IOException If an I/O error occurs */ + @Override public boolean ready() throws IOException { return false; } // ready() @@ -152,6 +156,7 @@ public class ASCIIReader /** * Tell whether this stream supports the mark() operation. */ + @Override public boolean markSupported() { return fInputStream.markSupported(); } // markSupported() @@ -169,6 +174,7 @@ public class ASCIIReader * @exception IOException If the stream does not support mark(), * or if some other I/O error occurs */ + @Override public void mark(int readAheadLimit) throws IOException { fInputStream.mark(readAheadLimit); } // mark(int) @@ -186,6 +192,7 @@ public class ASCIIReader * or if the stream does not support reset(), * or if some other I/O error occurs */ + @Override public void reset() throws IOException { fInputStream.reset(); } // reset() @@ -197,7 +204,8 @@ public class ASCIIReader * * @exception IOException If an I/O error occurs */ - public void close() throws IOException { + @Override + public void close() throws IOException { fInputStream.close(); } // close() diff --git a/java/org/apache/jasper/xmlparser/TreeNode.java b/java/org/apache/jasper/xmlparser/TreeNode.java index e00bb2597..67a0c5cc0 100644 --- a/java/org/apache/jasper/xmlparser/TreeNode.java +++ b/java/org/apache/jasper/xmlparser/TreeNode.java @@ -294,6 +294,7 @@ public class TreeNode { /** * Return a String representation of this TreeNode. */ + @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/java/org/apache/jasper/xmlparser/UCSReader.java b/java/org/apache/jasper/xmlparser/UCSReader.java index 8f3de5727..d989b99bb 100644 --- a/java/org/apache/jasper/xmlparser/UCSReader.java +++ b/java/org/apache/jasper/xmlparser/UCSReader.java @@ -110,6 +110,7 @@ public class UCSReader extends Reader { * * @exception IOException If an I/O error occurs */ + @Override public int read() throws IOException { int b0 = fInputStream.read() & 0xff; if (b0 == 0xff) @@ -152,6 +153,7 @@ public class UCSReader extends Reader { * * @exception IOException If an I/O error occurs */ + @Override public int read(char ch[], int offset, int length) throws IOException { int byteLength = length << ((fEncoding >= 4)?2:1); if (byteLength > fBuffer.length) { @@ -220,6 +222,7 @@ public class UCSReader extends Reader { * * @exception IOException If an I/O error occurs */ + @Override public long skip(long n) throws IOException { // charWidth will represent the number of bits to move // n leftward to get num of bytes to skip, and then move the result rightward @@ -242,6 +245,7 @@ public class UCSReader extends Reader { * * @exception IOException If an I/O error occurs */ + @Override public boolean ready() throws IOException { return false; } // ready() @@ -249,6 +253,7 @@ public class UCSReader extends Reader { /** * Tell whether this stream supports the mark() operation. */ + @Override public boolean markSupported() { return fInputStream.markSupported(); } // markSupported() @@ -266,6 +271,7 @@ public class UCSReader extends Reader { * @exception IOException If the stream does not support mark(), * or if some other I/O error occurs */ + @Override public void mark(int readAheadLimit) throws IOException { fInputStream.mark(readAheadLimit); } // mark(int) @@ -283,6 +289,7 @@ public class UCSReader extends Reader { * or if the stream does not support reset(), * or if some other I/O error occurs */ + @Override public void reset() throws IOException { fInputStream.reset(); } // reset() @@ -294,7 +301,8 @@ public class UCSReader extends Reader { * * @exception IOException If an I/O error occurs */ - public void close() throws IOException { + @Override + public void close() throws IOException { fInputStream.close(); } // close() diff --git a/java/org/apache/jasper/xmlparser/UTF8Reader.java b/java/org/apache/jasper/xmlparser/UTF8Reader.java index b4d3ba3c0..b92287d9e 100644 --- a/java/org/apache/jasper/xmlparser/UTF8Reader.java +++ b/java/org/apache/jasper/xmlparser/UTF8Reader.java @@ -95,6 +95,7 @@ public class UTF8Reader * * @exception IOException If an I/O error occurs */ + @Override public int read() throws IOException { // decode character @@ -230,6 +231,7 @@ public class UTF8Reader * * @exception IOException If an I/O error occurs */ + @Override public int read(char ch[], int offset, int length) throws IOException { // handle surrogate @@ -511,6 +513,7 @@ public class UTF8Reader * * @exception IOException If an I/O error occurs */ + @Override public long skip(long n) throws IOException { long remaining = n; @@ -540,6 +543,7 @@ public class UTF8Reader * * @exception IOException If an I/O error occurs */ + @Override public boolean ready() throws IOException { return false; } // ready() @@ -547,6 +551,7 @@ public class UTF8Reader /** * Tell whether this stream supports the mark() operation. */ + @Override public boolean markSupported() { return false; } // markSupported() @@ -564,6 +569,7 @@ public class UTF8Reader * @exception IOException If the stream does not support mark(), * or if some other I/O error occurs */ + @Override public void mark(int readAheadLimit) throws IOException { throw new IOException( Localizer.getMessage("jsp.error.xml.operationNotSupported", @@ -583,6 +589,7 @@ public class UTF8Reader * or if the stream does not support reset(), * or if some other I/O error occurs */ + @Override public void reset() throws IOException { fOffset = 0; fSurrogate = -1; @@ -595,6 +602,7 @@ public class UTF8Reader * * @exception IOException If an I/O error occurs */ + @Override public void close() throws IOException { fInputStream.close(); } // close() diff --git a/java/org/apache/jasper/xmlparser/XMLEncodingDetector.java b/java/org/apache/jasper/xmlparser/XMLEncodingDetector.java index 7acef653f..19911c535 100644 --- a/java/org/apache/jasper/xmlparser/XMLEncodingDetector.java +++ b/java/org/apache/jasper/xmlparser/XMLEncodingDetector.java @@ -1092,6 +1092,7 @@ public class XMLEncodingDetector { fOffset = fStartOffset; } + @Override public int read() throws IOException { int b = 0; if (fOffset < fLength) { @@ -1115,6 +1116,7 @@ public class XMLEncodingDetector { return b & 0xff; } + @Override public int read(byte[] b, int off, int len) throws IOException { int bytesLeft = fLength - fOffset; if (bytesLeft == 0) { @@ -1148,6 +1150,7 @@ public class XMLEncodingDetector { return len; } + @Override public long skip(long n) throws IOException { @@ -1182,6 +1185,7 @@ public class XMLEncodingDetector { return fInputStream.skip(n) + bytesLeft; } + @Override public int available() throws IOException { int bytesLeft = fLength - fOffset; if (bytesLeft == 0) { @@ -1194,18 +1198,22 @@ public class XMLEncodingDetector { return bytesLeft; } + @Override public void mark(int howMuch) { fMark = fOffset; } + @Override public void reset() { fOffset = fMark; } + @Override public boolean markSupported() { return true; } + @Override public void close() throws IOException { if (fInputStream != null) { fInputStream.close(); diff --git a/java/org/apache/jasper/xmlparser/XMLString.java b/java/org/apache/jasper/xmlparser/XMLString.java index 4311cdddc..a6b36b9df 100644 --- a/java/org/apache/jasper/xmlparser/XMLString.java +++ b/java/org/apache/jasper/xmlparser/XMLString.java @@ -190,6 +190,7 @@ public class XMLString { // /** Returns a string representation of this object. */ + @Override public String toString() { return length > 0 ? new String(ch, offset, length) : ""; } // toString():String diff --git a/java/org/apache/jasper/xmlparser/XMLStringBuffer.java b/java/org/apache/jasper/xmlparser/XMLStringBuffer.java index 69802d0f9..63357ceb8 100644 --- a/java/org/apache/jasper/xmlparser/XMLStringBuffer.java +++ b/java/org/apache/jasper/xmlparser/XMLStringBuffer.java @@ -105,6 +105,7 @@ public class XMLStringBuffer // /** Clears the string buffer. */ + @Override public void clear() { offset = 0; length = 0;