Author: markt Date: Tue Nov 17 21:21:41 2009 New Revision: 881533 URL: http://svn.apache.org/viewvc?rev=881533&view=rev Log: Add @Override annotations
Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ByteArrayOutputStream.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/DeferredFileOutputStream.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/DiskFileItem.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileCleaningTracker.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileDeleteStrategy.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUpload.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadException.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/LimitedInputStream.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/MultipartStream.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ServletRequestContext.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ThresholdingOutputStream.java Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ByteArrayOutputStream.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ByteArrayOutputStream.java?rev=881533&r1=881532&r2=881533&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ByteArrayOutputStream.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ByteArrayOutputStream.java Tue Nov 17 21:21:41 2009 @@ -136,6 +136,7 @@ * @param off The start offset * @param len The number of bytes to write */ + @Override public void write(byte[] b, int off, int len) { if ((off < 0) || (off > b.length) @@ -167,6 +168,7 @@ * Write a byte to byte array. * @param b the byte to write */ + @Override public synchronized void write(int b) { int inBufferPos = count - filledBufferSum; if (inBufferPos == currentBuffer.length) { @@ -221,6 +223,7 @@ * @throws IOException never (this method should not declare this exception * but it has to now due to backwards compatability) */ + @Override public void close() throws IOException { //nop } @@ -288,6 +291,7 @@ * @return the contents of the byte array as a String * @see java.io.ByteArrayOutputStream#toString() */ + @Override public String toString() { return new String(toByteArray()); } Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/DeferredFileOutputStream.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/DeferredFileOutputStream.java?rev=881533&r1=881532&r2=881533&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/DeferredFileOutputStream.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/DeferredFileOutputStream.java Tue Nov 17 21:21:41 2009 @@ -141,6 +141,7 @@ * * @exception IOException if an error occurs. */ + @Override protected OutputStream getStream() throws IOException { return currentOutputStream; @@ -155,6 +156,7 @@ * * @exception IOException if an error occurs. */ + @Override protected void thresholdReached() throws IOException { if (prefix != null) { @@ -226,6 +228,7 @@ * * @exception IOException if an error occurs. */ + @Override public void close() throws IOException { super.close(); Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/DiskFileItem.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/DiskFileItem.java?rev=881533&r1=881532&r2=881533&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/DiskFileItem.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/DiskFileItem.java Tue Nov 17 21:21:41 2009 @@ -579,6 +579,7 @@ /** * Removes the file contents from the temporary storage. */ + @Override protected void finalize() { File outputFile = dfos.getFile(); @@ -645,6 +646,7 @@ * * @return a string representation of this object. */ + @Override public String toString() { return "name=" + this.getName() + ", StoreLocation=" Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileCleaningTracker.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileCleaningTracker.java?rev=881533&r1=881532&r2=881533&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileCleaningTracker.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileCleaningTracker.java Tue Nov 17 21:21:41 2009 @@ -196,6 +196,7 @@ * Run the reaper thread that will delete files as their associated * marker objects are reclaimed by the garbage collector. */ + @Override public void run() { // thread exits when exitWhenFinished is true and there are no more tracked objects while (exitWhenFinished == false || trackers.size() > 0) { Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileDeleteStrategy.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileDeleteStrategy.java?rev=881533&r1=881532&r2=881533&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileDeleteStrategy.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileDeleteStrategy.java Tue Nov 17 21:21:41 2009 @@ -122,6 +122,7 @@ * * @return a string describing the delete strategy */ + @Override public String toString() { return "FileDeleteStrategy[" + name + "]"; } @@ -147,6 +148,7 @@ * @throws NullPointerException if the file is null * @throws IOException if an error occurs during file deletion */ + @Override protected boolean doDelete(File fileToDelete) throws IOException { FileUtils.forceDelete(fileToDelete); return true; Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUpload.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUpload.java?rev=881533&r1=881532&r2=881533&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUpload.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUpload.java Tue Nov 17 21:21:41 2009 @@ -88,6 +88,7 @@ * * @return The factory class for new file items. */ + @Override public FileItemFactory getFileItemFactory() { return fileItemFactory; } @@ -98,6 +99,7 @@ * * @param factory The factory class for new file items. */ + @Override public void setFileItemFactory(FileItemFactory factory) { this.fileItemFactory = factory; } Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java?rev=881533&r1=881532&r2=881533&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java Tue Nov 17 21:21:41 2009 @@ -593,6 +593,7 @@ throw new FileUploadIOException(e); } istream = new LimitedInputStream(istream, fileSizeMax) { + @Override protected void raiseError(long pSizeMax, long pCount) throws IOException { itemStream.close(true); @@ -750,6 +751,7 @@ int requestSize = ctx.getContentLength(); if (requestSize == -1) { input = new LimitedInputStream(input, sizeMax) { + @Override protected void raiseError(long pSizeMax, long pCount) throws IOException { FileUploadException ex = @@ -940,6 +942,7 @@ * Returns the exceptions cause. * @return The exceptions cause, if any, or null. */ + @Override public Throwable getCause() { return cause; } @@ -1000,6 +1003,7 @@ * Returns the exceptions cause. * @return The exceptions cause, if any, or null. */ + @Override public Throwable getCause() { return cause; } Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadException.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadException.java?rev=881533&r1=881532&r2=881533&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadException.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadException.java Tue Nov 17 21:21:41 2009 @@ -71,6 +71,7 @@ * * @param stream <code>PrintStream</code> to use for output */ + @Override public void printStackTrace(PrintStream stream) { super.printStackTrace(stream); if (cause != null) { @@ -85,6 +86,7 @@ * * @param writer <code>PrintWriter</code> to use for output */ + @Override public void printStackTrace(PrintWriter writer) { super.printStackTrace(writer); if (cause != null) { @@ -93,6 +95,7 @@ } } + @Override public Throwable getCause() { return cause; } Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/LimitedInputStream.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/LimitedInputStream.java?rev=881533&r1=881532&r2=881533&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/LimitedInputStream.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/LimitedInputStream.java Tue Nov 17 21:21:41 2009 @@ -89,6 +89,7 @@ * @exception IOException if an I/O error occurs. * @see java.io.FilterInputStream#in */ + @Override public int read() throws IOException { int res = super.read(); if (res != -1) { @@ -121,6 +122,7 @@ * @exception IOException if an I/O error occurs. * @see java.io.FilterInputStream#in */ + @Override public int read(byte[] b, int off, int len) throws IOException { int res = super.read(b, off, len); if (res > 0) { @@ -148,6 +150,7 @@ * @exception IOException if an I/O error occurs. * @see java.io.FilterInputStream#in */ + @Override public void close() throws IOException { closed = true; super.close(); Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/MultipartStream.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/MultipartStream.java?rev=881533&r1=881532&r2=881533&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/MultipartStream.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/MultipartStream.java Tue Nov 17 21:21:41 2009 @@ -779,6 +779,7 @@ * @throws IOException An I/O error occurs. * @return Number of bytes in the buffer. */ + @Override public int available() throws IOException { if (pos == -1) { return tail - head - pad; @@ -796,6 +797,7 @@ * integer, or -1 for EOF. * @throws IOException An I/O error occurred. */ + @Override public int read() throws IOException { if (closed) { throw new FileItemStream.ItemSkippedException(); @@ -822,6 +824,7 @@ * or -1 for EOF. * @throws IOException An I/O error occurred. */ + @Override public int read(byte[] b, int off, int len) throws IOException { if (closed) { throw new FileItemStream.ItemSkippedException(); @@ -847,6 +850,7 @@ * Closes the input stream. * @throws IOException An I/O error occurred. */ + @Override public void close() throws IOException { close(false); } @@ -886,6 +890,7 @@ * skipped. * @throws IOException An I/O error occurred. */ + @Override public long skip(long bytes) throws IOException { if (closed) { throw new FileItemStream.ItemSkippedException(); Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ServletRequestContext.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ServletRequestContext.java?rev=881533&r1=881532&r2=881533&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ServletRequestContext.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ServletRequestContext.java Tue Nov 17 21:21:41 2009 @@ -98,6 +98,7 @@ * * @return a string representation of this object. */ + @Override public String toString() { return "ContentLength=" + this.getContentLength() Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ThresholdingOutputStream.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ThresholdingOutputStream.java?rev=881533&r1=881532&r2=881533&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ThresholdingOutputStream.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ThresholdingOutputStream.java Tue Nov 17 21:21:41 2009 @@ -88,6 +88,7 @@ * * @exception IOException if an error occurs. */ + @Override public void write(int b) throws IOException { checkThreshold(1); @@ -104,6 +105,7 @@ * * @exception IOException if an error occurs. */ + @Override public void write(byte b[]) throws IOException { checkThreshold(b.length); @@ -122,6 +124,7 @@ * * @exception IOException if an error occurs. */ + @Override public void write(byte b[], int off, int len) throws IOException { checkThreshold(len); @@ -136,6 +139,7 @@ * * @exception IOException if an error occurs. */ + @Override public void flush() throws IOException { getStream().flush(); @@ -148,6 +152,7 @@ * * @exception IOException if an error occurs. */ + @Override public void close() throws IOException { try --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org