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

Prevent false positive of javac -parameters #718

Merged
merged 1 commit into from
Jul 4, 2024
Merged

Prevent false positive of javac -parameters #718

merged 1 commit into from
Jul 4, 2024

Conversation

geoand
Copy link
Collaborator

@geoand geoand commented Jul 4, 2024

This could happen before when there were no template params

This could happen before when there were no template params
@geoand geoand requested a review from a team as a code owner July 4, 2024 07:56
@geoand geoand requested a review from jmartisk July 4, 2024 07:56
@@ -947,7 +947,7 @@ private List<TemplateParameterInfo> gatherTemplateParamInfo(List<MethodParameter
templateParams.add(new TemplateParameterInfo(0, "it"));
}

if (templateParams.stream().map(TemplateParameterInfo::name).allMatch(Objects::isNull)) {
if (!templateParams.isEmpty() && templateParams.stream().map(TemplateParameterInfo::name).allMatch(Objects::isNull)) {
Copy link
Collaborator Author

@geoand geoand Jul 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Javadoc of allMatch says it returns true when the stream is empty. I never knew that and I find it odd, but 🤷🏼‍♂️

@geoand geoand merged commit a99719b into main Jul 4, 2024
12 checks passed
@geoand geoand deleted the params branch July 4, 2024 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant