aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java8
1 files changed, 1 insertions, 7 deletions
diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
index fb086e9f3..87df28f0c 100644
--- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
+++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
@@ -476,9 +476,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider, IBinarySour
}
private void copyResourcesFromJarFile(File jarFile) throws IOException {
- JarInputStream inStream = null;
- try {
- inStream = new JarInputStream(new FileInputStream(jarFile));
+ try (JarInputStream inStream = new JarInputStream(new FileInputStream(jarFile))) {
while (true) {
ZipEntry entry = inStream.getNextEntry();
if (entry == null) {
@@ -496,10 +494,6 @@ public class AjBuildManager implements IOutputClassFileNameProvider, IBinarySour
inStream.closeEntry();
}
- } finally {
- if (inStream != null) {
- inStream.close();
- }
}
}