[
https://issues.apache.org/jira/browse/GROOVY-11737?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18070585#comment-18070585
] ASF GitHub Bot commented on GROOVY-11737: ----------------------------------------- codecov-commenter commented on PR #2428: URL: https://github.com/apache/groovy/pull/2428#issuecomment-4177571747 ## [Codecov](https://app.codecov.io/gh/apache/groovy/pull/2428?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report :x: Patch coverage is `62.16216%` with `14 lines` in your changes missing coverage. Please review. :white_check_mark: Project coverage is 66.3402%. Comparing base ([`2a7d1e9`](https://app.codecov.io/gh/apache/groovy/commit/2a7d1e9b5a6bc86392dd37d050130ce0929b6eff?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`38ecbb8`](https://app.codecov.io/gh/apache/groovy/commit/38ecbb870dbfd18a52b35b250d730093bd4682f9?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)). | [Files with missing lines](https://app.codecov.io/gh/apache/groovy/pull/2428?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines | |---|---|---| | [src/main/java/groovy/lang/GroovyShell.java](https://app.codecov.io/gh/apache/groovy/pull/2428?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Fgroovy%2Flang%2FGroovyShell.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9ncm9vdnkvbGFuZy9Hcm9vdnlTaGVsbC5qYXZh) | 69.2308% | [6 Missing and 2 partials :warning: ](https://app.codecov.io/gh/apache/groovy/pull/2428?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | | [.../main/java/org/codehaus/groovy/ast/ModuleNode.java](https://app.codecov.io/gh/apache/groovy/pull/2428?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fast%2FModuleNode.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2FzdC9Nb2R1bGVOb2RlLmphdmE=) | 45.4546% | [5 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/groovy/pull/2428?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | <details><summary>Additional details and impacted files</summary> [](https://app.codecov.io/gh/apache/groovy/pull/2428?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) ```diff @@ Coverage Diff @@ ## master #2428 +/- ## ================================================== + Coverage 66.3339% 66.3402% +0.0063% - Complexity 29941 29949 +8 ================================================== Files 1396 1396 Lines 117085 117101 +16 Branches 20730 20737 +7 ================================================== + Hits 77667 77685 +18 - Misses 33037 33039 +2 + Partials 6381 6377 -4 ``` | [Files with missing lines](https://app.codecov.io/gh/apache/groovy/pull/2428?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | |---|---|---| | [.../main/java/org/codehaus/groovy/ast/ModuleNode.java](https://app.codecov.io/gh/apache/groovy/pull/2428?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fast%2FModuleNode.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2FzdC9Nb2R1bGVOb2RlLmphdmE=) | `85.7616% <45.4546%> (-1.3132%)` | :arrow_down: | | [src/main/java/groovy/lang/GroovyShell.java](https://app.codecov.io/gh/apache/groovy/pull/2428?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Fgroovy%2Flang%2FGroovyShell.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9ncm9vdnkvbGFuZy9Hcm9vdnlTaGVsbC5qYXZh) | `63.1579% <69.2308%> (+1.0700%)` | :arrow_up: | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/apache/groovy/pull/2428/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) </details> <details><summary> :rocket: New features to boost your workflow: </summary> - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems. - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges. </details> > Improve clarity of Groovy main method selection priority > -------------------------------------------------------- > > Key: GROOVY-11737 > URL: https://issues.apache.org/jira/browse/GROOVY-11737 > Project: Groovy > Issue Type: Question > Reporter: Georgii Ustinov > Assignee: Paul King > Priority: Major > > Good afternoon > > I am currently trying to support instance main methods inside IntelliJ IDEA > groovy plugin as a part of Groovy 5 release, however, I can’t find any > specification of how it works. > > I have found that the feature was implemented here - > [https://github.com/apache/groovy/pull/1910/files]. > > Looking into the source code - > [https://github.com/paulk-asert/groovy/blob/90480bfade8c20f935311055e2ceb85288870605/src/main/java/groovy/lang/GroovyShell.java#L275] > I can see the following order: > > 1) static void main(String[] args); > 2) void main(String[] args); > 3) static void main(args); > 4) void main(args); > 5) static void main(); > 6) void main(); > > The problem is that it doesn’t correspond to the reality. > > Let’s consider the following code main.groovy > > > {code:java} > void main(args) { > println "1" > } > > static void main() { > println "2" > } > {code} > > > If I run > {code:java} > groovy main.groovy{code} > 1 will be printed (and it looks correct according to the semantics), > But if I change example: > > > {code:java} > void main(String[] args) { > println "1" > } > > static void main() { > println "2" > } > {code} > 2 will be printed (and thus the order in the code is violated). But if I run > {code:java} > groovy main.groovy someArg{code} > , then 1 will be printed > > Could you, please, provide the correct main method order resolution? -- This message was sent by Atlassian Jira (v8.20.10#820010)
