diff --git a/src/main/org/apache/tools/ant/taskdefs/JDBCTask.java b/src/main/org/apache/tools/ant/taskdefs/JDBCTask.java index 3b8dd464c..5f3da78f3 100644 --- a/src/main/org/apache/tools/ant/taskdefs/JDBCTask.java +++ b/src/main/org/apache/tools/ant/taskdefs/JDBCTask.java @@ -349,8 +349,8 @@ public abstract class JDBCTask extends Task { info.put("password", getPassword()); for (Property p : connectionProperties) { - String name = p.getName(); - String value = p.getValue(); + String name = p.getName(); + String value = p.getValue(); if (name == null || value == null) { log("Only name/value pairs are supported as connection properties.", Project.MSG_WARN); diff --git a/src/main/org/apache/tools/ant/taskdefs/Jar.java b/src/main/org/apache/tools/ant/taskdefs/Jar.java index 73a871fb4..3797e8987 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Jar.java +++ b/src/main/org/apache/tools/ant/taskdefs/Jar.java @@ -860,23 +860,23 @@ public class Jar extends Zip { log("Building MANIFEST-only jar: " + getDestFile().getAbsolutePath()); - try (ZipOutputStream zOut = new ZipOutputStream(getDestFile())) { - zOut.setEncoding(getEncoding()); - zOut.setUseZip64(getZip64Mode().getMode()); - if (isCompress()) { - zOut.setMethod(ZipOutputStream.DEFLATED); - } else { - zOut.setMethod(ZipOutputStream.STORED); + try (ZipOutputStream zOut = new ZipOutputStream(getDestFile())) { + zOut.setEncoding(getEncoding()); + zOut.setUseZip64(getZip64Mode().getMode()); + if (isCompress()) { + zOut.setMethod(ZipOutputStream.DEFLATED); + } else { + zOut.setMethod(ZipOutputStream.STORED); + } + initZipOutputStream(zOut); + finalizeZipOutputStream(zOut); + } catch (IOException ioe) { + throw new BuildException("Could not create almost empty JAR archive" + + " (" + ioe.getMessage() + ")", ioe, + getLocation()); + } finally { + createEmpty = false; } - initZipOutputStream(zOut); - finalizeZipOutputStream(zOut); - } catch (IOException ioe) { - throw new BuildException("Could not create almost empty JAR archive" - + " (" + ioe.getMessage() + ")", ioe, - getLocation()); - } finally { - createEmpty = false; - } } return true; }