Add @Override annotations
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 17 Nov 2009 21:21:41 +0000 (21:21 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 17 Nov 2009 21:21:41 +0000 (21:21 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@881533 13f79535-47bb-0310-9956-ffa450edef68

12 files changed:
java/org/apache/tomcat/util/http/fileupload/ByteArrayOutputStream.java
java/org/apache/tomcat/util/http/fileupload/DeferredFileOutputStream.java
java/org/apache/tomcat/util/http/fileupload/DiskFileItem.java
java/org/apache/tomcat/util/http/fileupload/FileCleaningTracker.java
java/org/apache/tomcat/util/http/fileupload/FileDeleteStrategy.java
java/org/apache/tomcat/util/http/fileupload/FileUpload.java
java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java
java/org/apache/tomcat/util/http/fileupload/FileUploadException.java
java/org/apache/tomcat/util/http/fileupload/LimitedInputStream.java
java/org/apache/tomcat/util/http/fileupload/MultipartStream.java
java/org/apache/tomcat/util/http/fileupload/ServletRequestContext.java
java/org/apache/tomcat/util/http/fileupload/ThresholdingOutputStream.java

index b652d9d..21e7c15 100644 (file)
@@ -136,6 +136,7 @@ public class ByteArrayOutputStream extends OutputStream {
      * @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 @@ public class ByteArrayOutputStream extends OutputStream {
      * 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 @@ public class ByteArrayOutputStream extends OutputStream {
      * @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 @@ public class ByteArrayOutputStream extends OutputStream {
      * @return the contents of the byte array as a String
      * @see java.io.ByteArrayOutputStream#toString()
      */
+    @Override
     public String toString() {
         return new String(toByteArray());
     }
index bb21d4e..201af86 100644 (file)
@@ -141,6 +141,7 @@ public class DeferredFileOutputStream
      *
      * @exception IOException if an error occurs.
      */
+    @Override
     protected OutputStream getStream() throws IOException
     {
         return currentOutputStream;
@@ -155,6 +156,7 @@ public class DeferredFileOutputStream
      *
      * @exception IOException if an error occurs.
      */
+    @Override
     protected void thresholdReached() throws IOException
     {
         if (prefix != null) {
@@ -226,6 +228,7 @@ public class DeferredFileOutputStream
      *
      * @exception IOException if an error occurs.
      */
+    @Override
     public void close() throws IOException
     {
         super.close();
index 719ae93..f1e7251 100644 (file)
@@ -579,6 +579,7 @@ public class DiskFileItem
     /**
      * Removes the file contents from the temporary storage.
      */
+    @Override
     protected void finalize() {
         File outputFile = dfos.getFile();
 
@@ -645,6 +646,7 @@ public class DiskFileItem
      *
      * @return a string representation of this object.
      */
+    @Override
     public String toString() {
         return "name=" + this.getName()
             + ", StoreLocation="
index cd64a32..360a06b 100644 (file)
@@ -196,6 +196,7 @@ public class FileCleaningTracker {
          * Run the reaper thread that will delete files as their associated\r
          * marker objects are reclaimed by the garbage collector.\r
          */\r
+        @Override\r
         public void run() {\r
             // thread exits when exitWhenFinished is true and there are no more tracked objects\r
             while (exitWhenFinished == false || trackers.size() > 0) {\r
index 4715322..2c379ae 100644 (file)
@@ -122,6 +122,7 @@ public class FileDeleteStrategy {
      *
      * @return a string describing the delete strategy
      */
+    @Override
     public String toString() {
         return "FileDeleteStrategy[" + name + "]";
     }
@@ -147,6 +148,7 @@ public class FileDeleteStrategy {
          * @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;
index 8676273..edabd66 100644 (file)
@@ -88,6 +88,7 @@ public class FileUpload
      *
      * @return The factory class for new file items.
      */
+    @Override
     public FileItemFactory getFileItemFactory() {
         return fileItemFactory;
     }
@@ -98,6 +99,7 @@ public class FileUpload
      *
      * @param factory The factory class for new file items.
      */
+    @Override
     public void setFileItemFactory(FileItemFactory factory) {
         this.fileItemFactory = factory;
     }
index 7c63b8e..46d20a1 100644 (file)
@@ -593,6 +593,7 @@ public abstract class FileUploadBase {
                         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 @@ public abstract class FileUploadBase {
                 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 @@ public abstract class FileUploadBase {
          * Returns the exceptions cause.
          * @return The exceptions cause, if any, or null.
          */
+        @Override
         public Throwable getCause() {
             return cause;
         }
@@ -1000,6 +1003,7 @@ public abstract class FileUploadBase {
          * Returns the exceptions cause.
          * @return The exceptions cause, if any, or null.
          */
+        @Override
         public Throwable getCause() {
             return cause;
         }
index 092ee34..8c4527a 100644 (file)
@@ -71,6 +71,7 @@ public class FileUploadException extends Exception {
      *
      * @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 @@ public class FileUploadException extends Exception {
      *
      * @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 @@ public class FileUploadException extends Exception {
         }
     }
 
+    @Override
     public Throwable getCause() {
         return cause;
     }
index 6d0a536..bbef674 100644 (file)
@@ -89,6 +89,7 @@ public abstract class LimitedInputStream
      * @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 @@ public abstract class LimitedInputStream
      * @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 @@ public abstract class LimitedInputStream
      * @exception  IOException  if an I/O error occurs.
      * @see        java.io.FilterInputStream#in
      */
+    @Override
     public void close() throws IOException {
         closed = true;
         super.close();
index ec04d52..20c28fa 100644 (file)
@@ -779,6 +779,7 @@ public class MultipartStream {
          * @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 @@ public class MultipartStream {
          *   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 @@ public class MultipartStream {
          *   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 @@ public class MultipartStream {
          * Closes the input stream.
          * @throws IOException An I/O error occurred.
          */
+        @Override
         public void close() throws IOException {
             close(false);
         }
@@ -886,6 +890,7 @@ public class MultipartStream {
          *   skipped.
          * @throws IOException An I/O error occurred.
          */
+        @Override
         public long skip(long bytes) throws IOException {
             if (closed) {
                 throw new FileItemStream.ItemSkippedException();
index 7fdaedc..bb5460a 100644 (file)
@@ -98,6 +98,7 @@ public class ServletRequestContext implements RequestContext {
      *
      * @return a string representation of this object.
      */
+    @Override
     public String toString() {
         return "ContentLength="
             + this.getContentLength()
index 142cb40..e93e1fa 100644 (file)
@@ -88,6 +88,7 @@ public abstract class ThresholdingOutputStream
      *
      * @exception IOException if an error occurs.
      */
+    @Override
     public void write(int b) throws IOException
     {
         checkThreshold(1);
@@ -104,6 +105,7 @@ public abstract class ThresholdingOutputStream
      *
      * @exception IOException if an error occurs.
      */
+    @Override
     public void write(byte b[]) throws IOException
     {
         checkThreshold(b.length);
@@ -122,6 +124,7 @@ public abstract class ThresholdingOutputStream
      *
      * @exception IOException if an error occurs.
      */
+    @Override
     public void write(byte b[], int off, int len) throws IOException
     {
         checkThreshold(len);
@@ -136,6 +139,7 @@ public abstract class ThresholdingOutputStream
      *
      * @exception IOException if an error occurs.
      */
+    @Override
     public void flush() throws IOException
     {
         getStream().flush();
@@ -148,6 +152,7 @@ public abstract class ThresholdingOutputStream
      *
      * @exception IOException if an error occurs.
      */
+    @Override
     public void close() throws IOException
     {
         try