Repository navigation
[RESTEASY-3621] Resource methods inherited from package-private class not registered - #4834
Merged
Merged
Conversation
jamezp
requested changes
Apr 9, 2026
Member
There was a problem hiding this comment.
With the removal of setting methods to be accessible, we need to add something like this:
protected void processMethod(boolean isLocator, ResourceClassBuilder resourceClassBuilder, Class<?> root,
Method implementation) {
processMethod(resourceClassBuilder, root, implementation, implementation);
}
/**
* Process the resource method to configure the builder.
*
* @param resourceClassBuilder the builder to configure
* @param root the root resource class
* @param implementation the method to be invoked (may be a bridge method)
* @param annotatedMethod the method containing Jakarta REST annotations (may be in a superclass)
*/
private void processMethod(final ResourceClassBuilder resourceClassBuilder, final Class<?> root,
final Method implementation, final Method annotatedMethod) {
Method method = getAnnotatedMethod(root, annotatedMethod);
if (method != null) {
Set<String> httpMethods = getHttpMethods(method);
ResourceLocatorBuilder<?> resourceLocatorBuilder;
if (httpMethods == null) {
resourceLocatorBuilder = resourceClassBuilder.locator(implementation, method);
} else {
ResourceMethodBuilder resourceMethodBuilder = resourceClassBuilder.method(implementation, method);
resourceLocatorBuilder = resourceMethodBuilder;
for (String httpMethod : httpMethods) {
if (httpMethod.equalsIgnoreCase(HttpMethod.GET))
resourceMethodBuilder.get();
else if (httpMethod.equalsIgnoreCase(HttpMethod.PUT))
resourceMethodBuilder.put();
else if (httpMethod.equalsIgnoreCase(HttpMethod.POST))
resourceMethodBuilder.post();
else if (httpMethod.equalsIgnoreCase(HttpMethod.DELETE))
resourceMethodBuilder.delete();
else if (httpMethod.equalsIgnoreCase(HttpMethod.OPTIONS))
resourceMethodBuilder.options();
else if (httpMethod.equalsIgnoreCase(HttpMethod.HEAD))
resourceMethodBuilder.head();
else
resourceMethodBuilder.httpMethod(httpMethod);
}
Produces produces = method.getAnnotation(Produces.class);
if (produces == null)
produces = resourceClassBuilder.resourceClass.getClazz().getAnnotation(Produces.class);
if (produces == null)
produces = method.getDeclaringClass().getAnnotation(Produces.class);
if (produces != null)
resourceMethodBuilder.produces(produces.value());
Consumes consumes = method.getAnnotation(Consumes.class);
if (consumes == null)
consumes = resourceClassBuilder.resourceClass.getClazz().getAnnotation(Consumes.class);
if (consumes == null)
consumes = method.getDeclaringClass().getAnnotation(Consumes.class);
if (consumes != null)
resourceMethodBuilder.consumes(consumes.value());
}
Path methodPath = method.getAnnotation(Path.class);
if (methodPath != null)
resourceLocatorBuilder.path(methodPath.value());
for (int i = 0; i < resourceLocatorBuilder.locator.params.length; i++) {
resourceLocatorBuilder.param(i).fromAnnotations();
}
resourceLocatorBuilder.buildMethod();
}
}Note this same thing will need to be done to the 6.2 variant too.
| locator.fullpath = pathExpression; | ||
| if (locator.resourceClass.getClazz().isAnonymousClass()) { | ||
| if (locator.resourceClass.getClazz().isAnonymousClass() | ||
| || !Modifier.isPublic(locator.getMethod().getDeclaringClass().getModifiers())) { |
Member
There was a problem hiding this comment.
| method.fullpath = pathExpression; | ||
| if (method.resourceClass.getClazz().isAnonymousClass()) { | ||
| if (method.resourceClass.getClazz().isAnonymousClass() | ||
| || !Modifier.isPublic(method.getMethod().getDeclaringClass().getModifiers())) { |
Member
There was a problem hiding this comment.
jamezp
reviewed
Apr 9, 2026
Member
|
@g-tom do we have permissions to include your tests from Intevation@5464294? |
jamezp
requested changes
May 4, 2026
jamezp
left a comment
Member
There was a problem hiding this comment.
Can you squash the commits down to a single commit please?
Of course you have. Thanks for the work on the issue! |
…te class not registered remove unnecessary resource class [RESTEASY-3621] Resolve PR comments [RESTEASY-3621] Skip bridge methods that have a non-synthetic counterpart in the declaring class
christosderetzis
force-pushed
the
RESTEASY-3621
branch
from
May 5, 2026 08:23
333c664 to
ec510ae
Compare
Author
@jamezp Done, i did the same for 6.2 PR |
jamezp
approved these changes
May 5, 2026
Signed-off-by: James R. Perkins <[email protected]>
Member
|
Thank you @g-tom and @christosderetzis |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: https://redhat.atlassian.net/browse/RESTEASY-3621