sonatype-lift[bot] commented on code in PR #1747:
URL: https://github.com/apache/groovy/pull/1747#discussion_r922570811
##########
subprojects/groovy-astbuilder/src/test/groovy/org/codehaus/groovy/ast/CodeVisitorSupportTest.groovy:
##########
@@ -45,6 +48,7 @@ class CodeVisitorSupportTest extends GroovyTestCase {
assert visitor.history.size() == 5
}
+ @Test
void testEmptyStatementsOnIfElse() {
def ast = new
AstBuilder().buildFromCode(CompilePhase.SEMANTIC_ANALYSIS, true, {
if (true) { 1 }
Review Comment:
*ConstantIfExpression:* The if statement condition (true) contains a
constant
Reply with *"**@sonatype-lift help**"* for info about LiftBot commands.
Reply with *"**@sonatype-lift ignore**"* to tell LiftBot to leave out the
above finding from this PR.
Reply with *"**@sonatype-lift ignoreall**"* to tell LiftBot to leave out all
the findings from this PR and from the status bar in Github.
When talking to LiftBot, you need to **refresh** the page to see its
response. [Click here](https://help.sonatype.com/lift/talking-to-lift) to get
to know more about LiftBot commands.
---
Was this a good recommendation?
[ [🙁 Not
relevant](https://www.sonatype.com/lift-comment-rating?comment=298936654&lift_comment_rating=1)
] - [ [😕 Won't
fix](https://www.sonatype.com/lift-comment-rating?comment=298936654&lift_comment_rating=2)
] - [ [😑 Not critical, will
fix](https://www.sonatype.com/lift-comment-rating?comment=298936654&lift_comment_rating=3)
] - [ [🙂 Critical, will
fix](https://www.sonatype.com/lift-comment-rating?comment=298936654&lift_comment_rating=4)
] - [ [😊 Critical, fixing
now](https://www.sonatype.com/lift-comment-rating?comment=298936654&lift_comment_rating=5)
]
##########
subprojects/groovy-astbuilder/src/test/groovy/org/codehaus/groovy/ast/CodeVisitorSupportTest.groovy:
##########
@@ -26,14 +27,16 @@ import org.codehaus.groovy.ast.stmt.EmptyStatement
import org.codehaus.groovy.ast.stmt.IfStatement
import org.codehaus.groovy.ast.stmt.TryCatchStatement
import org.codehaus.groovy.control.CompilePhase
+import org.junit.Test
/**
* Tests the CodeVisitorSupport.
*/
-class CodeVisitorSupportTest extends GroovyTestCase {
+final class CodeVisitorSupportTest {
+ @Test
void testIfElse() {
- def ast = new AstBuilder().buildFromCode { if (true) { 1 } else { 2 }
}
+ def ast = new AstBuilder().buildFromCode { if (true) { 1 } else { 2 } }
Review Comment:
*ConstantIfExpression:* The if statement condition (true) contains a
constant
Reply with *"**@sonatype-lift help**"* for info about LiftBot commands.
Reply with *"**@sonatype-lift ignore**"* to tell LiftBot to leave out the
above finding from this PR.
Reply with *"**@sonatype-lift ignoreall**"* to tell LiftBot to leave out all
the findings from this PR and from the status bar in Github.
When talking to LiftBot, you need to **refresh** the page to see its
response. [Click here](https://help.sonatype.com/lift/talking-to-lift) to get
to know more about LiftBot commands.
---
Was this a good recommendation?
[ [🙁 Not
relevant](https://www.sonatype.com/lift-comment-rating?comment=298936653&lift_comment_rating=1)
] - [ [😕 Won't
fix](https://www.sonatype.com/lift-comment-rating?comment=298936653&lift_comment_rating=2)
] - [ [😑 Not critical, will
fix](https://www.sonatype.com/lift-comment-rating?comment=298936653&lift_comment_rating=3)
] - [ [🙂 Critical, will
fix](https://www.sonatype.com/lift-comment-rating?comment=298936653&lift_comment_rating=4)
] - [ [😊 Critical, fixing
now](https://www.sonatype.com/lift-comment-rating?comment=298936653&lift_comment_rating=5)
]
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]