You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by GitBox <gi...@apache.org> on 2022/10/10 15:10:42 UTC

[GitHub] [jackrabbit-filevault] kwin commented on a diff in pull request #250: JCRVLT-662: JcrPackageRegistry.remove() leaks temp file

kwin commented on code in PR #250:
URL: https://github.com/apache/jackrabbit-filevault/pull/250#discussion_r991396399


##########
vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/registry/impl/JcrPackageRegistry.java:
##########
@@ -655,8 +655,8 @@ public void remove(@NotNull PackageId id) throws IOException, NoSuchPackageExcep
         if (pkg == null) {
             throw new NoSuchPackageException().setId(id);
         }
-        JcrPackage pack = pkg.getJcrPackage();
         try {
+            JcrPackage pack = pkg.getJcrPackage();

Review Comment:
   you can use [try with resources](https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html) as `JcrPackage` implements `AutoClosable`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org