[ 
https://issues.apache.org/jira/browse/GROOVY-10156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18081492#comment-18081492
 ] 

ASF GitHub Bot commented on GROOVY-10156:
-----------------------------------------

codecov-commenter commented on PR #2538:
URL: https://github.com/apache/groovy/pull/2538#issuecomment-4470725645

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/2538?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 `88.79668%` with `27 lines` in your changes missing 
coverage. Please review.
   :white_check_mark: Project coverage is 68.1683%. Comparing base 
([`2ff0a6b`](https://app.codecov.io/gh/apache/groovy/commit/2ff0a6b7a851d216cb0136c99ee7dcb624625d28?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
 to head 
([`063d1ca`](https://app.codecov.io/gh/apache/groovy/commit/063d1ca5c9dd66aee06fcdd25f7a5afa430dc6dc?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 12 commits behind head on master.
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/2538?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Patch % | Lines |
   |---|---|---|
   | 
[...va/org/codehaus/groovy/ast/tools/GeneralUtils.java](https://app.codecov.io/gh/apache/groovy/pull/2538?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fast%2Ftools%2FGeneralUtils.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2FzdC90b29scy9HZW5lcmFsVXRpbHMuamF2YQ==)
 | 85.8824% | [4 Missing and 20 partials :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/2538?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   | 
[...org/codehaus/groovy/classgen/asm/CompileStack.java](https://app.codecov.io/gh/apache/groovy/pull/2538?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2FCompileStack.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9Db21waWxlU3RhY2suamF2YQ==)
 | 75.0000% | [1 Missing and 2 partials :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/2538?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>
   
   
   
   [![Impacted file tree 
graph](https://app.codecov.io/gh/apache/groovy/pull/2538/graphs/tree.svg?width=650&height=150&src=pr&token=1r45138NfQ&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/groovy/pull/2538?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #2538        +/-   ##
   ==================================================
   + Coverage     68.1260%   68.1683%   +0.0423%     
   - Complexity      32760      32861       +101     
   ==================================================
     Files            1499       1499                
     Lines          125240     125394       +154     
     Branches        22606      22665        +59     
   ==================================================
   + Hits            85321      85479       +158     
   + Misses          32404      32396         -8     
   - Partials         7515       7519         +4     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/2538?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[.../codehaus/groovy/classgen/asm/StatementWriter.java](https://app.codecov.io/gh/apache/groovy/pull/2538?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2FStatementWriter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9TdGF0ZW1lbnRXcml0ZXIuamF2YQ==)
 | `96.9231% <100.0000%> (+1.3850%)` | :arrow_up: |
   | 
[...vy/classgen/asm/sc/StaticTypesStatementWriter.java](https://app.codecov.io/gh/apache/groovy/pull/2538?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2Fsc%2FStaticTypesStatementWriter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9zYy9TdGF0aWNUeXBlc1N0YXRlbWVudFdyaXRlci5qYXZh)
 | `98.4252% <100.0000%> (+4.6268%)` | :arrow_up: |
   | 
[...org/codehaus/groovy/classgen/asm/CompileStack.java](https://app.codecov.io/gh/apache/groovy/pull/2538?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2FCompileStack.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9Db21waWxlU3RhY2suamF2YQ==)
 | `86.2843% <75.0000%> (-0.1018%)` | :arrow_down: |
   | 
[...va/org/codehaus/groovy/ast/tools/GeneralUtils.java](https://app.codecov.io/gh/apache/groovy/pull/2538?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fast%2Ftools%2FGeneralUtils.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2FzdC90b29scy9HZW5lcmFsVXRpbHMuamF2YQ==)
 | `85.4202% <85.8824%> (-0.2268%)` | :arrow_down: |
   
   ... and [13 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/2538/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>




> Unreachable bytecode in switch statement
> ----------------------------------------
>
>                 Key: GROOVY-10156
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10156
>             Project: Groovy
>          Issue Type: Improvement
>          Components: Compiler
>    Affects Versions: 3.0.8
>         Environment: JVM: 11.0.11 (Oracle Corporation 11.0.11+9-LTS-194)
> OS: Mac OS X 10.16 x86_64
>            Reporter: Damir Murat
>            Priority: Minor
>              Labels: bytecode, enum
>
> When switching over an enum, and for two or more case branches, groovy 
> generates unreachable bytecode for each case branch except the last one.
> For example
> {code:java}
> package mypackage
> import groovy.transform.CompileStatic
> @CompileStatic
> class SwitchDemo {
>   void mySwitchMethod(MyEnum myEnum) {
>     switch (myEnum) {
>       case MyEnum.ONE:
>         println "ONE"
>         break
>       case MyEnum.TWO:
>         println "TWO"
>         break
>       case MyEnum.THREE:
>         println "TWO"
>         break
>       default:
>         println "default"
>         break
>     }
>   }
> }
> @CompileStatic
> enum MyEnum {
>   ONE, TWO, THREE
> }
> {code}
> generates bytecode sequences like
> {code:java}
> ...
>    L8
>    L9
>     LINENUMBER 12 L9
>     GOTO L10
>    L3
>    L11
>     LINENUMBER 12 L11
>     ALOAD 2
>     GETSTATIC mypackage/MyEnum.TWO : Lmypackage/MyEnum;
>     INVOKESTATIC org/codehaus/groovy/runtime/ScriptBytecodeAdapter.isCase 
> (Ljava/lang/Object;Ljava/lang/Object;)Z
>     IFEQ L12
>    L10
> ...
> {code}
> It looks like the first four lines above are not necessary. This results in
> {noformat}
> nop, nop, athrow
> {noformat}
> sequences in generated java bytecode.
> It would be great if this can be cleaned up and fixed. My scenario is related 
> to JaCoCo reports which are not accurate and a bit confusing for switch 
> statements.
> Tnx



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to