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

Fix unnamed main method detection #6593

Merged
merged 1 commit into from Oct 23, 2023

Conversation

mbien
Copy link
Member

@mbien mbien commented Oct 19, 2023

Code gave wrong results when other methods were nearby.

Code gave wrong results when other methods were nearby.
@mbien mbien added Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) hints ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) labels Oct 19, 2023
@mbien mbien added this to the NB20 milestone Oct 19, 2023
@@ -1085,22 +1090,15 @@ private static boolean mainCandidate(ExecutableElement method) {
return true;
}

// 0 is highest
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for adding this comment! I just spent a couple of minutes looking at your loop wondering why the check was that way around. 😆

Copy link
Member Author

Choose a reason for hiding this comment

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

I actually rewrote it at first since I thought that was the actual bug! Then I left the comment for the next brave dev who reads the code :)

Copy link
Contributor

@lahodaj lahodaj left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@neilcsmith-net neilcsmith-net merged commit 40a9bb6 into apache:delivery Oct 23, 2023
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) hints Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants