You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "Uwe Schindler (Jira)" <ji...@apache.org> on 2021/03/23 17:01:00 UTC

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

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

Uwe Schindler edited comment on LUCENE-9856 at 3/23/21, 5:00 PM:
-----------------------------------------------------------------

{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 the code in groovy search/replace code more readable.


was (Author: thetaphi):
{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-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org