Skip to content

Commit

Permalink
Merge pull request quarkusio#31026 from geoand/quarkusio#31024
Browse files Browse the repository at this point in the history
Never register server specific providers in REST Client
  • Loading branch information
geoand authored Feb 10, 2023
2 parents a57e936 + 0c8e2bb commit 6d70481
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -293,18 +293,25 @@ void registerProvidersFromAnnotations(CombinedIndexBuildItem indexBuildItem,
continue;
}
}
DotName providerDotName = providerClass.name();
// don't register server specific types
if (providerDotName.equals(ResteasyReactiveDotNames.CONTAINER_REQUEST_FILTER)
|| providerDotName.equals(ResteasyReactiveDotNames.CONTAINER_RESPONSE_FILTER)
|| providerDotName.equals(ResteasyReactiveDotNames.EXCEPTION_MAPPER)) {
continue;
}

if (providerClass.interfaceNames().contains(ResteasyReactiveDotNames.FEATURE)) {
continue; // features should not be automatically registered for the client, see javadoc for Feature
}

int priority = getAnnotatedPriority(index, providerClass.name().toString(), Priorities.USER);
int priority = getAnnotatedPriority(index, providerDotName.toString(), Priorities.USER);

constructor.invokeVirtualMethod(
MethodDescriptor.ofMethod(AnnotationRegisteredProviders.class, "addGlobalProvider",
void.class, Class.class,
int.class),
constructor.getThis(), constructor.loadClassFromTCCL(providerClass.name().toString()),
constructor.getThis(), constructor.loadClassFromTCCL(providerDotName.toString()),
constructor.load(priority));
}
}
Expand Down

0 comments on commit 6d70481

Please sign in to comment.