Author: markt Date: Fri Mar 15 14:35:32 2013 New Revision: 1456968 URL: http://svn.apache.org/r1456968 Log: Diff trunk and 7.0.x and apply missing updates to 7.0.x
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadException.java Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java?rev=1456968&r1=1456967&r2=1456968&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java Fri Mar 15 14:35:32 2013 @@ -341,14 +341,15 @@ public abstract class FileUploadBase { public Map<String, List<FileItem>> parseParameterMap(RequestContext ctx) throws FileUploadException { final List<FileItem> items = parseRequest(ctx); - final Map<String, List<FileItem>> itemsMap = new HashMap<>(items.size()); + final Map<String, List<FileItem>> itemsMap = + new HashMap<String, List<FileItem>>(items.size()); for (FileItem fileItem : items) { String fieldName = fileItem.getFieldName(); List<FileItem> mappedItems = itemsMap.get(fieldName); if (mappedItems == null) { - mappedItems = new ArrayList<>(); + mappedItems = new ArrayList<FileItem>(); itemsMap.put(fieldName, mappedItems); } @@ -986,32 +987,23 @@ public abstract class FileUploadBase { * {@link FileUploadException} in an {@link IOException}. */ public static class FileUploadIOException extends IOException { - /** The exceptions UID, for serializing an instance. - */ - private static final long serialVersionUID = -7047616958165584154L; - /** The exceptions cause; we overwrite the parent - * classes field, which is available since Java - * 1.4 only. - */ - private final FileUploadException cause; - /** - * Creates a <code>FileUploadIOException</code> with the - * given cause. - * @param pCause The exceptions cause, if any, or null. - */ - public FileUploadIOException(FileUploadException pCause) { - // We're not doing super(pCause) cause of 1.3 compatibility. - cause = pCause; + private static final long serialVersionUID = -3082868232248803474L; + + public FileUploadIOException() { + super(); } - /** - * Returns the exceptions cause. - * @return The exceptions cause, if any, or null. - */ - @Override - public Throwable getCause() { - return cause; + public FileUploadIOException(String message, Throwable cause) { + super(message, cause); + } + + public FileUploadIOException(String message) { + super(message); + } + + public FileUploadIOException(Throwable cause) { + super(cause); } } @@ -1050,32 +1042,23 @@ public abstract class FileUploadBase { * Thrown to indicate an IOException. */ public static class IOFileUploadException extends FileUploadException { - /** The exceptions UID, for serializing an instance. - */ - private static final long serialVersionUID = 1749796615868477269L; - /** The exceptions cause; we overwrite the parent - * classes field, which is available since Java - * 1.4 only. - */ - private final IOException cause; - /** - * Creates a new instance with the given cause. - * @param pMsg The detail message. - * @param pException The exceptions cause. - */ - public IOFileUploadException(String pMsg, IOException pException) { - super(pMsg); - cause = pException; + private static final long serialVersionUID = -5858565745868986701L; + + public IOFileUploadException() { + super(); } - /** - * Returns the exceptions cause. - * @return The exceptions cause, if any, or null. - */ - @Override - public Throwable getCause() { - return cause; + public IOFileUploadException(String message, Throwable cause) { + super(message, cause); + } + + public IOFileUploadException(String message) { + super(message); + } + + public IOFileUploadException(Throwable cause) { + super(cause); } } Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadException.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadException.java?rev=1456968&r1=1456967&r2=1456968&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadException.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadException.java Fri Mar 15 14:35:32 2013 @@ -16,87 +16,26 @@ */ package org.apache.tomcat.util.http.fileupload; -import java.io.PrintStream; -import java.io.PrintWriter; - - /** * Exception for errors encountered while processing the request. - * - * @author <a href="mailto:jmcna...@collab.net">John McNally</a> - * @version $Id$ */ public class FileUploadException extends Exception { - /** - * Serial version UID, being used, if the exception - * is serialized. - */ - private static final long serialVersionUID = 8881893724388807504L; - /** - * The exceptions cause. We overwrite the cause of - * the super class, which isn't available in Java 1.3. - */ - private final Throwable cause; - - /** - * Constructs a new <code>FileUploadException</code> without message. - */ - public FileUploadException() { - this(null, null); - } - /** - * Constructs a new <code>FileUploadException</code> with specified detail - * message. - * - * @param msg the error message. - */ - public FileUploadException(final String msg) { - this(msg, null); - } + private static final long serialVersionUID = -4222909057964038517L; - /** - * Creates a new <code>FileUploadException</code> with the given - * detail message and cause. - * @param msg The exceptions detail message. - * @param cause The exceptions cause. - */ - public FileUploadException(String msg, Throwable cause) { - super(msg); - this.cause = cause; + public FileUploadException() { + super(); } - /** - * Prints this throwable and its backtrace to the specified print stream. - * - * @param stream <code>PrintStream</code> to use for output - */ - @Override - public void printStackTrace(PrintStream stream) { - super.printStackTrace(stream); - if (cause != null) { - stream.println("Caused by:"); - cause.printStackTrace(stream); - } + public FileUploadException(String message, Throwable cause) { + super(message, cause); } - /** - * Prints this throwable and its backtrace to the specified - * print writer. - * - * @param writer <code>PrintWriter</code> to use for output - */ - @Override - public void printStackTrace(PrintWriter writer) { - super.printStackTrace(writer); - if (cause != null) { - writer.println("Caused by:"); - cause.printStackTrace(writer); - } + public FileUploadException(String message) { + super(message); } - @Override - public Throwable getCause() { - return cause; + public FileUploadException(Throwable cause) { + super(cause); } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org