rmuir commented on pull request #34:
URL: https://github.com/apache/lucene/pull/34#issuecomment-804859947


   > Thanks Robert for working on this! And yeah I didn't quite anticipate so 
much dead code lingering around when I created the issue! From your latest 
comment this PR is very much ready now? Any aspect I can still look into in 
this PR to help out as well at this point? (and sorry for coming in late in the 
discussion!)
   > 
   
   We may always followup with more checks. I mentioned a good one in my 
comment above, i'd really like to enforce that `@Override` annotation is used 
everywhere, to help prevent dead `public` and `protected` methods in the 
future? 
   
   In the preferences file, we would set 
`org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error` and 
then fix all the problems. It would be good as a standalone followup issue
   
   > In addition, I have a newbie question. It appears error prone was 
integrated fairly recently this year 
https://issues.apache.org/jira/browse/LUCENE-9497, but the issue itself didn't 
seems to mention why error prone was needed when there's already ecj lint, and 
which one should be preferred for which scenario. Is the plan to have both ecj 
& error prone to co-exist in Lucene to catch different kinds of bugs?
   
   I don't know the error-prone well, but it is more of a "static analysis 
tool": I immediately think that it leans towards heuristics and "false 
positives". 
   
   On the other hand, ECJ is a "compiler", but with a lot of nice checks. Maybe 
they are not as fancy as the kind of checks that error-prone might be able to 
do, instead they are simpler, more like "additional compiler warnings". We've 
used ECJ for a long time: It runs efficiently, has a TON more eyes looking at 
its output every day, and provides great error messages. IMO, for solving your 
problem of "my IDE can detect it is dead code, why doesn't the build", it is 
the perfect tool: since it is the thing doing that in your IDE (to my knowledge 
not just eclipse but intellij may use it too).


-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to