Skip to content

Commit

Permalink
Ignore abstract jakarta.ws.rs.core.Application classes
Browse files Browse the repository at this point in the history
  • Loading branch information
geoand committed Jun 26, 2024
1 parent 6a78f49 commit 26da21a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,9 @@ public void build(
jaxrsProvidersToRegisterBuildItem = getFilteredJaxrsProvidersToRegisterBuildItem(
jaxrsProvidersToRegisterBuildItem, allowedClasses, excludedClasses);

Collection<ClassInfo> knownApplications = index.getAllKnownSubclasses(ResteasyDotNames.APPLICATION);
Collection<ClassInfo> knownApplications = index.getAllKnownSubclasses(ResteasyDotNames.APPLICATION).stream()
.filter(ci -> !ci.isAbstract()).collect(
Collectors.toSet());
// getAllowedClasses throws an Exception if multiple Applications are found, so we should only get 1
if (knownApplications.size() == 1) {
appClass = knownApplications.iterator().next().name().toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ApplicationTest {
ResponseFilter1.class, ResponseFilter2.class,
ResponseFilter3.class, ResponseFilter4.class, ResponseFilter5.class, ResponseFilter6.class,
Feature1.class, Feature2.class, DynamicFeature1.class, DynamicFeature2.class,
ExceptionMapper1.class, ExceptionMapper2.class, AppTest.class));
ExceptionMapper1.class, ExceptionMapper2.class, AppTest.class, AppTest2.class));

@DisplayName("Should access to ok of resource 1 and provide a response with the expected headers")
@Test
Expand Down Expand Up @@ -309,4 +309,8 @@ public Set<Object> getSingletons() {
new ResponseFilter1(), new DynamicFeature1()));
}
}

public static abstract class AppTest2 extends Application {

}
}

0 comments on commit 26da21a

Please sign in to comment.