Skip to content

fix: non-public main detection (JEP 512) - #4430

Merged
Gedochao merged 1 commit into
VirtusLab:mainfrom
warcholjakub:fix/non-public-main-detection
Aug 18, 2026
Merged

fix: non-public main detection (JEP 512)#4430
Gedochao merged 1 commit into
VirtusLab:mainfrom
warcholjakub:fix/non-public-main-detection

Conversation

@warcholjakub

Copy link
Copy Markdown
Collaborator

Fixes a case where:

public class Test {
  protected static void main(String[] args) {
    System.out.println("hello");
  }
}

would be classified as a non-JEP512 main method.

Related: #4425 (review)

Checklist

  • tested the solution locally and it works
  • ran the code formatter (scala-cli fmt .)
  • ran scalafix (./mill -i __.fix)
  • ran reference docs auto-generation (./mill -i 'generate-reference-doc[]'.run)

How much have your relied on LLM-based tools in this contribution?

Minimally

How was the solution tested?

Automated tests

@Gedochao Gedochao left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

Comment thread modules/build/src/test/scala/scala/build/tests/MainClassTests.scala
@Gedochao
Gedochao merged commit 59419d3 into VirtusLab:main Aug 18, 2026
151 of 156 checks passed
@warcholjakub
warcholjakub deleted the fix/non-public-main-detection branch August 20, 2026 10:31
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