[ 
https://issues.apache.org/jira/browse/LUCENE-9856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=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

Reply via email to