You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2022/08/12 17:44:17 UTC

[GitHub] [commons-bcel] mernst opened a new pull request, #138: Close resources

mernst opened a new pull request, #138:
URL: https://github.com/apache/commons-bcel/pull/138

   BCEL sometimes fails to close a resource.  This can lead to degraded performance, especially on long runs (eg, when being run by a server/daemon or when running on a large amount of code).
   
   This pull request ensures that the resources are closed, even if an exception is thrown.
   
   The diffs look large, but they are mostly indentation changes.


-- 
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: issues-unsubscribe@commons.apache.org

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


[GitHub] [commons-bcel] codecov-commenter commented on pull request #138: Close resources

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #138:
URL: https://github.com/apache/commons-bcel/pull/138#issuecomment-1213363389

   # [Codecov](https://codecov.io/gh/apache/commons-bcel/pull/138?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#138](https://codecov.io/gh/apache/commons-bcel/pull/138?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (8f1aec2) into [master](https://codecov.io/gh/apache/commons-bcel/commit/f58d0783e60d083da1748716267e352895705c8b?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f58d078) will **increase** coverage by `0.01%`.
   > The diff coverage is `90.90%`.
   
   ```diff
   @@             Coverage Diff              @@
   ##             master     #138      +/-   ##
   ============================================
   + Coverage     44.08%   44.09%   +0.01%     
   - Complexity     2521     2522       +1     
   ============================================
     Files           362      362              
     Lines         16322    16321       -1     
     Branches       2126     2126              
   ============================================
   + Hits           7195     7197       +2     
   + Misses         8398     8396       -2     
   + Partials        729      728       -1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/commons-bcel/pull/138?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [src/main/java/org/apache/bcel/Repository.java](https://codecov.io/gh/apache/commons-bcel/pull/138/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2JjZWwvUmVwb3NpdG9yeS5qYXZh) | `14.28% <0.00%> (ø)` | |
   | [.../main/java/org/apache/bcel/util/AttributeHTML.java](https://codecov.io/gh/apache/commons-bcel/pull/138/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2JjZWwvdXRpbC9BdHRyaWJ1dGVIVE1MLmphdmE=) | `56.38% <ø> (ø)` | |
   | [src/main/java/org/apache/bcel/util/MethodHTML.java](https://codecov.io/gh/apache/commons-bcel/pull/138/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2JjZWwvdXRpbC9NZXRob2RIVE1MLmphdmE=) | `56.06% <85.71%> (ø)` | |
   | [...c/main/java/org/apache/bcel/util/ConstantHTML.java](https://codecov.io/gh/apache/commons-bcel/pull/138/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2JjZWwvdXRpbC9Db25zdGFudEhUTUwuamF2YQ==) | `95.04% <93.75%> (ø)` | |
   | [src/main/java/org/apache/bcel/util/Class2HTML.java](https://codecov.io/gh/apache/commons-bcel/pull/138/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2JjZWwvdXRpbC9DbGFzczJIVE1MLmphdmE=) | `53.19% <100.00%> (-0.50%)` | :arrow_down: |
   | [src/main/java/org/apache/bcel/util/CodeHTML.java](https://codecov.io/gh/apache/commons-bcel/pull/138/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2JjZWwvdXRpbC9Db2RlSFRNTC5qYXZh) | `50.17% <100.00%> (ø)` | |
   | [src/main/java/org/apache/bcel/util/ClassPath.java](https://codecov.io/gh/apache/commons-bcel/pull/138/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2JjZWwvdXRpbC9DbGFzc1BhdGguamF2YQ==) | `42.63% <0.00%> (+1.16%)` | :arrow_up: |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
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: issues-unsubscribe@commons.apache.org

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


[GitHub] [commons-bcel] garydgregory commented on a diff in pull request #138: Close resources

Posted by GitBox <gi...@apache.org>.
garydgregory commented on code in PR #138:
URL: https://github.com/apache/commons-bcel/pull/138#discussion_r945131094


##########
src/test/java/org/apache/bcel/AbstractTestCase.java:
##########
@@ -63,9 +64,12 @@ public AnnotationEntryGen createFruitAnnotationEntry(final ConstantPoolGen cp,
 
     public SyntheticRepository createRepos(final String cpentry)
     {
-        final ClassPath cp = new ClassPath("target" + File.separator + "testdata"
-                + File.separator + cpentry + File.separator);
-        return SyntheticRepository.getInstance(cp);
+        try (ClassPath cp = new ClassPath("target" + File.separator + "testdata"
+                + File.separator + cpentry + File.separator)) {
+            return SyntheticRepository.getInstance(cp);
+        } catch (IOException e) {
+            throw new Error(e);

Review Comment:
   This feels nasty IMO, why not use an `UncheckedIOException` here instead of an `Error`?



-- 
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: issues-unsubscribe@commons.apache.org

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


[GitHub] [commons-bcel] garydgregory merged pull request #138: Close resources

Posted by GitBox <gi...@apache.org>.
garydgregory merged PR #138:
URL: https://github.com/apache/commons-bcel/pull/138


-- 
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: issues-unsubscribe@commons.apache.org

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


[GitHub] [commons-bcel] mernst commented on a diff in pull request #138: Close resources

Posted by GitBox <gi...@apache.org>.
mernst commented on code in PR #138:
URL: https://github.com/apache/commons-bcel/pull/138#discussion_r945153126


##########
src/test/java/org/apache/bcel/AbstractTestCase.java:
##########
@@ -63,9 +64,12 @@ public AnnotationEntryGen createFruitAnnotationEntry(final ConstantPoolGen cp,
 
     public SyntheticRepository createRepos(final String cpentry)
     {
-        final ClassPath cp = new ClassPath("target" + File.separator + "testdata"
-                + File.separator + cpentry + File.separator);
-        return SyntheticRepository.getInstance(cp);
+        try (ClassPath cp = new ClassPath("target" + File.separator + "testdata"
+                + File.separator + cpentry + File.separator)) {
+            return SyntheticRepository.getInstance(cp);
+        } catch (IOException e) {
+            throw new Error(e);

Review Comment:
   Good idea.  I have done that.



-- 
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: issues-unsubscribe@commons.apache.org

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