This is an automated email from the ASF dual-hosted git repository.

kwin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-jspc-maven-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new e0c91ae  close Jar after usage
e0c91ae is described below

commit e0c91ae875a94fbcf66d78278b9efbdcf297d367
Author: Konrad Windszus <[email protected]>
AuthorDate: Thu Oct 15 12:45:15 2020 +0200

    close Jar after usage
---
 src/main/java/org/apache/sling/maven/jspc/JspcMojo.java | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/sling/maven/jspc/JspcMojo.java 
b/src/main/java/org/apache/sling/maven/jspc/JspcMojo.java
index e21dc94..9fa867f 100644
--- a/src/main/java/org/apache/sling/maven/jspc/JspcMojo.java
+++ b/src/main/java/org/apache/sling/maven/jspc/JspcMojo.java
@@ -530,8 +530,7 @@ public class JspcMojo extends AbstractMojo implements 
Options {
      * @param a the artifact to scan
      */
     private void scanArtifactPackages(Map<String, Set<String>> 
artifactsByPackage, Artifact a) {
-        try {
-            JarFile jar = new JarFile(a.getFile());
+        try (JarFile jar = new JarFile(a.getFile())) {
             Enumeration<JarEntry> entries = jar.entries();
             while (entries.hasMoreElements()) {
                 JarEntry e = entries.nextElement();

Reply via email to