Skip to content

SONARJAVA-6093 Implement S3051 checking the signature of the main method.#5442

Open
tomasz-tylenda-sonarsource wants to merge 2 commits intomasterfrom
tt/SONARJAVA-6093_S3051_add_j25_main_signatures
Open

SONARJAVA-6093 Implement S3051 checking the signature of the main method.#5442
tomasz-tylenda-sonarsource wants to merge 2 commits intomasterfrom
tt/SONARJAVA-6093_S3051_add_j25_main_signatures

Conversation

@tomasz-tylenda-sonarsource
Copy link
Contributor

No description provided.

@hashicorp-vault-sonar-prod
Copy link

hashicorp-vault-sonar-prod bot commented Feb 5, 2026

SONARJAVA-6093

@tomasz-tylenda-sonarsource tomasz-tylenda-sonarsource force-pushed the tt/SONARJAVA-6093_S3051_add_j25_main_signatures branch 3 times, most recently from e8d2324 to e65c0da Compare February 6, 2026 12:55
@tomasz-tylenda-sonarsource tomasz-tylenda-sonarsource marked this pull request as ready for review February 6, 2026 13:18
@tomasz-tylenda-sonarsource tomasz-tylenda-sonarsource force-pushed the tt/SONARJAVA-6093_S3051_add_j25_main_signatures branch 3 times, most recently from 9984aa4 to 3b02f00 Compare February 11, 2026 12:23
@tomasz-tylenda-sonarsource tomasz-tylenda-sonarsource force-pushed the tt/SONARJAVA-6093_S3051_add_j25_main_signatures branch from 3b02f00 to fbeb1d9 Compare February 11, 2026 12:56
@sonarqube-next
Copy link

Copy link
Contributor

@rombirli rombirli left a comment

Choose a reason for hiding this comment

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

LGTM, good catch to test the records enums and interfaces

public class MainJava21 {
public static void main(String[] args) { // Compliant
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Could we verify a non-compliant main(int args) signature against Java 21? Just to ensure we dont break anything on this side

@@ -0,0 +1,35 @@
<h2>Why is this an issue?</h2>
<p>"A rose by any other name would smell as sweet," but <code>main</code> by any other name would not. Just because a method has the name "main", that
Copy link
Contributor

Choose a reason for hiding this comment

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

I like this creative description

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.

2 participants