Skip to content

Commit

Permalink
Never register server specific providers in REST Client
Browse files Browse the repository at this point in the history
  • Loading branch information
geoand authored and iocanel committed Feb 14, 2023
1 parent 7368562 commit b46e261
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 b46e261

Please sign in to comment.