Author: violetagg
Date: Thu Jul  9 08:34:04 2015
New Revision: 1690021

URL: http://svn.apache.org/r1690021
Log:
Close the stream when there is an exception otherwise keep it opened, it will 
be closed later.

Modified:
    tomcat/trunk/java/org/apache/catalina/ant/DeployTask.java

Modified: tomcat/trunk/java/org/apache/catalina/ant/DeployTask.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ant/DeployTask.java?rev=1690021&r1=1690020&r2=1690021&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/ant/DeployTask.java (original)
+++ tomcat/trunk/java/org/apache/catalina/ant/DeployTask.java Thu Jul  9 
08:34:04 2015
@@ -199,6 +199,13 @@ public class DeployTask extends Abstract
                 sb.append(URLEncoder.encode(tag, getCharset()));
             }
         } catch (UnsupportedEncodingException e) {
+            if (stream != null) {
+                try {
+                    stream.close();
+                } catch (IOException ioe) {
+                    // Ignore
+                }
+            }
             throw new BuildException("Invalid 'charset' attribute: " + 
getCharset());
         }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to