[jira] [Commented] (LUCENE-9856) Improve static analysis to catch dead code and other potential bugs

2021-03-24 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/LUCENE-9856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17308040#comment-17308040
 ] 

ASF subversion and git services commented on LUCENE-9856:
-

Commit 3214e365e3b67955abc3c081a2ed31edc08b181f in lucene's branch 
refs/heads/main from Uwe Schindler
[ https://gitbox.apache.org/repos/asf?p=lucene.git;h=3214e36 ]

LUCENE-9856: Static analysis take 3: Remove redundant interfaces (#38)

Co-authored-by: Robert Muir 

> Improve static analysis to catch dead code and other potential bugs
> ---
>
> Key: LUCENE-9856
> URL: https://issues.apache.org/jira/browse/LUCENE-9856
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: general/build
>Reporter: Zach Chen
>Priority: Minor
>  Labels: build
> Fix For: main (9.0)
>
> Attachments: LUCENE-9856.patch
>
>  Time Spent: 7h 20m
>  Remaining Estimate: 0h
>
> When working on PR [https://github.com/apache/lucene/pull/25,] we noticed 
> that some dead code is not being caught during static analysis in gradle 
> build, such as the *start* variable in the following code: 
> [https://github.com/apache/lucene/blob/a5996dbecd4a6b4147d961260711a2cb6aeab3d3/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java#L446-L456]
>  
> We may need to look at if additional javac compiler flag, or configuration 
> for *error prone,* should be added to catch such bug as well as other 
> potential ones.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (LUCENE-9856) Improve static analysis to catch dead code and other potential bugs

2021-03-23 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/LUCENE-9856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17307284#comment-17307284
 ] 

ASF subversion and git services commented on LUCENE-9856:
-

Commit 945b1cb8726223d5b0d5f61e85174ca93931b86e in lucene's branch 
refs/heads/main from Robert Muir
[ https://gitbox.apache.org/repos/asf?p=lucene.git;h=945b1cb ]

LUCENE-9856: fail precommit on unused local variables, take two (#37)

Enable ecj unused local variable, private instance and method detection. Allow 
SuppressWarnings("unused") to disable unused checks (e.g. for generated code or 
very special tests). Fix gradlew regenerate for python 3.9 
SuppressWarnings("unused") for generated javacc and jflex code. Enable a few 
other easy ecj checks such as Deprecated annotation, hashcode/equals, equals 
across different types.

Co-authored-by: Mike McCandless 

> Improve static analysis to catch dead code and other potential bugs
> ---
>
> Key: LUCENE-9856
> URL: https://issues.apache.org/jira/browse/LUCENE-9856
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: general/build
>Reporter: Zach Chen
>Priority: Minor
>  Labels: build
> Fix For: main (9.0)
>
> Attachments: LUCENE-9856.patch
>
>  Time Spent: 4h 50m
>  Remaining Estimate: 0h
>
> When working on PR [https://github.com/apache/lucene/pull/25,] we noticed 
> that some dead code is not being caught during static analysis in gradle 
> build, such as the *start* variable in the following code: 
> [https://github.com/apache/lucene/blob/a5996dbecd4a6b4147d961260711a2cb6aeab3d3/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java#L446-L456]
>  
> We may need to look at if additional javac compiler flag, or configuration 
> for *error prone,* should be added to catch such bug as well as other 
> potential ones.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (LUCENE-9856) Improve static analysis to catch dead code and other potential bugs

2021-03-23 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/LUCENE-9856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17307270#comment-17307270
 ] 

ASF subversion and git services commented on LUCENE-9856:
-

Commit f805da41ca4e8458d9df2a64e469b16a65ee438e in lucene's branch 
refs/heads/jira/LUCENE-9856-static-analysis from Robert Muir
[ https://gitbox.apache.org/repos/asf?p=lucene.git;h=f805da4 ]

Revert "LUCENE-9856: enable/fix more unnecessary code detection in linter"

This reverts commit 7d823c84e3f7b6bebd25eda76f9e482016c78868.


> Improve static analysis to catch dead code and other potential bugs
> ---
>
> Key: LUCENE-9856
> URL: https://issues.apache.org/jira/browse/LUCENE-9856
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: general/build
>Reporter: Zach Chen
>Priority: Minor
>  Labels: build
> Fix For: main (9.0)
>
> Attachments: LUCENE-9856.patch
>
>  Time Spent: 4.5h
>  Remaining Estimate: 0h
>
> When working on PR [https://github.com/apache/lucene/pull/25,] we noticed 
> that some dead code is not being caught during static analysis in gradle 
> build, such as the *start* variable in the following code: 
> [https://github.com/apache/lucene/blob/a5996dbecd4a6b4147d961260711a2cb6aeab3d3/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java#L446-L456]
>  
> We may need to look at if additional javac compiler flag, or configuration 
> for *error prone,* should be added to catch such bug as well as other 
> potential ones.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (LUCENE-9856) Improve static analysis to catch dead code and other potential bugs

2021-03-23 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/LUCENE-9856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17307271#comment-17307271
 ] 

ASF subversion and git services commented on LUCENE-9856:
-

Commit b888436edc612a166a7c2ae1bd5fa09b1b8ce095 in lucene's branch 
refs/heads/jira/LUCENE-9856-static-analysis from Robert Muir
[ https://gitbox.apache.org/repos/asf?p=lucene.git;h=b888436 ]

LUCENE-9856: add unusedLabel, it is safe


> Improve static analysis to catch dead code and other potential bugs
> ---
>
> Key: LUCENE-9856
> URL: https://issues.apache.org/jira/browse/LUCENE-9856
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: general/build
>Reporter: Zach Chen
>Priority: Minor
>  Labels: build
> Fix For: main (9.0)
>
> Attachments: LUCENE-9856.patch
>
>  Time Spent: 4.5h
>  Remaining Estimate: 0h
>
> When working on PR [https://github.com/apache/lucene/pull/25,] we noticed 
> that some dead code is not being caught during static analysis in gradle 
> build, such as the *start* variable in the following code: 
> [https://github.com/apache/lucene/blob/a5996dbecd4a6b4147d961260711a2cb6aeab3d3/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java#L446-L456]
>  
> We may need to look at if additional javac compiler flag, or configuration 
> for *error prone,* should be added to catch such bug as well as other 
> potential ones.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (LUCENE-9856) Improve static analysis to catch dead code and other potential bugs

2021-03-23 Thread Uwe Schindler (Jira)


[ 
https://issues.apache.org/jira/browse/LUCENE-9856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17307227#comment-17307227
 ] 

Uwe Schindler commented on LUCENE-9856:
---

{quote}
bq. Gradle has single quotes instead of double quotes, 30 minutes later

groovy has both - they mean different things (single-quoted strings are not 
interpolated).
https://groovy-lang.org/syntax.html#_single_quoted_string
{quote}

That's known. See discussion on pull request. Personally, I always tend to use 
single quotes, if I definitely don't want interpolation (in most cases).

The case here was some Java source code for search/replace. The source code had 
double quotes. As no interpolation needed, I suggested to use single ones to 
make code more readable.

> Improve static analysis to catch dead code and other potential bugs
> ---
>
> Key: LUCENE-9856
> URL: https://issues.apache.org/jira/browse/LUCENE-9856
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: general/build
>Reporter: Zach Chen
>Priority: Minor
>  Labels: build
> Fix For: main (9.0)
>
> Attachments: LUCENE-9856.patch
>
>  Time Spent: 4h 20m
>  Remaining Estimate: 0h
>
> When working on PR [https://github.com/apache/lucene/pull/25,] we noticed 
> that some dead code is not being caught during static analysis in gradle 
> build, such as the *start* variable in the following code: 
> [https://github.com/apache/lucene/blob/a5996dbecd4a6b4147d961260711a2cb6aeab3d3/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java#L446-L456]
>  
> We may need to look at if additional javac compiler flag, or configuration 
> for *error prone,* should be added to catch such bug as well as other 
> potential ones.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (LUCENE-9856) Improve static analysis to catch dead code and other potential bugs

2021-03-23 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/LUCENE-9856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17307222#comment-17307222
 ] 

ASF subversion and git services commented on LUCENE-9856:
-

Commit e6c4956cf69b7d2b47297f589a6855fa3028396a in lucene's branch 
refs/heads/main from Robert Muir
[ https://gitbox.apache.org/repos/asf?p=lucene.git;h=e6c4956 ]

Revert "LUCENE-9856: fail precommit on unused local variables (#34)"

This reverts commit 20dba278bbfc4fec8b53c8371eae982e3fa24b39.


> Improve static analysis to catch dead code and other potential bugs
> ---
>
> Key: LUCENE-9856
> URL: https://issues.apache.org/jira/browse/LUCENE-9856
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: general/build
>Reporter: Zach Chen
>Priority: Minor
>  Labels: build
> Fix For: main (9.0)
>
> Attachments: LUCENE-9856.patch
>
>  Time Spent: 4h 10m
>  Remaining Estimate: 0h
>
> When working on PR [https://github.com/apache/lucene/pull/25,] we noticed 
> that some dead code is not being caught during static analysis in gradle 
> build, such as the *start* variable in the following code: 
> [https://github.com/apache/lucene/blob/a5996dbecd4a6b4147d961260711a2cb6aeab3d3/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java#L446-L456]
>  
> We may need to look at if additional javac compiler flag, or configuration 
> for *error prone,* should be added to catch such bug as well as other 
> potential ones.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (LUCENE-9856) Improve static analysis to catch dead code and other potential bugs

2021-03-23 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/LUCENE-9856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17307155#comment-17307155
 ] 

ASF subversion and git services commented on LUCENE-9856:
-

Commit 20dba278bbfc4fec8b53c8371eae982e3fa24b39 in lucene's branch 
refs/heads/main from Robert Muir
[ https://gitbox.apache.org/repos/asf?p=lucene.git;h=20dba27 ]

LUCENE-9856: fail precommit on unused local variables (#34)

Enable ecj unused local variable, private instance and method detection. Allow 
SuppressWarnings("unused") to disable unused checks (e.g. for generated code or 
very special tests). Fix gradlew regenerate for python 3.9 
SuppressWarnings("unused") for generated javacc and jflex code. Enable a few 
other easy ecj checks such as Deprecated annotation, hashcode/equals, equals 
across different types.

Co-authored-by: Mike McCandless 

> Improve static analysis to catch dead code and other potential bugs
> ---
>
> Key: LUCENE-9856
> URL: https://issues.apache.org/jira/browse/LUCENE-9856
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: general/build
>Reporter: Zach Chen
>Priority: Minor
>  Labels: build
> Attachments: LUCENE-9856.patch
>
>  Time Spent: 4h 10m
>  Remaining Estimate: 0h
>
> When working on PR [https://github.com/apache/lucene/pull/25,] we noticed 
> that some dead code is not being caught during static analysis in gradle 
> build, such as the *start* variable in the following code: 
> [https://github.com/apache/lucene/blob/a5996dbecd4a6b4147d961260711a2cb6aeab3d3/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java#L446-L456]
>  
> We may need to look at if additional javac compiler flag, or configuration 
> for *error prone,* should be added to catch such bug as well as other 
> potential ones.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (LUCENE-9856) Improve static analysis to catch dead code and other potential bugs

2021-03-23 Thread Dawid Weiss (Jira)


[ 
https://issues.apache.org/jira/browse/LUCENE-9856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17307021#comment-17307021
 ] 

Dawid Weiss commented on LUCENE-9856:
-

> Gradle has single quotes instead of double quotes, 30 minutes later

groovy has both - they mean different things (single-quoted strings are not 
interpolated).
https://groovy-lang.org/syntax.html#_single_quoted_string

> Improve static analysis to catch dead code and other potential bugs
> ---
>
> Key: LUCENE-9856
> URL: https://issues.apache.org/jira/browse/LUCENE-9856
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: general/build
>Reporter: Zach Chen
>Priority: Minor
>  Labels: build
> Attachments: LUCENE-9856.patch
>
>  Time Spent: 4h
>  Remaining Estimate: 0h
>
> When working on PR [https://github.com/apache/lucene/pull/25,] we noticed 
> that some dead code is not being caught during static analysis in gradle 
> build, such as the *start* variable in the following code: 
> [https://github.com/apache/lucene/blob/a5996dbecd4a6b4147d961260711a2cb6aeab3d3/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java#L446-L456]
>  
> We may need to look at if additional javac compiler flag, or configuration 
> for *error prone,* should be added to catch such bug as well as other 
> potential ones.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (LUCENE-9856) Improve static analysis to catch dead code and other potential bugs

2021-03-23 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/LUCENE-9856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17307019#comment-17307019
 ] 

ASF subversion and git services commented on LUCENE-9856:
-

Commit 278f23cc9a18787eeaf1e216c53670fd751b8f44 in lucene's branch 
refs/heads/jira/LUCENE-9856-static-analysis from Robert Muir
[ https://gitbox.apache.org/repos/asf?p=lucene.git;h=278f23c ]

LUCENE-9856: minor tweaks

TestAnalyzers tests doesn't need asserts, it had
SuppressWarnings("unused") the whole time, so we can revert the changes
since this is now respected.

Gradle has single quotes instead of double quotes, 30 minutes later :)


> Improve static analysis to catch dead code and other potential bugs
> ---
>
> Key: LUCENE-9856
> URL: https://issues.apache.org/jira/browse/LUCENE-9856
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: general/build
>Reporter: Zach Chen
>Priority: Minor
>  Labels: build
> Attachments: LUCENE-9856.patch
>
>  Time Spent: 4h
>  Remaining Estimate: 0h
>
> When working on PR [https://github.com/apache/lucene/pull/25,] we noticed 
> that some dead code is not being caught during static analysis in gradle 
> build, such as the *start* variable in the following code: 
> [https://github.com/apache/lucene/blob/a5996dbecd4a6b4147d961260711a2cb6aeab3d3/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java#L446-L456]
>  
> We may need to look at if additional javac compiler flag, or configuration 
> for *error prone,* should be added to catch such bug as well as other 
> potential ones.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (LUCENE-9856) Improve static analysis to catch dead code and other potential bugs

2021-03-23 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/LUCENE-9856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17307018#comment-17307018
 ] 

ASF subversion and git services commented on LUCENE-9856:
-

Commit 1286ae206819d44830dbb8c703a534f449f5d7b1 in lucene's branch 
refs/heads/jira/LUCENE-9856-static-analysis from Robert Muir
[ https://gitbox.apache.org/repos/asf?p=lucene.git;h=1286ae2 ]

Merge branch 'main' into jira/LUCENE-9856-static-analysis


> Improve static analysis to catch dead code and other potential bugs
> ---
>
> Key: LUCENE-9856
> URL: https://issues.apache.org/jira/browse/LUCENE-9856
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: general/build
>Reporter: Zach Chen
>Priority: Minor
>  Labels: build
> Attachments: LUCENE-9856.patch
>
>  Time Spent: 4h
>  Remaining Estimate: 0h
>
> When working on PR [https://github.com/apache/lucene/pull/25,] we noticed 
> that some dead code is not being caught during static analysis in gradle 
> build, such as the *start* variable in the following code: 
> [https://github.com/apache/lucene/blob/a5996dbecd4a6b4147d961260711a2cb6aeab3d3/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java#L446-L456]
>  
> We may need to look at if additional javac compiler flag, or configuration 
> for *error prone,* should be added to catch such bug as well as other 
> potential ones.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (LUCENE-9856) Improve static analysis to catch dead code and other potential bugs

2021-03-22 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/LUCENE-9856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17306761#comment-17306761
 ] 

ASF subversion and git services commented on LUCENE-9856:
-

Commit 099184ac819b2119f0f4e66fa55da2cfb1fca05f in lucene's branch 
refs/heads/jira/LUCENE-9856-static-analysis from Robert Muir
[ https://gitbox.apache.org/repos/asf?p=lucene.git;h=099184a ]

LUCENE-9856: override equals = must override hashcode too, @deprecated must 
@Deprecated too

Easy ones to enforce since nothing fails.


> Improve static analysis to catch dead code and other potential bugs
> ---
>
> Key: LUCENE-9856
> URL: https://issues.apache.org/jira/browse/LUCENE-9856
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: general/build
>Reporter: Zach Chen
>Priority: Minor
>  Labels: build
> Attachments: LUCENE-9856.patch
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> When working on PR [https://github.com/apache/lucene/pull/25,] we noticed 
> that some dead code is not being caught during static analysis in gradle 
> build, such as the *start* variable in the following code: 
> [https://github.com/apache/lucene/blob/a5996dbecd4a6b4147d961260711a2cb6aeab3d3/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java#L446-L456]
>  
> We may need to look at if additional javac compiler flag, or configuration 
> for *error prone,* should be added to catch such bug as well as other 
> potential ones.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (LUCENE-9856) Improve static analysis to catch dead code and other potential bugs

2021-03-22 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/LUCENE-9856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17306738#comment-17306738
 ] 

ASF subversion and git services commented on LUCENE-9856:
-

Commit 7d823c84e3f7b6bebd25eda76f9e482016c78868 in lucene's branch 
refs/heads/jira/LUCENE-9856-static-analysis from Robert Muir
[ https://gitbox.apache.org/repos/asf?p=lucene.git;h=7d823c8 ]

LUCENE-9856: enable/fix more unnecessary code detection in linter


> Improve static analysis to catch dead code and other potential bugs
> ---
>
> Key: LUCENE-9856
> URL: https://issues.apache.org/jira/browse/LUCENE-9856
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: general/build
>Reporter: Zach Chen
>Priority: Minor
>  Labels: build
> Attachments: LUCENE-9856.patch
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> When working on PR [https://github.com/apache/lucene/pull/25,] we noticed 
> that some dead code is not being caught during static analysis in gradle 
> build, such as the *start* variable in the following code: 
> [https://github.com/apache/lucene/blob/a5996dbecd4a6b4147d961260711a2cb6aeab3d3/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java#L446-L456]
>  
> We may need to look at if additional javac compiler flag, or configuration 
> for *error prone,* should be added to catch such bug as well as other 
> potential ones.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (LUCENE-9856) Improve static analysis to catch dead code and other potential bugs

2021-03-22 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/LUCENE-9856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17306721#comment-17306721
 ] 

ASF subversion and git services commented on LUCENE-9856:
-

Commit cef6b73baa8bb9ce39f34b1ce3acbfe9a3a18bd4 in lucene's branch 
refs/heads/jira/LUCENE-9856-static-analysis from Robert Muir
[ https://gitbox.apache.org/repos/asf?p=lucene.git;h=cef6b73 ]

LUCENE-9856: enable unusedPrivateMember and suppress(unused) more gen'd code

Including that monster DFA.


> Improve static analysis to catch dead code and other potential bugs
> ---
>
> Key: LUCENE-9856
> URL: https://issues.apache.org/jira/browse/LUCENE-9856
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: general/build
>Reporter: Zach Chen
>Priority: Minor
>  Labels: build
> Attachments: LUCENE-9856.patch
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> When working on PR [https://github.com/apache/lucene/pull/25,] we noticed 
> that some dead code is not being caught during static analysis in gradle 
> build, such as the *start* variable in the following code: 
> [https://github.com/apache/lucene/blob/a5996dbecd4a6b4147d961260711a2cb6aeab3d3/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java#L446-L456]
>  
> We may need to look at if additional javac compiler flag, or configuration 
> for *error prone,* should be added to catch such bug as well as other 
> potential ones.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (LUCENE-9856) Improve static analysis to catch dead code and other potential bugs

2021-03-22 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/LUCENE-9856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17306709#comment-17306709
 ] 

ASF subversion and git services commented on LUCENE-9856:
-

Commit 0cda832a03e8e118269ff1e4278cfbf2c6a1f444 in lucene's branch 
refs/heads/jira/LUCENE-9856-static-analysis from Robert Muir
[ https://gitbox.apache.org/repos/asf?p=lucene.git;h=0cda832 ]

LUCENE-9856: remove dead code (unusedInstance)

Also update ecj to latest for the latest checks.

The new check is not yet enabled, need to address generated code. But it
is very productive...


> Improve static analysis to catch dead code and other potential bugs
> ---
>
> Key: LUCENE-9856
> URL: https://issues.apache.org/jira/browse/LUCENE-9856
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: general/build
>Reporter: Zach Chen
>Priority: Minor
>  Labels: build
> Attachments: LUCENE-9856.patch
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> When working on PR [https://github.com/apache/lucene/pull/25,] we noticed 
> that some dead code is not being caught during static analysis in gradle 
> build, such as the *start* variable in the following code: 
> [https://github.com/apache/lucene/blob/a5996dbecd4a6b4147d961260711a2cb6aeab3d3/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java#L446-L456]
>  
> We may need to look at if additional javac compiler flag, or configuration 
> for *error prone,* should be added to catch such bug as well as other 
> potential ones.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (LUCENE-9856) Improve static analysis to catch dead code and other potential bugs

2021-03-22 Thread Robert Muir (Jira)


[ 
https://issues.apache.org/jira/browse/LUCENE-9856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17306677#comment-17306677
 ] 

Robert Muir commented on LUCENE-9856:
-

While wrestling with the PR, I found out about 
{{org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled}}. So we 
were able to do it a lot easier (e.g. add {{SuppressWarnings("unused")}} to 
generated code). I don't think there is a need for any per-module config for 
this linter anymore.

> Improve static analysis to catch dead code and other potential bugs
> ---
>
> Key: LUCENE-9856
> URL: https://issues.apache.org/jira/browse/LUCENE-9856
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: general/build
>Reporter: Zach Chen
>Priority: Minor
>  Labels: build
> Attachments: LUCENE-9856.patch
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> When working on PR [https://github.com/apache/lucene/pull/25,] we noticed 
> that some dead code is not being caught during static analysis in gradle 
> build, such as the *start* variable in the following code: 
> [https://github.com/apache/lucene/blob/a5996dbecd4a6b4147d961260711a2cb6aeab3d3/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java#L446-L456]
>  
> We may need to look at if additional javac compiler flag, or configuration 
> for *error prone,* should be added to catch such bug as well as other 
> potential ones.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (LUCENE-9856) Improve static analysis to catch dead code and other potential bugs

2021-03-22 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/LUCENE-9856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17306673#comment-17306673
 ] 

ASF subversion and git services commented on LUCENE-9856:
-

Commit 8e569166bfd1316733370057021917108a3757f4 in lucene's branch 
refs/heads/jira/LUCENE-9856-static-analysis from Robert Muir
[ https://gitbox.apache.org/repos/asf?p=lucene.git;h=8e56916 ]

LUCENE-9856: fix gradlew regenerate (broken for py 3.9), fix javacc 
regeneration to suppress warnings

Also add the changed config items to the eclipse IDE config.


> Improve static analysis to catch dead code and other potential bugs
> ---
>
> Key: LUCENE-9856
> URL: https://issues.apache.org/jira/browse/LUCENE-9856
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: general/build
>Reporter: Zach Chen
>Priority: Minor
>  Labels: build
> Attachments: LUCENE-9856.patch
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> When working on PR [https://github.com/apache/lucene/pull/25,] we noticed 
> that some dead code is not being caught during static analysis in gradle 
> build, such as the *start* variable in the following code: 
> [https://github.com/apache/lucene/blob/a5996dbecd4a6b4147d961260711a2cb6aeab3d3/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java#L446-L456]
>  
> We may need to look at if additional javac compiler flag, or configuration 
> for *error prone,* should be added to catch such bug as well as other 
> potential ones.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (LUCENE-9856) Improve static analysis to catch dead code and other potential bugs

2021-03-22 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/LUCENE-9856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17306663#comment-17306663
 ] 

ASF subversion and git services commented on LUCENE-9856:
-

Commit 4f5f47152553d53c626be48f186efb446b704838 in lucene's branch 
refs/heads/jira/LUCENE-9856-static-analysis from Robert Muir
[ https://gitbox.apache.org/repos/asf?p=lucene.git;h=4f5f471 ]

LUCENE-9856: allow SuppressWarnings("unused") to disable unusedLocal check via 
secret ecj option!

Still need to fix queryparser, but this fixes expressions


> Improve static analysis to catch dead code and other potential bugs
> ---
>
> Key: LUCENE-9856
> URL: https://issues.apache.org/jira/browse/LUCENE-9856
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: general/build
>Reporter: Zach Chen
>Priority: Minor
>  Labels: build
> Attachments: LUCENE-9856.patch
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> When working on PR [https://github.com/apache/lucene/pull/25,] we noticed 
> that some dead code is not being caught during static analysis in gradle 
> build, such as the *start* variable in the following code: 
> [https://github.com/apache/lucene/blob/a5996dbecd4a6b4147d961260711a2cb6aeab3d3/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java#L446-L456]
>  
> We may need to look at if additional javac compiler flag, or configuration 
> for *error prone,* should be added to catch such bug as well as other 
> potential ones.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (LUCENE-9856) Improve static analysis to catch dead code and other potential bugs

2021-03-22 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/LUCENE-9856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17306662#comment-17306662
 ] 

ASF subversion and git services commented on LUCENE-9856:
-

Commit 24ee3e1d97276698df73b9bbde9be78fab70f905 in lucene's branch 
refs/heads/jira/LUCENE-9856-static-analysis from Robert Muir
[ https://gitbox.apache.org/repos/asf?p=lucene.git;h=24ee3e1 ]

Revert "LUCENE-9856: add module-specific overrides"

This reverts commit 66afbd682492e5209047dbe37afb138d9dadd479.


> Improve static analysis to catch dead code and other potential bugs
> ---
>
> Key: LUCENE-9856
> URL: https://issues.apache.org/jira/browse/LUCENE-9856
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: general/build
>Reporter: Zach Chen
>Priority: Minor
>  Labels: build
> Attachments: LUCENE-9856.patch
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> When working on PR [https://github.com/apache/lucene/pull/25,] we noticed 
> that some dead code is not being caught during static analysis in gradle 
> build, such as the *start* variable in the following code: 
> [https://github.com/apache/lucene/blob/a5996dbecd4a6b4147d961260711a2cb6aeab3d3/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java#L446-L456]
>  
> We may need to look at if additional javac compiler flag, or configuration 
> for *error prone,* should be added to catch such bug as well as other 
> potential ones.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (LUCENE-9856) Improve static analysis to catch dead code and other potential bugs

2021-03-22 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/LUCENE-9856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17306650#comment-17306650
 ] 

ASF subversion and git services commented on LUCENE-9856:
-

Commit 3bbfdcdb459dffe377f01ef94a95a3da94c12a72 in lucene's branch 
refs/heads/jira/LUCENE-9856-static-analysis from Robert Muir
[ https://gitbox.apache.org/repos/asf?p=lucene.git;h=3bbfdcd ]

Merge branch 'main' into jira/LUCENE-9856-static-analysis


> Improve static analysis to catch dead code and other potential bugs
> ---
>
> Key: LUCENE-9856
> URL: https://issues.apache.org/jira/browse/LUCENE-9856
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: general/build
>Reporter: Zach Chen
>Priority: Minor
>  Labels: build
> Attachments: LUCENE-9856.patch
>
>
> When working on PR [https://github.com/apache/lucene/pull/25,] we noticed 
> that some dead code is not being caught during static analysis in gradle 
> build, such as the *start* variable in the following code: 
> [https://github.com/apache/lucene/blob/a5996dbecd4a6b4147d961260711a2cb6aeab3d3/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java#L446-L456]
>  
> We may need to look at if additional javac compiler flag, or configuration 
> for *error prone,* should be added to catch such bug as well as other 
> potential ones.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (LUCENE-9856) Improve static analysis to catch dead code and other potential bugs

2021-03-22 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/LUCENE-9856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17306649#comment-17306649
 ] 

ASF subversion and git services commented on LUCENE-9856:
-

Commit 66afbd682492e5209047dbe37afb138d9dadd479 in lucene's branch 
refs/heads/jira/LUCENE-9856-static-analysis from Robert Muir
[ https://gitbox.apache.org/repos/asf?p=lucene.git;h=66afbd6 ]

LUCENE-9856: add module-specific overrides

I am sure it can be done more "groovy" and needs to be rewritten, but it works.


> Improve static analysis to catch dead code and other potential bugs
> ---
>
> Key: LUCENE-9856
> URL: https://issues.apache.org/jira/browse/LUCENE-9856
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: general/build
>Reporter: Zach Chen
>Priority: Minor
>  Labels: build
> Attachments: LUCENE-9856.patch
>
>
> When working on PR [https://github.com/apache/lucene/pull/25,] we noticed 
> that some dead code is not being caught during static analysis in gradle 
> build, such as the *start* variable in the following code: 
> [https://github.com/apache/lucene/blob/a5996dbecd4a6b4147d961260711a2cb6aeab3d3/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java#L446-L456]
>  
> We may need to look at if additional javac compiler flag, or configuration 
> for *error prone,* should be added to catch such bug as well as other 
> potential ones.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (LUCENE-9856) Improve static analysis to catch dead code and other potential bugs

2021-03-22 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/LUCENE-9856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17306624#comment-17306624
 ] 

ASF subversion and git services commented on LUCENE-9856:
-

Commit e14a679e908bdb34eb4c677c11b8d0d60ba05dc3 in lucene's branch 
refs/heads/jira/LUCENE-9856-static-analysis from Robert Muir
[ https://gitbox.apache.org/repos/asf?p=lucene.git;h=e14a679 ]

LUCENE-9856: remove more unused local variables

This fixes all the instances, except for the ones in generated code.


> Improve static analysis to catch dead code and other potential bugs
> ---
>
> Key: LUCENE-9856
> URL: https://issues.apache.org/jira/browse/LUCENE-9856
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: general/build
>Reporter: Zach Chen
>Priority: Minor
>  Labels: build
> Attachments: LUCENE-9856.patch
>
>
> When working on PR [https://github.com/apache/lucene/pull/25,] we noticed 
> that some dead code is not being caught during static analysis in gradle 
> build, such as the *start* variable in the following code: 
> [https://github.com/apache/lucene/blob/a5996dbecd4a6b4147d961260711a2cb6aeab3d3/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java#L446-L456]
>  
> We may need to look at if additional javac compiler flag, or configuration 
> for *error prone,* should be added to catch such bug as well as other 
> potential ones.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (LUCENE-9856) Improve static analysis to catch dead code and other potential bugs

2021-03-22 Thread Dawid Weiss (Jira)


[ 
https://issues.apache.org/jira/browse/LUCENE-9856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17306297#comment-17306297
 ] 

Dawid Weiss commented on LUCENE-9856:
-

Ok, let's leave it for later. Your snippet is pretty much what it should look 
like. You could make it more compact by creating a table of 
project-config.closure pairs but I like the explicit version (even if longer).

> Improve static analysis to catch dead code and other potential bugs
> ---
>
> Key: LUCENE-9856
> URL: https://issues.apache.org/jira/browse/LUCENE-9856
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: general/build
>Reporter: Zach Chen
>Priority: Minor
>  Labels: build
> Attachments: LUCENE-9856.patch
>
>
> When working on PR [https://github.com/apache/lucene/pull/25,] we noticed 
> that some dead code is not being caught during static analysis in gradle 
> build, such as the *start* variable in the following code: 
> [https://github.com/apache/lucene/blob/a5996dbecd4a6b4147d961260711a2cb6aeab3d3/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java#L446-L456]
>  
> We may need to look at if additional javac compiler flag, or configuration 
> for *error prone,* should be added to catch such bug as well as other 
> potential ones.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (LUCENE-9856) Improve static analysis to catch dead code and other potential bugs

2021-03-22 Thread Robert Muir (Jira)


[ 
https://issues.apache.org/jira/browse/LUCENE-9856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17306290#comment-17306290
 ] 

Robert Muir commented on LUCENE-9856:
-

{quote}
This aside, maybe we should return to the idea of the generated code living in 
a separate source set?... one that is not subject to formatting, extra 
validations, etc? I see some benefit in keeping it neat but it's also, you 
know, generated code... 
{quote}

Personally I don't know the implications of this, it seems a bit difficult for 
my weak gradle kung-fu skills. On the other hand implementing the 
properties-based stuff, following Tomoko's lead for the per-module javadocs 
options, that's something i might be able to help with.

The problem is not just the generated code: there are 140 or some violations 
for just this one simple check. In general, enabling any check is a large 
effort if we want to fix 100% of the codebase. So if we can iterate per-module 
and fix them incrementally, we make progess.

> Improve static analysis to catch dead code and other potential bugs
> ---
>
> Key: LUCENE-9856
> URL: https://issues.apache.org/jira/browse/LUCENE-9856
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: general/build
>Reporter: Zach Chen
>Priority: Minor
>  Labels: build
> Attachments: LUCENE-9856.patch
>
>
> When working on PR [https://github.com/apache/lucene/pull/25,] we noticed 
> that some dead code is not being caught during static analysis in gradle 
> build, such as the *start* variable in the following code: 
> [https://github.com/apache/lucene/blob/a5996dbecd4a6b4147d961260711a2cb6aeab3d3/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java#L446-L456]
>  
> We may need to look at if additional javac compiler flag, or configuration 
> for *error prone,* should be added to catch such bug as well as other 
> potential ones.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (LUCENE-9856) Improve static analysis to catch dead code and other potential bugs

2021-03-22 Thread Robert Muir (Jira)


[ 
https://issues.apache.org/jira/browse/LUCENE-9856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17306287#comment-17306287
 ] 

Robert Muir commented on LUCENE-9856:
-

So in pseudocode something like this (similar to how we handle javadocs checks):

{noformat}
configure(project(":lucene:queryParser")) {
  project.tasks.withType(EcjLintTask) {
// TODO: fix generated code
org.eclipse.jdt.core.compiler.problem.unusedLocal = "ignore"
// TODO: fix some other problem
org.eclipse.jdk.core.compiler.problem.someOtherCheck = "ignore"
  }
}

configure(project(":lucene:expressions")) {
  project.tasks.withType(EcjLintTask) {
// TODO: fix generated code
org.eclipse.jdt.core.compiler.problem.unusedLocal = "ignore"
  }
}
{noformat}

> Improve static analysis to catch dead code and other potential bugs
> ---
>
> Key: LUCENE-9856
> URL: https://issues.apache.org/jira/browse/LUCENE-9856
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: general/build
>Reporter: Zach Chen
>Priority: Minor
>  Labels: build
> Attachments: LUCENE-9856.patch
>
>
> When working on PR [https://github.com/apache/lucene/pull/25,] we noticed 
> that some dead code is not being caught during static analysis in gradle 
> build, such as the *start* variable in the following code: 
> [https://github.com/apache/lucene/blob/a5996dbecd4a6b4147d961260711a2cb6aeab3d3/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java#L446-L456]
>  
> We may need to look at if additional javac compiler flag, or configuration 
> for *error prone,* should be added to catch such bug as well as other 
> potential ones.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (LUCENE-9856) Improve static analysis to catch dead code and other potential bugs

2021-03-22 Thread Dawid Weiss (Jira)


[ 
https://issues.apache.org/jira/browse/LUCENE-9856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17306285#comment-17306285
 ] 

Dawid Weiss commented on LUCENE-9856:
-

The pattern will be similar – apply the right configuration per-module. We use 
this for other things across the build too.

This aside, maybe we should return to the idea of the generated code living in 
a separate source set?... one that is not subject to formatting, extra 
validations, etc? I see some benefit in keeping it neat but it's also, you 
know, generated code... 

> Improve static analysis to catch dead code and other potential bugs
> ---
>
> Key: LUCENE-9856
> URL: https://issues.apache.org/jira/browse/LUCENE-9856
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: general/build
>Reporter: Zach Chen
>Priority: Minor
>  Labels: build
> Attachments: LUCENE-9856.patch
>
>
> When working on PR [https://github.com/apache/lucene/pull/25,] we noticed 
> that some dead code is not being caught during static analysis in gradle 
> build, such as the *start* variable in the following code: 
> [https://github.com/apache/lucene/blob/a5996dbecd4a6b4147d961260711a2cb6aeab3d3/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java#L446-L456]
>  
> We may need to look at if additional javac compiler flag, or configuration 
> for *error prone,* should be added to catch such bug as well as other 
> potential ones.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (LUCENE-9856) Improve static analysis to catch dead code and other potential bugs

2021-03-22 Thread Robert Muir (Jira)


[ 
https://issues.apache.org/jira/browse/LUCENE-9856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17306283#comment-17306283
 ] 

Robert Muir commented on LUCENE-9856:
-

[~dweiss] i don't want to disable *entire ecj linter* for whole modules, that's 
a bit too nuclear.

Instead I just want to "map-merge" configs on top of our base configuration, 
rather than have a static file:
e.g. I'd like to set 
{{org.eclipse.jdt.core.compiler.problem.unusedLocal=error}} across the board, 
but set {{org.eclipse.jdt.core.compiler.problem.unusedLocal=ignore}} for the 
queryparser and expression modules, until we have a chance to address the 
generated code (maybe it requires antlr upgrade or something, etc)

I think it is likely a very simple use of java Properties class here to do this.

> Improve static analysis to catch dead code and other potential bugs
> ---
>
> Key: LUCENE-9856
> URL: https://issues.apache.org/jira/browse/LUCENE-9856
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: general/build
>Reporter: Zach Chen
>Priority: Minor
>  Labels: build
> Attachments: LUCENE-9856.patch
>
>
> When working on PR [https://github.com/apache/lucene/pull/25,] we noticed 
> that some dead code is not being caught during static analysis in gradle 
> build, such as the *start* variable in the following code: 
> [https://github.com/apache/lucene/blob/a5996dbecd4a6b4147d961260711a2cb6aeab3d3/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java#L446-L456]
>  
> We may need to look at if additional javac compiler flag, or configuration 
> for *error prone,* should be added to catch such bug as well as other 
> potential ones.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (LUCENE-9856) Improve static analysis to catch dead code and other potential bugs

2021-03-22 Thread Dawid Weiss (Jira)


[ 
https://issues.apache.org/jira/browse/LUCENE-9856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17306271#comment-17306271
 ] 

Dawid Weiss commented on LUCENE-9856:
-

No magic is needed as ecj runs per-module (subproject) already... you'd have to 
disable the linter task for each project where there are offenders - this can 
be done like here (omit the source-exclusion part and look at ecjLint is 
disabled for the configuration of project solr-core:

[https://github.com/apache/solr/blob/main/gradle/solr-tlp-migration/inaccessible-test-sources.gradle#L20-L37]

 

 

> Improve static analysis to catch dead code and other potential bugs
> ---
>
> Key: LUCENE-9856
> URL: https://issues.apache.org/jira/browse/LUCENE-9856
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: general/build
>Reporter: Zach Chen
>Priority: Minor
>  Labels: build
> Attachments: LUCENE-9856.patch
>
>
> When working on PR [https://github.com/apache/lucene/pull/25,] we noticed 
> that some dead code is not being caught during static analysis in gradle 
> build, such as the *start* variable in the following code: 
> [https://github.com/apache/lucene/blob/a5996dbecd4a6b4147d961260711a2cb6aeab3d3/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java#L446-L456]
>  
> We may need to look at if additional javac compiler flag, or configuration 
> for *error prone,* should be added to catch such bug as well as other 
> potential ones.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (LUCENE-9856) Improve static analysis to catch dead code and other potential bugs

2021-03-22 Thread Michael McCandless (Jira)


[ 
https://issues.apache.org/jira/browse/LUCENE-9856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17306269#comment-17306269
 ] 

Michael McCandless commented on LUCENE-9856:


OK I think I succeeded!  
https://git-wip-us.apache.org/repos/asf?p=lucene.git;a=shortlog;h=refs/heads/jira/LUCENE-9856-static-analysis

> Improve static analysis to catch dead code and other potential bugs
> ---
>
> Key: LUCENE-9856
> URL: https://issues.apache.org/jira/browse/LUCENE-9856
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: general/build
>Reporter: Zach Chen
>Priority: Minor
>  Labels: build
> Attachments: LUCENE-9856.patch
>
>
> When working on PR [https://github.com/apache/lucene/pull/25,] we noticed 
> that some dead code is not being caught during static analysis in gradle 
> build, such as the *start* variable in the following code: 
> [https://github.com/apache/lucene/blob/a5996dbecd4a6b4147d961260711a2cb6aeab3d3/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java#L446-L456]
>  
> We may need to look at if additional javac compiler flag, or configuration 
> for *error prone,* should be added to catch such bug as well as other 
> potential ones.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (LUCENE-9856) Improve static analysis to catch dead code and other potential bugs

2021-03-22 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/LUCENE-9856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17306265#comment-17306265
 ] 

ASF subversion and git services commented on LUCENE-9856:
-

Commit 658a84b627869f80c38d027fbebf044c702b9cfc in lucene's branch 
refs/heads/jira/LUCENE-9856-static-analysis from Michael McCandless
[ https://gitbox.apache.org/repos/asf?p=lucene.git;h=658a84b ]

LUCENE-9856: fix a few unused local variables


> Improve static analysis to catch dead code and other potential bugs
> ---
>
> Key: LUCENE-9856
> URL: https://issues.apache.org/jira/browse/LUCENE-9856
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: general/build
>Reporter: Zach Chen
>Priority: Minor
>  Labels: build
> Attachments: LUCENE-9856.patch
>
>
> When working on PR [https://github.com/apache/lucene/pull/25,] we noticed 
> that some dead code is not being caught during static analysis in gradle 
> build, such as the *start* variable in the following code: 
> [https://github.com/apache/lucene/blob/a5996dbecd4a6b4147d961260711a2cb6aeab3d3/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java#L446-L456]
>  
> We may need to look at if additional javac compiler flag, or configuration 
> for *error prone,* should be added to catch such bug as well as other 
> potential ones.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (LUCENE-9856) Improve static analysis to catch dead code and other potential bugs

2021-03-22 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/LUCENE-9856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17306264#comment-17306264
 ] 

ASF subversion and git services commented on LUCENE-9856:
-

Commit f2e3c702e9ac90abde672264c563e7d49cd8be50 in lucene's branch 
refs/heads/jira/LUCENE-9856-static-analysis from Michael McCandless
[ https://gitbox.apache.org/repos/asf?p=lucene.git;h=f2e3c70 ]

LUCENE-9856: enable ecj unused local variable detection; run 'gradle ecjLint' 
to see all problems


> Improve static analysis to catch dead code and other potential bugs
> ---
>
> Key: LUCENE-9856
> URL: https://issues.apache.org/jira/browse/LUCENE-9856
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: general/build
>Reporter: Zach Chen
>Priority: Minor
>  Labels: build
> Attachments: LUCENE-9856.patch
>
>
> When working on PR [https://github.com/apache/lucene/pull/25,] we noticed 
> that some dead code is not being caught during static analysis in gradle 
> build, such as the *start* variable in the following code: 
> [https://github.com/apache/lucene/blob/a5996dbecd4a6b4147d961260711a2cb6aeab3d3/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java#L446-L456]
>  
> We may need to look at if additional javac compiler flag, or configuration 
> for *error prone,* should be added to catch such bug as well as other 
> potential ones.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (LUCENE-9856) Improve static analysis to catch dead code and other potential bugs

2021-03-22 Thread Michael McCandless (Jira)


[ 
https://issues.apache.org/jira/browse/LUCENE-9856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17306234#comment-17306234
 ] 

Michael McCandless commented on LUCENE-9856:


I will cut a branch!  Let's start with your simple patch [~rcmuir] and then 
maybe someone can figure out {{gradle}} magic to make the checking per-module, 
and then we can progress-not-perfection it?

> Improve static analysis to catch dead code and other potential bugs
> ---
>
> Key: LUCENE-9856
> URL: https://issues.apache.org/jira/browse/LUCENE-9856
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: general/build
>Reporter: Zach Chen
>Priority: Minor
>  Labels: build
> Attachments: LUCENE-9856.patch
>
>
> When working on PR [https://github.com/apache/lucene/pull/25,] we noticed 
> that some dead code is not being caught during static analysis in gradle 
> build, such as the *start* variable in the following code: 
> [https://github.com/apache/lucene/blob/a5996dbecd4a6b4147d961260711a2cb6aeab3d3/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java#L446-L456]
>  
> We may need to look at if additional javac compiler flag, or configuration 
> for *error prone,* should be added to catch such bug as well as other 
> potential ones.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (LUCENE-9856) Improve static analysis to catch dead code and other potential bugs

2021-03-21 Thread Robert Muir (Jira)


[ 
https://issues.apache.org/jira/browse/LUCENE-9856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17305892#comment-17305892
 ] 

Robert Muir commented on LUCENE-9856:
-

I enabled the same enforced settings for the IDE in 
{{gradle/ide/eclipse/dot.settings/org.eclipse.jdt.core.prefs}}. 

But it shows around 140 errors in source and tests.
Some of the unused warnings are in scary code :)
Worst yet, of these unused variables are in generated code (antlr, javacc, etc).
I don't know that any SuppressWarning is available, the IDE doesn't suggest it, 
and "unused" doesn't do the trick.

I think we have to iterate: per-module is enough for now, a lot of the modules 
look easy to fix. Maybe we need to disable the check for modules that have 
problems, as some might take a long time?

Currently ecj-lint.gradle just uses a static preferences file. We would need to 
override it per-module for the modules with problems, like we do with the 
javadocs file: 
https://github.com/apache/lucene/blob/main/gradle/documentation/render-javadoc.gradle#L151

Except here we want to "template" the configuration file for each module I 
think. It is really just a mapping of key-value properties, so maybe there is 
an easy way to make progress here.


> Improve static analysis to catch dead code and other potential bugs
> ---
>
> Key: LUCENE-9856
> URL: https://issues.apache.org/jira/browse/LUCENE-9856
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: general/build
>Reporter: Zach Chen
>Priority: Minor
>  Labels: build
> Attachments: LUCENE-9856.patch
>
>
> When working on PR [https://github.com/apache/lucene/pull/25,] we noticed 
> that some dead code is not being caught during static analysis in gradle 
> build, such as the *start* variable in the following code: 
> [https://github.com/apache/lucene/blob/a5996dbecd4a6b4147d961260711a2cb6aeab3d3/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java#L446-L456]
>  
> We may need to look at if additional javac compiler flag, or configuration 
> for *error prone,* should be added to catch such bug as well as other 
> potential ones.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[jira] [Commented] (LUCENE-9856) Improve static analysis to catch dead code and other potential bugs

2021-03-21 Thread Robert Muir (Jira)


[ 
https://issues.apache.org/jira/browse/LUCENE-9856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17305873#comment-17305873
 ] 

Robert Muir commented on LUCENE-9856:
-

We can turn it on in ecjLint with a one-line change, so it fails at precommit 
in the facets module:

{noformat}
> Task :lucene:facet:ecjLintMain
--
1. ERROR in 
/home/rmuir/workspace/lucene/lucene/facet/src/java/org/apache/lucene/facet/LongValueFacetCounts.java
 (at line 221)
int doc;
^^^
The value of the local variable doc is not used
--
2. ERROR in 
/home/rmuir/workspace/lucene/lucene/facet/src/java/org/apache/lucene/facet/LongValueFacetCounts.java
 (at line 258)
int doc;
^^^
The value of the local variable doc is not used
--
--
3. ERROR in 
/home/rmuir/workspace/lucene/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java
 (at line 447)
int start;
^
The value of the local variable start is not used
--
{noformat}

The problem is, there are failures in multiple lucene modules. So we need to 
fix these or add appropriate {{SuppressWarnings}} to defer them?, so that we 
can engage the check and at least prevent new stuff from coming in.

> Improve static analysis to catch dead code and other potential bugs
> ---
>
> Key: LUCENE-9856
> URL: https://issues.apache.org/jira/browse/LUCENE-9856
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: general/build
>Reporter: Zach Chen
>Priority: Minor
>  Labels: build
>
> When working on PR [https://github.com/apache/lucene/pull/25,] we noticed 
> that some dead code is not being caught during static analysis in gradle 
> build, such as the *start* variable in the following code: 
> [https://github.com/apache/lucene/blob/a5996dbecd4a6b4147d961260711a2cb6aeab3d3/lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java#L446-L456]
>  
> We may need to look at if additional javac compiler flag, or configuration 
> for *error prone,* should be added to catch such bug as well as other 
> potential ones.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org