[
https://issues.apache.org/jira/browse/GROOVY-7463?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18052958#comment-18052958
]
ASF GitHub Bot commented on GROOVY-7463:
----------------------------------------
codecov-commenter commented on PR #2371:
URL: https://github.com/apache/groovy/pull/2371#issuecomment-3770572497
##
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/2371?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 `64.23358%` with `49 lines` in your changes missing
coverage. Please review.
:white_check_mark: Project coverage is 67.0277%. Comparing base
([`9faaa88`](https://app.codecov.io/gh/apache/groovy/commit/9faaa88535d5f867bd4ae76bd4cffaa065819d74?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
to head
([`3b81f2b`](https://app.codecov.io/gh/apache/groovy/commit/3b81f2bd222b5bbea96964c5eef056c9bddfe575?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/2371?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
| Patch % | Lines |
|---|---|---|
|
[...org/codehaus/groovy/classgen/asm/CompileStack.java](https://app.codecov.io/gh/apache/groovy/pull/2371?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==)
| 43.5484% | [27 Missing and 8 partials :warning:
](https://app.codecov.io/gh/apache/groovy/pull/2371?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
|
|
[...ava/org/codehaus/groovy/control/LabelVerifier.java](https://app.codecov.io/gh/apache/groovy/pull/2371?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fcontrol%2FLabelVerifier.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NvbnRyb2wvTGFiZWxWZXJpZmllci5qYXZh)
| 76.2712% | [9 Missing and 5 partials :warning:
](https://app.codecov.io/gh/apache/groovy/pull/2371?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/2371?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #2371 +/- ##
==================================================
+ Coverage 67.0265% 67.0277% +0.0012%
+ Complexity 29420 29419 -1
==================================================
Files 1382 1382
Lines 116151 116149 -2
Branches 20469 20468 -1
==================================================
Hits 77852 77852
- Misses 31810 31813 +3
+ Partials 6489 6484 -5
```
| [Files with missing
lines](https://app.codecov.io/gh/apache/groovy/pull/2371?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
| Coverage Δ | |
|---|---|---|
|
[...va/org/apache/groovy/parser/antlr4/AstBuilder.java](https://app.codecov.io/gh/apache/groovy/pull/2371?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fapache%2Fgroovy%2Fparser%2Fantlr4%2FAstBuilder.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dyb292eS9wYXJzZXIvYW50bHI0L0FzdEJ1aWxkZXIuamF2YQ==)
| `86.5194% <ø> (+0.0414%)` | :arrow_up: |
|
[.../codehaus/groovy/classgen/asm/StatementWriter.java](https://app.codecov.io/gh/apache/groovy/pull/2371?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==)
| `94.6237% <100.0000%> (-0.0430%)` | :arrow_down: |
|
[...ava/org/codehaus/groovy/control/LabelVerifier.java](https://app.codecov.io/gh/apache/groovy/pull/2371?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fcontrol%2FLabelVerifier.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NvbnRyb2wvTGFiZWxWZXJpZmllci5qYXZh)
| `83.1325% <76.2712%> (+17.2502%)` | :arrow_up: |
|
[...org/codehaus/groovy/classgen/asm/CompileStack.java](https://app.codecov.io/gh/apache/groovy/pull/2371?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==)
| `82.1782% <43.5484%> (-2.5546%)` | :arrow_down: |
... and [2 files with indirect coverage
changes](https://app.codecov.io/gh/apache/groovy/pull/2371/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>
> break out of labelled statement
> -------------------------------
>
> Key: GROOVY-7463
> URL: https://issues.apache.org/jira/browse/GROOVY-7463
> Project: Groovy
> Issue Type: Improvement
> Components: Compiler
> Reporter: Christopher Hobbs
> Priority: Major
>
> The following java code compiles:
> {code}
> package com.example;
> public class Main {
> public static void main(String[] args) {
> LABEL:
> if (true) {
> System.out.println("1");
> if (true) break LABEL;
> System.out.println("2");
> }
> System.out.println("3");
> }
> }
> {code}
> meanwhile the same code in groovy fails to compile with the error
> {{Error:(12, 23) Groovyc: the break statement with named label is only
> allowed inside loops}}.
> In the code where I originally found this error, the compiler throws an
> exception:
> {code}
> Error:Groovyc: BUG! exception in phase 'class generation' in source unit
> '/data/programming/jMinecraftLib/src/main/groovy/uk/co/rx14/jlaunchlib/caches/MinecraftMaven.groovy'
> unexpected NullpointerException
> at
> org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1057)
> at
> org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:588)
> at
> org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:566)
> at
> org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:543)
> at
> org.jetbrains.groovy.compiler.rt.GroovyCompilerWrapper.compile(GroovyCompilerWrapper.java:58)
> at
> org.jetbrains.groovy.compiler.rt.DependentGroovycRunner.runGroovyc(DependentGroovycRunner.java:116)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:497)
> at
> org.jetbrains.groovy.compiler.rt.GroovycRunner.intMain2(GroovycRunner.java:132)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:497)
> at
> org.jetbrains.jps.incremental.groovy.InProcessGroovyc.runGroovycInThisProcess(InProcessGroovyc.java:148)
> at
> org.jetbrains.jps.incremental.groovy.InProcessGroovyc.access$000(InProcessGroovyc.java:48)
> at
> org.jetbrains.jps.incremental.groovy.InProcessGroovyc$1.call(InProcessGroovyc.java:77)
> at
> org.jetbrains.jps.incremental.groovy.InProcessGroovyc$1.call(InProcessGroovyc.java:74)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> Caused by: java.lang.NullPointerException
> at
> org.codehaus.groovy.control.LabelVerifier.visitBreakStatement(LabelVerifier.java:123)
> at
> org.codehaus.groovy.ast.stmt.BreakStatement.visit(BreakStatement.java:44)
> at
> org.codehaus.groovy.ast.CodeVisitorSupport.visitIfElse(CodeVisitorSupport.java:56)
> at
> org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitIfElse(ClassCodeVisitorSupport.java:203)
> at org.codehaus.groovy.ast.stmt.IfStatement.visit(IfStatement.java:41)
> at
> org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:35)
> at
> org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:163)
> at
> org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:69)
> at
> org.codehaus.groovy.ast.CodeVisitorSupport.visitIfElse(CodeVisitorSupport.java:56)
> at
> org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitIfElse(ClassCodeVisitorSupport.java:203)
> at org.codehaus.groovy.ast.stmt.IfStatement.visit(IfStatement.java:41)
> at
> org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:35)
> at
> org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:163)
> at
> org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:69)
> at
> org.codehaus.groovy.ast.CodeVisitorSupport.visitClosureExpression(CodeVisitorSupport.java:174)
> at
> org.codehaus.groovy.ast.expr.ClosureExpression.visit(ClosureExpression.java:43)
> at
> org.codehaus.groovy.ast.CodeVisitorSupport.visitListOfExpressions(CodeVisitorSupport.java:273)
> at
> org.codehaus.groovy.ast.CodeVisitorSupport.visitTupleExpression(CodeVisitorSupport.java:178)
> at
> org.codehaus.groovy.ast.CodeVisitorSupport.visitArgumentlistExpression(CodeVisitorSupport.java:283)
> at
> org.codehaus.groovy.ast.expr.ArgumentListExpression.visit(ArgumentListExpression.java:74)
> at
> org.codehaus.groovy.ast.CodeVisitorSupport.visitMethodCallExpression(CodeVisitorSupport.java:131)
> at
> org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:64)
> at
> org.codehaus.groovy.ast.CodeVisitorSupport.visitReturnStatement(CodeVisitorSupport.java:73)
> at
> org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitReturnStatement(ClassCodeVisitorSupport.java:208)
> at
> org.codehaus.groovy.ast.stmt.ReturnStatement.visit(ReturnStatement.java:47)
> at
> org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:35)
> at
> org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:163)
> at
> org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:69)
> at
> org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:101)
> at
> org.codehaus.groovy.control.LabelVerifier.visitClassCodeContainer(LabelVerifier.java:63)
> at
> org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:112)
> at
> org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:123)
> at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1083)
> at
> org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:50)
> at
> org.codehaus.groovy.control.CompilationUnit$16.call(CompilationUnit.java:783)
> at
> org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1052)
> ... 22 more
> {code}
> I have been unable to reproduce the compiler exception outside of the project
> where I found it.
> Should breaking out of an if work? It certainly shouldn't create a compiler
> exception.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)