You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by us...@apache.org on 2026/09/21 08:09:09 UTC
(lucene) branch branch_10x updated: Fix forbidden catch block (new feat in forbiddenapis 3.11) (#16695)
This is an automated email from the ASF dual-hosted git repository.
uschindler pushed a commit to branch branch_10x
in repository https://gitbox.apache.org/repos/asf/lucene.git
The following commit(s) were added to refs/heads/branch_10x by this push:
new 813c0ac6522 Fix forbidden catch block (new feat in forbiddenapis 3.11) (#16695)
813c0ac6522 is described below
commit 813c0ac6522e17a7f9cd0a2a0b9d87a5554371f9
Author: Uwe Schindler <us...@apache.org>
AuthorDate: Mon Sep 21 10:09:02 2026 +0200
Fix forbidden catch block (new feat in forbiddenapis 3.11) (#16695)
---
.../src/java/org/apache/lucene/util/RamUsageEstimator.java | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/lucene/core/src/java/org/apache/lucene/util/RamUsageEstimator.java b/lucene/core/src/java/org/apache/lucene/util/RamUsageEstimator.java
index 2710b0f4e23..963df860c5b 100644
--- a/lucene/core/src/java/org/apache/lucene/util/RamUsageEstimator.java
+++ b/lucene/core/src/java/org/apache/lucene/util/RamUsageEstimator.java
@@ -19,7 +19,6 @@ package org.apache.lucene.util;
import java.lang.reflect.Array;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
-import java.security.AccessControlException;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.text.DecimalFormat;
@@ -545,15 +544,7 @@ public final class RamUsageEstimator {
// Walk type hierarchy
for (; clazz != null; clazz = clazz.getSuperclass()) {
final Class<?> target = clazz;
- final Field[] fields;
- try {
- fields = doPrivileged((PrivilegedAction<Field[]>) target::getDeclaredFields);
- } catch (
- @SuppressWarnings("removal")
- AccessControlException e) {
- throw new RuntimeException("Can't access fields of class: " + target, e);
- }
-
+ final Field[] fields = doPrivileged((PrivilegedAction<Field[]>) target::getDeclaredFields);
for (Field f : fields) {
if (!Modifier.isStatic(f.getModifiers())) {
size = adjustForField(size, f);