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

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

eric-milles commented on code in PR #2023:
URL: https://github.com/apache/groovy/pull/2023#discussion_r1445353482


##########
src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java:
##########
@@ -469,6 +472,8 @@ public CompilerConfiguration() {
         handleOptimizationOption(GROOVYDOC, 
getSystemPropertySafe("groovy.attach.groovydoc"));
         handleOptimizationOption(RUNTIME_GROOVYDOC, 
getSystemPropertySafe("groovy.attach.runtime.groovydoc"));
         handleOptimizationOption(PARALLEL_PARSE, 
getSystemPropertySafe("groovy.parallel.parse", "true"));
+        handleOptimizationOption(ANALYZE_DEAD_CODE, 
getSystemPropertySafe("groovy.analyze.deadcode", "true"));
+

Review Comment:
   `"groovy.branch.analysis"` or `"groovy.deadCode.analysis"`?  Are you sure we 
want to default to enabled right out the gate?
   
   Spurious extra line added.





> Analyze dead code
> -----------------
>
>                 Key: GROOVY-11263
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11263
>             Project: Groovy
>          Issue Type: New Feature
>            Reporter: Daniel Sun
>            Priority: Major
>              Labels: breaking_change
>             Fix For: 5.x
>
>
> As we all know, source code is meant for developers to read, and the less 
> redundant code there is, the more developer-friendly it becomes, but Groovy 
> allows dead code after {{throw}}, {{return}}, {{break}} and {{continue}}, e.g.
> {code:java}
> def m() {
>    return
>    def a = 1
> }
> {code}
> It's better to avoid such dead code.



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

Reply via email to