Skip to content

Commit c43b2b8

Browse files
committed
suppress forbidden
1 parent 5ad1906 commit c43b2b8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

libs/entitlement/qa/entitlement-test-plugin/src/main/java/org/elasticsearch/entitlement/qa/test/RestEntitlementsCheckAction.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434

3535
import java.io.IOException;
3636
import java.lang.reflect.InvocationTargetException;
37+
import java.lang.reflect.Method;
3738
import java.lang.reflect.Modifier;
3839
import java.net.DatagramPacket;
3940
import java.net.DatagramSocket;
@@ -234,9 +235,14 @@ static CheckAction alwaysDenied(CheckedRunnable<Exception> action) {
234235
.filter(entry -> entry.getValue().fromJavaVersion() == null || Runtime.version().feature() >= entry.getValue().fromJavaVersion())
235236
.collect(Collectors.toUnmodifiableMap(Entry::getKey, Entry::getValue));
236237

238+
@SuppressForbidden(reason = "Need package private methods so we don't have to make them all public")
239+
private static Method[] getDeclaredMethods(Class<?> clazz) {
240+
return clazz.getDeclaredMethods();
241+
}
242+
237243
private static Stream<Entry<String, CheckAction>> getTestEntries(Class<?> actionsClass) {
238244
List<Entry<String, CheckAction>> entries = new ArrayList<>();
239-
for (var method : actionsClass.getDeclaredMethods()) {
245+
for (var method : getDeclaredMethods(actionsClass)) {
240246
var testAnnotation = method.getAnnotation(EntitlementTest.class);
241247
if (testAnnotation == null) {
242248
continue;

0 commit comments

Comments
 (0)