diff --git a/java/org/apache/jasper/EmbeddedServletOptions.java b/java/org/apache/jasper/EmbeddedServletOptions.java index 451dfbcfafa9..5bfd47eb7280 100644 --- a/java/org/apache/jasper/EmbeddedServletOptions.java +++ b/java/org/apache/jasper/EmbeddedServletOptions.java @@ -248,9 +248,6 @@ public boolean getQuoteAttributeEL() { return quoteAttributeEL; } - /** - * Are we keeping generated code around? - */ @Override public boolean getKeepGenerated() { return keepGenerated; @@ -266,130 +263,81 @@ public boolean isPoolingEnabled() { return isPoolingEnabled; } - /** - * Are we supporting HTML mapped servlets? - */ @Override public boolean getMappedFile() { return mappedFile; } - /** - * Should class files be compiled with debug information? - */ @Override public boolean getClassDebugInfo() { return classDebugInfo; } - /** - * Background JSP compile thread check interval - */ @Override public int getCheckInterval() { return checkInterval; } - /** - * Modification test interval. - */ @Override public int getModificationTestInterval() { return modificationTestInterval; } - /** - * Re-compile on failure. - */ @Override public boolean getRecompileOnFail() { return recompileOnFail; } - /** - * Is Jasper being used in development mode? - */ @Override public boolean getDevelopment() { return development; } - /** - * Is the generation of SMAP info for JSR45 debugging suppressed? - */ @Override public boolean isSmapSuppressed() { return isSmapSuppressed; } - /** - * Should SMAP info for JSR45 debugging be dumped to a file? - */ @Override public boolean isSmapDumped() { return isSmapDumped; } - /** - * Are Text strings to be generated as char arrays? - */ @Override public boolean genStringAsCharArray() { return this.genStringAsCharArray; } - /** - * What is my scratch dir? - */ @Override public File getScratchDir() { return scratchDir; } - /** - * What classpath should I use while compiling the servlets - * generated from JSP files? - */ @Override public String getClassPath() { return classpath; } - /** - * Is generation of X-Powered-By response header enabled/disabled? - */ @Override public boolean isXpoweredBy() { return xpoweredBy; } - /** - * Compiler to use. - */ @Override public String getCompiler() { return compiler; } - /** - * @see Options#getCompilerTargetVM - */ @Override public String getCompilerTargetVM() { return compilerTargetVM; } - /** - * @see Options#getCompilerSourceVM - */ @Override public String getCompilerSourceVM() { return compilerSourceVM; } - /** - * Java compiler class to use. - */ @Override public String getCompilerClassName() { return compilerClassName; @@ -443,28 +391,16 @@ public Map getCache() { return null; } - /** - * Should we include a source fragment in exception messages, which could be displayed - * to the developer ? - */ @Override public boolean getDisplaySourceFragment() { return displaySourceFragment; } - /** - * Should jsps be unloaded if to many are loaded? - * If set to a value greater than 0 eviction of jsps is started. Default: -1 - */ @Override public int getMaxLoadedJsps() { return maxLoadedJsps; } - /** - * Should any jsps be unloaded when being idle for this time in seconds? - * If set to a value greater than 0 eviction of jsps is started. Default: -1 - */ @Override public int getJspIdleTimeout() { return jspIdleTimeout; diff --git a/java/org/apache/jasper/compiler/AntCompiler.java b/java/org/apache/jasper/compiler/AntCompiler.java index 632954e23b8e..721933f44888 100644 --- a/java/org/apache/jasper/compiler/AntCompiler.java +++ b/java/org/apache/jasper/compiler/AntCompiler.java @@ -116,9 +116,6 @@ protected String getReport() { // --------------------------------------------------------- Public Methods - /** - * Compile the servlet from .java file to .class file - */ @Override protected void generateClass(Map smaps) throws FileNotFoundException, JasperException, Exception { diff --git a/java/org/apache/jasper/compiler/DefaultErrorHandler.java b/java/org/apache/jasper/compiler/DefaultErrorHandler.java index d1d68199314f..7ba79b9fd302 100644 --- a/java/org/apache/jasper/compiler/DefaultErrorHandler.java +++ b/java/org/apache/jasper/compiler/DefaultErrorHandler.java @@ -25,15 +25,6 @@ */ class DefaultErrorHandler implements ErrorHandler { - /* - * Processes the given JSP parse error. - * - * @param fname Name of the JSP file in which the parse error occurred - * @param line Parse error line number - * @param column Parse error column number - * @param errMsg Parse error message - * @param exception Parse exception - */ @Override public void jspError(String fname, int line, int column, String errMsg, Exception ex) throws JasperException { @@ -43,23 +34,11 @@ public void jspError(String fname, int line, int column, String errMsg, ") " + errMsg, ex); } - /* - * Processes the given JSP parse error. - * - * @param errMsg Parse error message - * @param exception Parse exception - */ @Override public void jspError(String errMsg, Exception ex) throws JasperException { throw new JasperException(errMsg, ex); } - /* - * Processes the given javac compilation errors. - * - * @param details Array of JavacErrorDetail instances corresponding to the - * compilation errors - */ @Override public void javacError(JavacErrorDetail[] details) throws JasperException { @@ -102,12 +81,6 @@ public void javacError(JavacErrorDetail[] details) throws JasperException { Localizer.getMessage("jsp.error.unable.compile") + ": " + buf); } - /** - * Processes the given javac error report and exception. - * - * @param errorReport Compilation error report - * @param exception Compilation exception - */ @Override public void javacError(String errorReport, Exception exception) throws JasperException { diff --git a/java/org/apache/jasper/compiler/JDTCompiler.java b/java/org/apache/jasper/compiler/JDTCompiler.java index e5b5d1a2786a..2ea9e5d51824 100644 --- a/java/org/apache/jasper/compiler/JDTCompiler.java +++ b/java/org/apache/jasper/compiler/JDTCompiler.java @@ -66,9 +66,6 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler { private final Log log = LogFactory.getLog(JDTCompiler.class); // must not be static - /** - * Compile the servlet from .java file to .class file - */ @Override protected void generateClass(Map smaps) throws FileNotFoundException, JasperException, Exception { diff --git a/java/org/apache/jasper/compiler/JspDocumentParser.java b/java/org/apache/jasper/compiler/JspDocumentParser.java index a28d51873864..71f18d991d9f 100644 --- a/java/org/apache/jasper/compiler/JspDocumentParser.java +++ b/java/org/apache/jasper/compiler/JspDocumentParser.java @@ -632,9 +632,6 @@ private void processChars() throws SAXException { charBuffer = null; } - /* - * Receives notification of the end of an element. - */ @Override public void endElement(String uri, String localName, String qName) throws SAXException { @@ -712,11 +709,6 @@ public void endElement(String uri, String localName, String qName) } } - /* - * Receives the document locator. - * - * @param locator the document locator - */ @Override public void setDocumentLocator(Locator locator) { this.locator = locator; @@ -796,25 +788,16 @@ public void endDTD() throws SAXException { inDTD = false; } - /* - * Receives notification of a non-recoverable error. - */ @Override public void fatalError(SAXParseException e) throws SAXException { throw e; } - /* - * Receives notification of a recoverable error. - */ @Override public void error(SAXParseException e) throws SAXException { throw e; } - /* - * Receives notification of the start of a Namespace mapping. - */ @Override public void startPrefixMapping(String prefix, String uri) throws SAXException { @@ -843,9 +826,6 @@ public void startPrefixMapping(String prefix, String uri) } } - /* - * Receives notification of the end of a Namespace mapping. - */ @Override public void endPrefixMapping(String prefix) throws SAXException { diff --git a/java/org/apache/jasper/compiler/PageDataImpl.java b/java/org/apache/jasper/compiler/PageDataImpl.java index 7bb624c00c0e..5f6de47ed522 100644 --- a/java/org/apache/jasper/compiler/PageDataImpl.java +++ b/java/org/apache/jasper/compiler/PageDataImpl.java @@ -259,7 +259,7 @@ private static class SecondPassVisitor extends Node.Visitor * Visits root node. */ @Override - public void visit(Node.Root n) throws JasperException { + public void visit(Node.Root n) throws JasperException { if (n == this.root) { // top-level page appendXmlProlog(); @@ -281,48 +281,48 @@ public void visit(Node.Root n) throws JasperException { * include directive) are ignored. */ @Override - public void visit(Node.JspRoot n) throws JasperException { + public void visit(Node.JspRoot n) throws JasperException { visitBody(n); } @Override - public void visit(Node.PageDirective n) throws JasperException { + public void visit(Node.PageDirective n) throws JasperException { appendPageDirective(n); } @Override - public void visit(Node.IncludeDirective n) throws JasperException { + public void visit(Node.IncludeDirective n) throws JasperException { // expand in place visitBody(n); } @Override - public void visit(Node.Comment n) throws JasperException { + public void visit(Node.Comment n) throws JasperException { // Comments are ignored in XML view } @Override - public void visit(Node.Declaration n) throws JasperException { + public void visit(Node.Declaration n) throws JasperException { appendTag(n); } @Override - public void visit(Node.Expression n) throws JasperException { + public void visit(Node.Expression n) throws JasperException { appendTag(n); } @Override - public void visit(Node.Scriptlet n) throws JasperException { + public void visit(Node.Scriptlet n) throws JasperException { appendTag(n); } @Override - public void visit(Node.JspElement n) throws JasperException { + public void visit(Node.JspElement n) throws JasperException { appendTag(n); } @Override - public void visit(Node.ELExpression n) throws JasperException { + public void visit(Node.ELExpression n) throws JasperException { if (!n.getRoot().isXmlSyntax()) { buf.append('<').append(JSP_TEXT_ACTION); buf.append(' '); @@ -340,32 +340,32 @@ public void visit(Node.ELExpression n) throws JasperException { } @Override - public void visit(Node.IncludeAction n) throws JasperException { + public void visit(Node.IncludeAction n) throws JasperException { appendTag(n); } @Override - public void visit(Node.ForwardAction n) throws JasperException { + public void visit(Node.ForwardAction n) throws JasperException { appendTag(n); } @Override - public void visit(Node.GetProperty n) throws JasperException { + public void visit(Node.GetProperty n) throws JasperException { appendTag(n); } @Override - public void visit(Node.SetProperty n) throws JasperException { + public void visit(Node.SetProperty n) throws JasperException { appendTag(n); } @Override - public void visit(Node.ParamAction n) throws JasperException { + public void visit(Node.ParamAction n) throws JasperException { appendTag(n); } @Override - public void visit(Node.UseBean n) throws JasperException { + public void visit(Node.UseBean n) throws JasperException { appendTag(n); } @@ -380,26 +380,26 @@ public void visit(Node.JspBody n) throws JasperException { } @Override - public void visit(Node.CustomTag n) throws JasperException { + public void visit(Node.CustomTag n) throws JasperException { boolean resetDefaultNSSave = resetDefaultNS; appendTag(n, resetDefaultNS); resetDefaultNS = resetDefaultNSSave; } @Override - public void visit(Node.UninterpretedTag n) throws JasperException { + public void visit(Node.UninterpretedTag n) throws JasperException { boolean resetDefaultNSSave = resetDefaultNS; appendTag(n, resetDefaultNS); resetDefaultNS = resetDefaultNSSave; } @Override - public void visit(Node.JspText n) throws JasperException { + public void visit(Node.JspText n) throws JasperException { appendTag(n); } @Override - public void visit(Node.DoBodyAction n) throws JasperException { + public void visit(Node.DoBodyAction n) throws JasperException { appendTag(n); } @@ -409,22 +409,22 @@ public void visit(Node.InvokeAction n) throws JasperException { } @Override - public void visit(Node.TagDirective n) throws JasperException { + public void visit(Node.TagDirective n) throws JasperException { appendTagDirective(n); } @Override - public void visit(Node.AttributeDirective n) throws JasperException { + public void visit(Node.AttributeDirective n) throws JasperException { appendTag(n); } @Override - public void visit(Node.VariableDirective n) throws JasperException { + public void visit(Node.VariableDirective n) throws JasperException { appendTag(n); } @Override - public void visit(Node.TemplateText n) throws JasperException { + 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/SmapStratum.java b/java/org/apache/jasper/compiler/SmapStratum.java index 5632dda35d35..9e549211abf0 100644 --- a/java/org/apache/jasper/compiler/SmapStratum.java +++ b/java/org/apache/jasper/compiler/SmapStratum.java @@ -172,12 +172,6 @@ public void addFile(String filename, String filePath) { */ public void optimizeLineSection() { -/* Some debugging code - for (int i = 0; i < lineData.size(); i++) { - LineInfo li = (LineInfo)lineData.get(i); - System.out.print(li.toString()); - } - */ //Incorporate each LineInfo into the previous LineInfo's //outputLineIncrement, if possible int i = 0; diff --git a/java/org/apache/jasper/runtime/BodyContentImpl.java b/java/org/apache/jasper/runtime/BodyContentImpl.java index 4c698f057236..9203008aa594 100644 --- a/java/org/apache/jasper/runtime/BodyContentImpl.java +++ b/java/org/apache/jasper/runtime/BodyContentImpl.java @@ -66,11 +66,6 @@ public BodyContentImpl(JspWriter enclosingWriter, boolean limitBuffer, int tagBu closed = false; } - /** - * Write a single character. - * @param c The char to write - * @throws IOException Error writing to wrapped writer - */ @Override public void write(int c) throws IOException { if (writer != null) { @@ -84,22 +79,6 @@ public void write(int c) throws IOException { } } - /** - * Write a portion of an array of characters. - * - *

Ordinarily this method stores characters from the given array into - * this stream's buffer, flushing the buffer to the underlying stream as - * needed. If the requested length is at least as large as the buffer, - * however, then this method will flush the buffer and write the characters - * directly to the underlying stream. Thus redundant - * DiscardableBufferedWriters will not copy data - * unnecessarily. - * - * @param cbuf A character array - * @param off Offset from which to start reading characters - * @param len Number of characters to write - * @throws IOException Error writing to wrapped writer - */ @Override public void write(char[] cbuf, int off, int len) throws IOException { if (writer != null) { @@ -123,12 +102,6 @@ public void write(char[] cbuf, int off, int len) throws IOException { } } - /** - * Write an array of characters. This method cannot be inherited from the - * Writer class because it must suppress I/O exceptions. - * @param buf Content to write - * @throws IOException Error writing to wrapped writer - */ @Override public void write(char[] buf) throws IOException { if (writer != null) { @@ -138,14 +111,6 @@ public void write(char[] buf) throws IOException { } } - /** - * Write a portion of a String. - * - * @param s String to be written - * @param off Offset from which to start reading characters - * @param len Number of characters to be written - * @throws IOException Error writing to wrapped writer - */ @Override public void write(String s, int off, int len) throws IOException { if (writer != null) { @@ -161,12 +126,6 @@ public void write(String s, int off, int len) throws IOException { } } - /** - * Write a string. This method cannot be inherited from the Writer class - * because it must suppress I/O exceptions. - * @param s String to be written - * @throws IOException Error writing to wrapped writer - */ @Override public void write(String s) throws IOException { if (writer != null) { @@ -176,13 +135,6 @@ public void write(String s) throws IOException { } } - /** - * Write a line separator. The line separator string is defined by the - * system property line.separator, and is not necessarily a - * single newline ('\n') character. - * - * @throws IOException Error writing to wrapped writer - */ @Override public void newLine() throws IOException { if (writer != null) { @@ -192,16 +144,6 @@ public void newLine() throws IOException { } } - /** - * Print a boolean value. The string produced by {@link - * String#valueOf(boolean)} is translated into bytes - * according to the platform's default character encoding, and these bytes - * are written in exactly the manner of the {@link - * #write(int)} method. - * - * @param b The boolean to be printed - * @throws IOException Error writing to wrapped writer - */ @Override public void print(boolean b) throws IOException { if (writer != null) { @@ -211,15 +153,6 @@ public void print(boolean b) throws IOException { } } - /** - * Print a character. The character is translated into one or more bytes - * according to the platform's default character encoding, and these bytes - * are written in exactly the manner of the {@link - * #write(int)} method. - * - * @param c The char to be printed - * @throws IOException Error writing to wrapped writer - */ @Override public void print(char c) throws IOException { if (writer != null) { @@ -229,16 +162,6 @@ public void print(char c) throws IOException { } } - /** - * Print an integer. The string produced by {@link - * String#valueOf(int)} is translated into bytes according - * to the platform's default character encoding, and these bytes are - * written in exactly the manner of the {@link #write(int)} - * method. - * - * @param i The int to be printed - * @throws IOException Error writing to wrapped writer - */ @Override public void print(int i) throws IOException { if (writer != null) { @@ -248,16 +171,6 @@ public void print(int i) throws IOException { } } - /** - * Print a long integer. The string produced by {@link - * String#valueOf(long)} is translated into bytes - * according to the platform's default character encoding, and these bytes - * are written in exactly the manner of the - * {@link #write(int)} method. - * - * @param l The long to be printed - * @throws IOException Error writing to wrapped writer - */ @Override public void print(long l) throws IOException { if (writer != null) { @@ -267,16 +180,6 @@ public void print(long l) throws IOException { } } - /** - * Print a floating-point number. The string produced by {@link - * String#valueOf(float)} is translated into bytes - * according to the platform's default character encoding, and these bytes - * are written in exactly the manner of the - * {@link #write(int)} method. - * - * @param f The float to be printed - * @throws IOException Error writing to wrapped writer - */ @Override public void print(float f) throws IOException { if (writer != null) { @@ -286,16 +189,6 @@ public void print(float f) throws IOException { } } - /** - * Print a double-precision floating-point number. The string produced by - * {@link String#valueOf(double)} is translated into - * bytes according to the platform's default character encoding, and these - * bytes are written in exactly the manner of the {@link - * #write(int)} method. - * - * @param d The double to be printed - * @throws IOException Error writing to wrapped writer - */ @Override public void print(double d) throws IOException { if (writer != null) { @@ -305,17 +198,6 @@ public void print(double d) throws IOException { } } - /** - * Print an array of characters. The characters are converted into bytes - * according to the platform's default character encoding, and these bytes - * are written in exactly the manner of the - * {@link #write(int)} method. - * - * @param s The array of chars to be printed - * - * @throws NullPointerException If s is null - * @throws IOException Error writing to wrapped writer - */ @Override public void print(char[] s) throws IOException { if (writer != null) { @@ -325,16 +207,6 @@ public void print(char[] s) throws IOException { } } - /** - * Print a string. If the argument is null then the string - * "null" is printed. Otherwise, the string's characters are - * converted into bytes according to the platform's default character - * encoding, and these bytes are written in exactly the manner of the - * {@link #write(int)} method. - * - * @param s The String to be printed - * @throws IOException Error writing to wrapped writer - */ @Override public void print(String s) throws IOException { if (s == null) { @@ -347,16 +219,6 @@ public void print(String s) throws IOException { } } - /** - * Print an object. The string produced by the {@link - * String#valueOf(Object)} method is translated into bytes - * according to the platform's default character encoding, and these bytes - * are written in exactly the manner of the - * {@link #write(int)} method. - * - * @param obj The Object to be printed - * @throws IOException Error writing to wrapped writer - */ @Override public void print(Object obj) throws IOException { if (writer != null) { @@ -366,153 +228,65 @@ public void print(Object obj) throws IOException { } } - /** - * Terminate the current line by writing the line separator string. The - * line separator string is defined by the system property - * line.separator, and is not necessarily a single newline - * character ('\n'). - * - * @throws IOException Error writing to wrapped writer - */ @Override public void println() throws IOException { newLine(); } - /** - * Print a boolean value and then terminate the line. This method behaves - * as though it invokes {@link #print(boolean)} and then - * {@link #println()}. - * - * @param x The boolean to be printed - * @throws IOException Error writing to wrapped writer - */ @Override public void println(boolean x) throws IOException { print(x); println(); } - /** - * Print a character and then terminate the line. This method behaves as - * though it invokes {@link #print(char)} and then - * {@link #println()}. - * - * @param x The char to be printed - * @throws IOException Error writing to wrapped writer - */ @Override public void println(char x) throws IOException { print(x); println(); } - /** - * Print an integer and then terminate the line. This method behaves as - * though it invokes {@link #print(int)} and then - * {@link #println()}. - * - * @param x The int to be printed - * @throws IOException Error writing to wrapped writer - */ @Override public void println(int x) throws IOException { print(x); println(); } - /** - * Print a long integer and then terminate the line. This method behaves - * as though it invokes {@link #print(long)} and then - * {@link #println()}. - * - * @param x The long to be printed - * @throws IOException Error writing to wrapped writer - */ @Override public void println(long x) throws IOException { print(x); println(); } - /** - * Print a floating-point number and then terminate the line. This method - * behaves as though it invokes {@link #print(float)} and then - * {@link #println()}. - * - * @param x The float to be printed - * @throws IOException Error writing to wrapped writer - */ @Override public void println(float x) throws IOException { print(x); println(); } - /** - * Print a double-precision floating-point number and then terminate the - * line. This method behaves as though it invokes {@link - * #print(double)} and then {@link #println()}. - * - * @param x The double to be printed - * @throws IOException Error writing to wrapped writer - */ @Override public void println(double x) throws IOException{ print(x); println(); } - /** - * Print an array of characters and then terminate the line. This method - * behaves as though it invokes {@link #print(char[])} and - * then {@link #println()}. - * - * @param x The char array to be printed - * @throws IOException Error writing to wrapped writer - */ @Override public void println(char x[]) throws IOException { print(x); println(); } - /** - * Print a String and then terminate the line. This method behaves as - * though it invokes {@link #print(String)} and then - * {@link #println()}. - * - * @param x The string to be printed - * @throws IOException Error writing to wrapped writer - */ @Override public void println(String x) throws IOException { print(x); println(); } - /** - * Print an Object and then terminate the line. This method behaves as - * though it invokes {@link #print(Object)} and then - * {@link #println()}. - * - * @param x The object to be printed - * @throws IOException Error writing to wrapped writer - */ @Override public void println(Object x) throws IOException { print(x); println(); } - /** - * Clear the contents of the buffer. If the buffer has been already - * been flushed then the clear operation shall throw an IOException - * to signal the fact that some data has already been irrevocably - * written to the client response stream. - * - * @throws IOException If there is no wrapped writer - */ @Override public void clear() throws IOException { if (writer != null) { @@ -526,14 +300,6 @@ public void clear() throws IOException { } } - /** - * Clears the current contents of the buffer. Unlike clear(), this - * method will not throw an IOException if the buffer has already been - * flushed. It merely clears the current content of the buffer and - * returns. - * - * @throws IOException Should not happen - */ @Override public void clearBuffer() throws IOException { if (writer == null) { @@ -541,13 +307,6 @@ public void clearBuffer() throws IOException { } } - /** - * Close the stream, flushing it first. Once a stream has been closed, - * further write() or flush() invocations will cause an IOException to be - * thrown. Closing a previously-closed stream, however, has no effect. - * - * @throws IOException Error writing to wrapped writer - */ @Override public void close() throws IOException { if (writer != null) { @@ -557,11 +316,6 @@ public void close() throws IOException { } } - /** - * This method returns the size of the buffer used by the JspWriter. - * - * @return the size of the buffer in bytes, or 0 is unbuffered. - */ @Override public int getBufferSize() { // According to the spec, the JspWriter returned by @@ -571,47 +325,21 @@ public int getBufferSize() { return (writer == null) ? bufferSize : 0; } - /** - * @return the number of bytes unused in the buffer - */ @Override public int getRemaining() { return (writer == null) ? bufferSize-nextChar : 0; } - /** - * Return the value of this BodyJspWriter as a Reader. - * Note: this is after evaluation!! There are no scriptlets, - * etc in this stream. - * - * @return the value of this BodyJspWriter as a Reader - */ @Override public Reader getReader() { return (writer == null) ? new CharArrayReader (cb, 0, nextChar) : null; } - /** - * Return the value of the BodyJspWriter as a String. - * Note: this is after evaluation!! There are no scriptlets, - * etc in this stream. - * - * @return the value of the BodyJspWriter as a String - */ @Override public String getString() { return (writer == null) ? new String(cb, 0, nextChar) : null; } - /** - * Write the contents of this BodyJspWriter into a Writer. - * Subclasses are likely to do interesting things with the - * implementation so some things are extra efficient. - * - * @param out The writer into which to place the contents of this body - * evaluation - * @throws IOException Error writing to writer - */ @Override public void writeOut(Writer out) throws IOException { if (writer == null) { diff --git a/java/org/apache/jasper/runtime/HttpJspBase.java b/java/org/apache/jasper/runtime/HttpJspBase.java index e5e974fd53fd..705c6f8ca953 100644 --- a/java/org/apache/jasper/runtime/HttpJspBase.java +++ b/java/org/apache/jasper/runtime/HttpJspBase.java @@ -60,9 +60,6 @@ public final void destroy() { _jspDestroy(); } - /** - * Entry point into service. - */ @Override public final void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException diff --git a/java/org/apache/jasper/runtime/JspWriterImpl.java b/java/org/apache/jasper/runtime/JspWriterImpl.java index f683b993211e..16aa6daf4b10 100644 --- a/java/org/apache/jasper/runtime/JspWriterImpl.java +++ b/java/org/apache/jasper/runtime/JspWriterImpl.java @@ -129,9 +129,6 @@ private void initOut() throws IOException { } } - /** - * Discard the output buffer. - */ @Override public final void clear() throws IOException { if ((bufferSize == 0) && (out != null)) { @@ -161,10 +158,6 @@ private void bufferOverflow() throws IOException { throw new IOException(Localizer.getMessage("jsp.error.overflow")); } - /** - * Flush the stream. - * - */ @Override public void flush() throws IOException { flushBuffer(); @@ -173,10 +166,6 @@ public void flush() throws IOException { } } - /** - * Close the stream. - * - */ @Override public void close() throws IOException { if (response == null || closed) { @@ -191,9 +180,6 @@ public void close() throws IOException { closed = true; } - /** - * @return the number of bytes unused in the buffer - */ @Override public int getRemaining() { return bufferSize - nextChar; @@ -207,9 +193,6 @@ private void ensureOpen() throws IOException { } - /** - * Write a single character. - */ @Override public void write(int c) throws IOException { ensureOpen(); @@ -239,24 +222,8 @@ private static int min(int a, int b) { return b; } - /** - * Write a portion of an array of characters. - * - *

Ordinarily this method stores characters from the given array into - * this stream's buffer, flushing the buffer to the underlying stream as - * needed. If the requested length is at least as large as the buffer, - * however, then this method will flush the buffer and write the characters - * directly to the underlying stream. Thus redundant - * DiscardableBufferedWriters will not copy data unnecessarily. - * - * @param cbuf A character array - * @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 - { + public void write(char cbuf[], int off, int len) throws IOException { ensureOpen(); if (bufferSize == 0) { @@ -303,22 +270,11 @@ public void write(char cbuf[], int off, int len) } - /** - * 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); } - /** - * Write a portion of a String. - * - * @param s String to be written - * @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(); @@ -344,14 +300,6 @@ public void write(String s, int off, int len) throws IOException { } - /** - * Write a line separator. The line separator string is defined by the - * system property line.separator, and is not necessarily a - * single newline ('\n') character. - * - * @exception IOException If an I/O error occurs - */ - @Override public void newLine() throws IOException { write(System.lineSeparator()); @@ -360,113 +308,41 @@ public void newLine() throws IOException { /* Methods that do not terminate lines */ - /** - * Print a boolean value. The string produced by {@link - * String#valueOf(boolean)} is translated into bytes - * according to the platform's default character encoding, and these bytes - * are written in exactly the manner of the {@link - * #write(int)} method. - * - * @param b The boolean to be printed - */ @Override public void print(boolean b) throws IOException { write(b ? "true" : "false"); } - /** - * Print a character. The character is translated into one or more bytes - * according to the platform's default character encoding, and these bytes - * are written in exactly the manner of the {@link - * #write(int)} method. - * - * @param c The char to be printed - */ @Override public void print(char c) throws IOException { write(String.valueOf(c)); } - /** - * Print an integer. The string produced by {@link - * String#valueOf(int)} is translated into bytes according - * to the platform's default character encoding, and these bytes are - * written in exactly the manner of the {@link #write(int)} - * method. - * - * @param i The int to be printed - */ @Override public void print(int i) throws IOException { write(String.valueOf(i)); } - /** - * Print a long integer. The string produced by {@link - * String#valueOf(long)} is translated into bytes - * according to the platform's default character encoding, and these bytes - * are written in exactly the manner of the {@link #write(int)} - * method. - * - * @param l The long to be printed - */ @Override public void print(long l) throws IOException { write(String.valueOf(l)); } - /** - * Print a floating-point number. The string produced by {@link - * String#valueOf(float)} is translated into bytes - * according to the platform's default character encoding, and these bytes - * are written in exactly the manner of the {@link #write(int)} - * method. - * - * @param f The float to be printed - */ @Override public void print(float f) throws IOException { write(String.valueOf(f)); } - /** - * Print a double-precision floating-point number. The string produced by - * {@link String#valueOf(double)} is translated into - * bytes according to the platform's default character encoding, and these - * bytes are written in exactly the manner of the {@link - * #write(int)} method. - * - * @param d The double to be printed - */ @Override public void print(double d) throws IOException { write(String.valueOf(d)); } - /** - * Print an array of characters. The characters are converted into bytes - * according to the platform's default character encoding, and these bytes - * are written in exactly the manner of the {@link #write(int)} - * method. - * - * @param s The array of chars to be printed - * - * @throws NullPointerException If s is null - */ @Override public void print(char s[]) throws IOException { write(s); } - /** - * Print a string. If the argument is null then the string - * "null" is printed. Otherwise, the string's characters are - * converted into bytes according to the platform's default character - * encoding, and these bytes are written in exactly the manner of the - * {@link #write(int)} method. - * - * @param s The String to be printed - */ @Override public void print(String s) throws IOException { if (s == null) { @@ -475,15 +351,6 @@ public void print(String s) throws IOException { write(s); } - /** - * Print an object. The string produced by the {@link - * String#valueOf(Object)} method is translated into bytes - * according to the platform's default character encoding, and these bytes - * are written in exactly the manner of the {@link #write(int)} - * method. - * - * @param obj The Object to be printed - */ @Override public void print(Object obj) throws IOException { write(String.valueOf(obj)); @@ -491,114 +358,59 @@ public void print(Object obj) throws IOException { /* Methods that do terminate lines */ - /** - * Terminate the current line by writing the line separator string. The - * line separator string is defined by the system property - * line.separator, and is not necessarily a single newline - * character ('\n'). - * - * Need to change this from PrintWriter because the default - * println() writes to the sink directly instead of through the - * write method... - */ @Override public void println() throws IOException { newLine(); } - /** - * Print a boolean value and then terminate the line. This method behaves - * as though it invokes {@link #print(boolean)} and then - * {@link #println()}. - */ @Override public void println(boolean x) throws IOException { print(x); println(); } - /** - * Print a character and then terminate the line. This method behaves as - * though it invokes {@link #print(char)} and then {@link - * #println()}. - */ @Override public void println(char x) throws IOException { print(x); println(); } - /** - * Print an integer and then terminate the line. This method behaves as - * though it invokes {@link #print(int)} and then {@link - * #println()}. - */ @Override public void println(int x) throws IOException { print(x); println(); } - /** - * Print a long integer and then terminate the line. This method behaves - * as though it invokes {@link #print(long)} and then - * {@link #println()}. - */ @Override public void println(long x) throws IOException { print(x); println(); } - /** - * Print a floating-point number and then terminate the line. This method - * behaves as though it invokes {@link #print(float)} and then - * {@link #println()}. - */ @Override public void println(float x) throws IOException { print(x); println(); } - /** - * Print a double-precision floating-point number and then terminate the - * 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(); } - /** - * Print an array of characters and then terminate the line. This method - * behaves as though it invokes {@link #print(char[])} and then - * {@link #println()}. - */ @Override public void println(char x[]) throws IOException { print(x); println(); } - /** - * Print a String and then terminate the line. This method behaves as - * though it invokes {@link #print(String)} and then - * {@link #println()}. - */ @Override public void println(String x) throws IOException { print(x); println(); } - /** - * Print an Object and then terminate the line. This method behaves as - * though it invokes {@link #print(Object)} and then - * {@link #println()}. - */ @Override public void println(Object x) throws IOException { print(x); diff --git a/java/org/apache/jasper/runtime/ServletResponseWrapperInclude.java b/java/org/apache/jasper/runtime/ServletResponseWrapperInclude.java index e0fa3d839829..4083ec203c0c 100644 --- a/java/org/apache/jasper/runtime/ServletResponseWrapperInclude.java +++ b/java/org/apache/jasper/runtime/ServletResponseWrapperInclude.java @@ -52,7 +52,7 @@ public ServletResponseWrapperInclude(ServletResponse response, } /** - * Returns a wrapper around the JspWriter of the including page. + * @return a wrapper around the JspWriter of the including page. */ @Override public PrintWriter getWriter() throws IOException { diff --git a/java/org/apache/jasper/servlet/JspCServletContext.java b/java/org/apache/jasper/servlet/JspCServletContext.java index 074357e4c46f..33b2ca942701 100644 --- a/java/org/apache/jasper/servlet/JspCServletContext.java +++ b/java/org/apache/jasper/servlet/JspCServletContext.java @@ -232,113 +232,66 @@ private Map scanForFragments(WebXmlParser webXmlParser) throws J // --------------------------------------------------------- Public Methods - /** - * Return the specified context attribute, if any. - * - * @param name Name of the requested attribute - */ @Override public Object getAttribute(String name) { return myAttributes.get(name); } - /** - * Return an enumeration of context attribute names. - */ @Override public Enumeration getAttributeNames() { return Collections.enumeration(myAttributes.keySet()); } - /** - * Return the servlet context for the specified path. - * - * @param uripath Server-relative path starting with '/' - */ @Override public ServletContext getContext(String uripath) { return null; } - /** - * Return the context path. - */ @Override public String getContextPath() { return null; } - /** - * Return the specified context initialization parameter. - * - * @param name Name of the requested parameter - */ @Override public String getInitParameter(String name) { return myParameters.get(name); } - /** - * Return an enumeration of the names of context initialization - * parameters. - */ @Override public Enumeration getInitParameterNames() { return Collections.enumeration(myParameters.keySet()); } - /** - * Return the Servlet API major version number. - */ @Override public int getMajorVersion() { return 4; } - /** - * Return the MIME type for the specified filename. - * - * @param file Filename whose MIME type is requested - */ @Override public String getMimeType(String file) { return null; } - /** - * Return the Servlet API minor version number. - */ @Override public int getMinorVersion() { return 0; } - /** - * Return a request dispatcher for the specified servlet name. - * - * @param name Name of the requested servlet - */ @Override public RequestDispatcher getNamedDispatcher(String name) { return null; } - /** - * Return the real path for the specified context-relative - * virtual path. - * - * @param path The context-relative virtual path to resolve - */ @Override public String getRealPath(String path) { if (!myResourceBaseURL.getProtocol().equals("file")) { @@ -361,26 +314,12 @@ public String getRealPath(String path) { } - /** - * Return a request dispatcher for the specified context-relative path. - * - * @param path Context-relative path for which to acquire a dispatcher - */ @Override public RequestDispatcher getRequestDispatcher(String path) { return null; } - /** - * Return a URL object of a resource that is mapped to the - * specified context-relative path. - * - * @param path Context-relative path of the desired resource - * - * @exception MalformedURLException if the resource path is - * not properly formed - */ @Override public URL getResource(String path) throws MalformedURLException { @@ -420,12 +359,6 @@ public URL getResource(String path) throws MalformedURLException { } - /** - * Return an InputStream allowing access to the resource at the - * specified context-relative path. - * - * @param path Context-relative path of the desired resource - */ @Override public InputStream getResourceAsStream(String path) { try { @@ -441,12 +374,6 @@ public InputStream getResourceAsStream(String path) { } - /** - * Return the set of resource paths for the "directory" at the - * specified context path. - * - * @param path Context-relative base path - */ @Override public Set getResourcePaths(String path) { @@ -505,41 +432,24 @@ public Set getResourcePaths(String path) { } - /** - * Return descriptive information about this server. - */ @Override public String getServerInfo() { return "JspC/ApacheTomcat11"; } - /** - * Return the name of this servlet context. - */ @Override public String getServletContextName() { return getServerInfo(); } - /** - * Log the specified message. - * - * @param message The message to be logged - */ @Override public void log(String message) { myLogWriter.println(message); } - /** - * Log the specified message and exception. - * - * @param message The message to be logged - * @param exception The exception to be logged - */ @Override public void log(String message, Throwable exception) { myLogWriter.println(message); @@ -547,23 +457,12 @@ public void log(String message, Throwable exception) { } - /** - * Remove the specified context attribute. - * - * @param name Name of the attribute to remove - */ @Override public void removeAttribute(String name) { myAttributes.remove(name); } - /** - * Set or replace the specified context attribute. - * - * @param name Name of the context attribute to set - * @param value Corresponding attribute value - */ @Override public void setAttribute(String name, Object value) { myAttributes.put(name, value); diff --git a/java/org/apache/jasper/servlet/JspServlet.java b/java/org/apache/jasper/servlet/JspServlet.java index 0373d86c3e36..3fd33a20f2d6 100644 --- a/java/org/apache/jasper/servlet/JspServlet.java +++ b/java/org/apache/jasper/servlet/JspServlet.java @@ -71,9 +71,6 @@ public class JspServlet extends HttpServlet implements PeriodicEventListener { private String jspFile; - /* - * Initializes this JspServlet. - */ @Override public void init(ServletConfig config) throws ServletException {