Repository: quarkusio/quarkus
Issue: Native build fails with hibernate-orm-rest-data-panache + elytron-security-properties-file

### Describe the bug

Combination of `hibernate-orm-rest-data-panache` and `elytron-security-properties-file`, together with a panache resource with a class annotation from `javax.annotation.security` cause native build to fail.
```java
package org.acme;

import io.quarkus.hibernate.orm.rest.data.panache.PanacheEntityResource;

import javax.annotation.security.DenyAll;

@DenyAll
public interface MyResource extends PanacheEntityResource<MyEntity, Long> {
}
```

This can be reproduced for any Quarkus newer than `2.14.3.Final`.

### Expected behavior

Native build succeeds.

### Actual behavior

```
Fatal error: com.oracle.graal.pointsto.util.AnalysisError$ParsingError: Error encountered while parsing org.acme.MyResourceJaxRs_ab15c77efe36959f9555ec5aecafdc237bba9ef3_Subclass.count$$superforward1() 
Parsing context:
   at org.acme.MyResourceJaxRs_ab15c77efe36959f9555ec5aecafdc237bba9ef3_Subclass.count$$superforward1(Unknown Source)
   at org.acme.MyResourceJaxRs_ab15c77efe36959f9555ec5aecafdc237bba9ef3_Subclass$$function$$12.apply(Unknown Source)
   at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
   at java.util.Spliterators$IteratorSpliterator.tryAdvance(Spliterators.java:1932)
   at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129)
   at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527)
   at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513)
   at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
   at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
   at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
   at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
   at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
   at java.lang.reflect.Executable.sharedToString(Executable.java:122)
   at java.lang.reflect.Constructor.toString(Constructor.java:358)
   at java.lang.String.valueOf(String.java:4225)
   at com.oracle.svm.core.jdk.localization.substitutions.Target_java_util_Locale.initDefault(Target_java_util_Locale.java:52)
   at java.util.Locale.getDisplayLocale(Locale.java:1039)
   at java.util.Locale.getDefault(Locale.java:1023)
   at java.util.Formatter.<init>(Formatter.java:2095)
   at java.lang.String.format(String.java:4150)
   at jdk.internal.util.Preconditions.outOfBoundsMessage(Preconditions.java:245)
   at jdk.internal.util.Preconditions$4.apply(Preconditions.java:213)
   at jdk.internal.util.Preconditions$4.apply(Preconditions.java:210)
   at jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:98)
   at jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:106)
   at jdk.internal.util.Preconditions.checkIndex(Preconditions.java:302)
   at java.lang.String.checkIndex(String.java:4570)

...

Caused by: org.graalvm.compiler.java.BytecodeParser$BytecodeParserError: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved method during parsing: org.acme.MyResourceJaxRs_ab15c77efe36959f9555ec5aecafdc237bba9ef3.count(). This error is reported at image build time because class org.acme.MyResourceJaxRs_ab15c77efe36959f9555ec5aecafdc237bba9ef3_Subclass is registered for linking at image build time by command line
	at parsing org.acme.MyResourceJaxRs_ab15c77efe36959f9555ec5aecafdc237bba9ef3_Subclass.count$$superforward1(Unknown Source)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.throwParserError(BytecodeParser.java:2518)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.throwParserError(SharedGraphBuilderPhase.java:110)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3393)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.handleBytecodeBlock(BytecodeParser.java:3345)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBlock(BytecodeParser.java:3190)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.build(BytecodeParser.java:1138)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.buildRootMethod(BytecodeParser.java:1030)
	at jdk.internal.vm.compiler/org.graalvm.compiler.java.GraphBuilderPhase$Instance.run(GraphBuilderPhase.java:97)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase.run(SharedGraphBuilderPhase.java:84)
	at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.run(Phase.java:49)
	at jdk.internal.vm.compiler/org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:446)
	at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:42)
	at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:38)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.AnalysisParsedGraph.parseBytecode(AnalysisParsedGraph.java:135)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisMethod.ensureGraphParsed(AnalysisMethod.java:685)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.parse(MethodTypeFlowBuilder.java:171)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.apply(MethodTypeFlowBuilder.java:349)
	at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.createFlowsGraph(MethodTypeFlow.java:93)

```

### How to Reproduce?

```
git clone git@github.com:jsmrcka/orm-rest-data-panache-security-native-reproducer.git
mvn -f ./orm-rest-data-panache-security-native-reproducer clean package -Dnative
```

### Output of `uname -a` or `ver`

Linux ... 6.0.15-300.fc37.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Dec 21 18:33:23 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

### Output of `java -version`

openjdk version "11.0.12" 2021-07-20

### GraalVM version (if different from Java)

GraalVM 22.3.0 Java 19 CE (Java Version 19.0.1+10-jvmci-22.3-b08)

### Quarkus version or git rev

2.15.0.CR1+, 999-SNAPSHOT

### Build tool (ie. output of `mvnw --version` or `gradlew --version`)

3.8.6

### Additional information

_No response_

Changed files:
extensions/panache/rest-data-panache/runtime/src/main/java/io/quarkus/rest/data/panache/RestDataResource.java
extensions/panache/rest-data-panache/runtime/src/main/java/io/quarkus/rest/data/panache/ReactiveRestDataResource.java

diff --git a/extensions/panache/rest-data-panache/runtime/src/main/java/io/quarkus/rest/data/panache/ReactiveRestDataResource.java b/extensions/panache/rest-data-panache/runtime/src/main/java/io/quarkus/rest/data/panache/ReactiveRestDataResource.java
index dc6ef6f5d2e..7ce9d26ea47 100644
--- a/extensions/panache/rest-data-panache/runtime/src/main/java/io/quarkus/rest/data/panache/ReactiveRestDataResource.java
+++ b/extensions/panache/rest-data-panache/runtime/src/main/java/io/quarkus/rest/data/panache/ReactiveRestDataResource.java
@@ -26,12 +26,16 @@
      * @param sort Panache sort instance that should be used in a query.
      * @return A response with an entities JSON array.
      */
-    Uni<List<Entity>> list(Page page, Sort sort);
+    default Uni<List<Entity>> list(Page page, Sort sort) {
+        throw new RuntimeException("Not implemented yet");
+    }
 
     /**
      * @return the total number of entities.
      */
-    Uni<Long> count();
+    default Uni<Long> count() {
+        throw new RuntimeException("Not implemented yet");
+    }
 
     /**
      * Return an entity as a JSON object.
@@ -40,7 +44,9 @@
      * @param id Entity identifier.
      * @return A response with a JSON object representing an entity.
      */
-    Uni<Entity> get(ID id);
+    default Uni<Entity> get(ID id) {
+        throw new RuntimeException("Not implemented yet");
+    }
 
     /**
      * Create a new entity from the provided JSON object.
@@ -50,7 +56,9 @@
      * @param entity Entity to be created
      * @return A response with a JSON object representing an entity and a location header of the new entity.
      */
-    Uni<Entity> add(Entity entity);
+    default Uni<Entity> add(Entity entity) {
+        throw new RuntimeException("Not implemented yet");
+    }
 
     /**
      * Update an existing entity or create a new one from the provided JSON object.
@@ -62,7 +70,9 @@
      * @return A response with no-content status in case of the update.
      *         A response with a JSON object representing an entity and a location header in case of the create.
      */
-    Uni<Entity> update(ID id, Entity entity);
+    default Uni<Entity> update(ID id, Entity entity) {
+        throw new RuntimeException("Not implemented yet");
+    }
 
     /**
      * Delete an entity.
@@ -70,5 +80,7 @@
      * @param id Entity identifier.
      * @return A boolean indicated whether the entity was deleted or not.
      */
-    Uni<Boolean> delete(ID id);
+    default Uni<Boolean> delete(ID id) {
+        throw new RuntimeException("Not implemented yet");
+    }
 }
diff --git a/extensions/panache/rest-data-panache/runtime/src/main/java/io/quarkus/rest/data/panache/RestDataResource.java b/extensions/panache/rest-data-panache/runtime/src/main/java/io/quarkus/rest/data/panache/RestDataResource.java
index 2d86466166f..fe664c74700 100644
--- a/extensions/panache/rest-data-panache/runtime/src/main/java/io/quarkus/rest/data/panache/RestDataResource.java
+++ b/extensions/panache/rest-data-panache/runtime/src/main/java/io/quarkus/rest/data/panache/RestDataResource.java
@@ -25,12 +25,16 @@
      * @param sort Panache sort instance that should be used in a query.
      * @return A response with an entities JSON array.
      */
-    List<Entity> list(Page page, Sort sort);
+    default List<Entity> list(Page page, Sort sort) {
+        throw new RuntimeException("Not implemented yet");
+    }
 
     /**
      * @return the total number of entities.
      */
-    long count();
+    default long count() {
+        throw new RuntimeException("Not implemented yet");
+    }
 
     /**
      * Return an entity as a JSON object.
@@ -39,7 +43,9 @@
      * @param id Entity identifier.
      * @return A response with a JSON object representing an entity.
      */
-    Entity get(ID id);
+    default Entity get(ID id) {
+        throw new RuntimeException("Not implemented yet");
+    }
 
     /**
      * Create a new entity from the provided JSON object.
@@ -49,7 +55,9 @@
      * @param entity Entity to be created
      * @return A response with a JSON object representing an entity and a location header of the new entity.
      */
-    Entity add(Entity entity);
+    default Entity add(Entity entity) {
+        throw new RuntimeException("Not implemented yet");
+    }
 
     /**
      * Update an existing entity or create a new one from the provided JSON object.
@@ -61,7 +69,9 @@
      * @return A response with no-content status in case of the update.
      *         A response with a JSON object representing an entity and a location header in case of the create.
      */
-    Entity update(ID id, Entity entity);
+    default Entity update(ID id, Entity entity) {
+        throw new RuntimeException("Not implemented yet");
+    }
 
     /**
      * Delete an entity.
@@ -69,5 +79,7 @@
      * @param id Entity identifier.
      * @return A boolean indicated whether the entity was deleted or not.
      */
-    boolean delete(ID id);
+    default boolean delete(ID id) {
+        throw new RuntimeException("Not implemented yet");
+    }
 }