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

Avoid storing duplicate empty array in MethodParameter field #33496

Closed
Closed
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
Expand Up @@ -647,7 +647,7 @@ public Annotation[] getParameterAnnotations() {
// for inner classes, so access it with the actual parameter index lowered by 1
index = this.parameterIndex - 1;
}
paramAnns = (index >= 0 && index < annotationArray.length ?
paramAnns = (index >= 0 && index < annotationArray.length && annotationArray[index].length > 0 ?
sdeleuze marked this conversation as resolved.
Show resolved Hide resolved
adaptAnnotationArray(annotationArray[index]) : EMPTY_ANNOTATION_ARRAY);
this.parameterAnnotations = paramAnns;
}
Expand Down Expand Up @@ -916,7 +916,7 @@ public Annotation[] getParameterAnnotations() {
merged.add(fieldAnn);
}
}
anns = merged.toArray(new Annotation[0]);
anns = merged.toArray(EMPTY_ANNOTATION_ARRAY);
}
}
catch (NoSuchFieldException | SecurityException ex) {
Expand Down