You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "uschindler (via GitHub)" <gi...@apache.org> on 2026/09/20 22:28:08 UTC

[PR] Fix forbidden catch block (new feat in forbiddenapis 3.11) [lucene]

uschindler opened a new pull request, #16695:
URL: https://github.com/apache/lucene/pull/16695

   In branch_10x the update of forbiddenapis to 3.11 (see #16694) caused a new failure:
   
   ```
   > Task :lucene:core:forbiddenApisMain FAILED
   Forbidden exception use: java.security.AccessControlException [Deprecated in Java 21]
     in org.apache.lucene.util.RamUsageEstimator (RamUsageEstimator.java, catch in method body of 'shallowSizeOfInstance(java.lang.Class)')
   Scanned 2688 class file(s) for forbidden API invocations (in 9.45s), 1 error(s).
   ```
   
   The reason for this is a bugfix in forbiddenapis. The previous version did not detect usages of types in catch blocks. Now it does. The `AccessControlException` is deprecated in Java and therefor reported as violation.
   
   This PR simply remove the whole catch block as `AccessControlException` extends `RuntimeException` anyways so wrapping is not needed.


-- 
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@lucene.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Fix forbidden catch block (new feat in forbiddenapis 3.11) [lucene]

Posted by "uschindler (via GitHub)" <gi...@apache.org>.
uschindler commented on PR #16695:
URL: https://github.com/apache/lucene/pull/16695#issuecomment-5757352986

   The try-catch was added long ago during a completely unrelated change. I think @dweiss (who did the commit) wanted to debug something and wanted to get a better exception message. But as neither RuntimeException nor SecurityException/ACcessControlException was added to throws cause, the additional information by a more generic exception is not really valuable. When user gets an AccessControlException, one knows that its with policy files.
   
   So I think this change is harmless, the exception type does not matter. And in main branch it is gone alltogether.


-- 
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@lucene.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Fix forbidden catch block (new feat in forbiddenapis 3.11) [lucene]

Posted by "uschindler (via GitHub)" <gi...@apache.org>.
uschindler merged PR #16695:
URL: https://github.com/apache/lucene/pull/16695


-- 
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@lucene.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Fix forbidden catch block (new feat in forbiddenapis 3.11) [lucene]

Posted by "uschindler (via GitHub)" <gi...@apache.org>.
uschindler commented on PR #16695:
URL: https://github.com/apache/lucene/pull/16695#issuecomment-5757359677

   Will merge now to silence Jenkins.


-- 
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@lucene.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org