Skip to content

Commit

Permalink
A little speedup for a single parameter annotation
Browse files Browse the repository at this point in the history
Signed-off-by: jansupol <jan.supol@oracle.com>
  • Loading branch information
jansupol committed May 3, 2024
1 parent bc4d50e commit 0ca5ae4
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,9 @@ public FormDataParamValueProvider(Parameter parameter, MultivaluedParameterExtra
@Override
public Object apply(ContainerRequest request) {
// Return the field value for the field specified by the sourceName property.
final String sourceName = Arrays.stream(parameter.getAnnotations())
final String sourceName = parameter.getAnnotations().length == 1
? parameter.getSourceName()
: Arrays.stream(parameter.getAnnotations())
.filter(ann -> FormDataParam.class.isInstance(ann))
.map(ann -> FormDataParam.class.cast(ann))
.findFirst().get().value();
Expand Down

0 comments on commit 0ca5ae4

Please sign in to comment.