Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Dotname instead of Type to determine @BeanParam class target #14356

Merged
merged 1 commit into from
Jan 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.quarkus.resteasy.reactive.server.test.simple;

import javax.validation.constraints.NotNull;
import javax.ws.rs.BeanParam;
import javax.ws.rs.GET;
import javax.ws.rs.HeaderParam;
Expand Down Expand Up @@ -45,7 +46,7 @@ private void checkInjections(String path, String query, String header, UriInfo u
public String param(@QueryParam("query") String query,
@HeaderParam("header") String header,
@Context UriInfo uriInfo,
@BeanParam BeanParamSubClass beanParam) {
@BeanParam @NotNull BeanParamSubClass beanParam) {
checkInjections("/injection-subclass/param2", query, header, uriInfo, this.beanParam, query, uriInfo, beanParam);
return "OK";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,17 @@ public static ResourceScanningResult scanResources(
// FIXME: this isn't right wrt generics
switch (target.kind()) {
case FIELD:
beanParams.add(target.asField().type().toString());
beanParams.add(target.asField().type().name().toString());
break;
case METHOD:
Type setterParamType = target.asMethod().parameters().get(0);
beanParams.add(setterParamType.toString());
beanParams.add(setterParamType.name().toString());
break;
case METHOD_PARAMETER:
MethodInfo method = target.asMethodParameter().method();
int paramIndex = target.asMethodParameter().position();
Type paramType = method.parameters().get(paramIndex);
beanParams.add(paramType.toString());
beanParams.add(paramType.name().toString());
break;
default:
break;
Expand Down