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:08:31 UTC

[GitHub] [jackrabbit-filevault] mreutegg opened a new pull request, #250: JCRVLT-662: JcrPackageRegistry.remove() leaks temp file

mreutegg opened a new pull request, #250:
URL: https://github.com/apache/jackrabbit-filevault/pull/250

   Fix and test to validate


-- 
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


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

Posted by GitBox <gi...@apache.org>.
mreutegg commented on code in PR #250:
URL: https://github.com/apache/jackrabbit-filevault/pull/250#discussion_r991872542


##########
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:
   Done. Also put the `snap` `JcrPackage` into a try with resources.



-- 
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


[GitHub] [jackrabbit-filevault] mreutegg merged pull request #250: JCRVLT-662: JcrPackageRegistry.remove() leaks temp file

Posted by GitBox <gi...@apache.org>.
mreutegg merged PR #250:
URL: https://github.com/apache/jackrabbit-filevault/pull/250


-- 
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


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

Posted by GitBox <gi...@apache.org>.
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


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

Posted by GitBox <gi...@apache.org>.
mreutegg commented on code in PR #250:
URL: https://github.com/apache/jackrabbit-filevault/pull/250#discussion_r991868319


##########
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:
   Ah, missed that one. Though, it seems it is not necessary in this case. Closing `JcrRegisteredPackage` already closes the `JcrPackage` it holds.



-- 
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