Re: [PR] GROOVY-11263: Analyze dead code [groovy]

2024-01-08 Thread via GitHub
eric-milles commented on PR #2023: URL: https://github.com/apache/groovy/pull/2023#issuecomment-1881861904 > dead code analysis, as its name shown, it just traverses AST and does not change the AST, so no tranforming [sic] changes involved. This was understood. The point is that if y

Re: [PR] GROOVY-11263: Analyze dead code [groovy]

2024-01-08 Thread via GitHub
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(GR

Re: [PR] GROOVY-11263: Analyze dead code [groovy]

2024-01-08 Thread via GitHub
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(GR

Re: [PR] GROOVY-11263: Analyze dead code [groovy]

2024-01-08 Thread via GitHub
eric-milles commented on code in PR #2023: URL: https://github.com/apache/groovy/pull/2023#discussion_r1445349235 ## src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java: ## @@ -66,6 +66,9 @@ public class CompilerConfiguration { /** Joint Compilation Option

Re: [PR] GROOVY-11263: Analyze dead code [groovy]

2024-01-03 Thread via GitHub
daniellansun commented on PR #2023: URL: https://github.com/apache/groovy/pull/2023#issuecomment-1875821378 We can add a option to prevent or warn dead code or disable check totally. Here is the table to show how mainstream programming language to handle dead code. Most of them preven

Re: [PR] GROOVY-11263: Analyze dead code [groovy]

2024-01-03 Thread via GitHub
eric-milles commented on PR #2023: URL: https://github.com/apache/groovy/pull/2023#issuecomment-1875712756 > source code is meant for developers to read, and the less redundant code there is, the more developer-friendly it becomes. So now you have a benefit statement that you can put

Re: [PR] GROOVY-11263: Analyze dead code [groovy]

2024-01-01 Thread via GitHub
daniellansun commented on PR #2023: URL: https://github.com/apache/groovy/pull/2023#issuecomment-1873540757 @eric-milles 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. Admittedly, it's cha

Re: [PR] GROOVY-11263: Analyze dead code [groovy]

2024-01-01 Thread via GitHub
eric-milles commented on code in PR #2023: URL: https://github.com/apache/groovy/pull/2023#discussion_r1439064503 ## src/main/java/org/codehaus/groovy/classgen/Verifier.java: ## @@ -302,6 +310,12 @@ private void checkFinalVariables(final ClassNode node) { visitor.visitC

Re: [PR] GROOVY-11263: Analyze dead code [groovy]

2024-01-01 Thread via GitHub
eric-milles commented on PR #2023: URL: https://github.com/apache/groovy/pull/2023#issuecomment-1873409213 Besides the extra class bytecode, is there a strong reason for this? The issue ticket pops up out of the blue without much explanation. There are so many possible paths that I t

Re: [PR] GROOVY-11263: Analyze dead code [groovy]

2023-12-31 Thread via GitHub
daniellansun commented on code in PR #2023: URL: https://github.com/apache/groovy/pull/2023#discussion_r1438949628 ## src/main/java/org/codehaus/groovy/classgen/DeadCodeAnalyzer.java: ## @@ -0,0 +1,68 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or

Re: [PR] GROOVY-11263: Analyze dead code [groovy]

2023-12-31 Thread via GitHub
blackdrag commented on code in PR #2023: URL: https://github.com/apache/groovy/pull/2023#discussion_r1438940188 ## src/main/java/org/codehaus/groovy/classgen/DeadCodeAnalyzer.java: ## @@ -0,0 +1,68 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or mo