You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/08/18 23:57:00 UTC

[jira] [Commented] (DRILL-7780) Potentially Erroneous String Comparison by reference

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

ASF GitHub Bot commented on DRILL-7780:
---------------------------------------

nescohen opened a new pull request #2097:
URL: https://github.com/apache/drill/pull/2097


   # [DRILL-7780](https://issues.apache.org/jira/browse/DRILL-7780): Fix string reference comparisons
   
   ## Description
   
   Refactor string comparisons to prevent comparing string object references for equality. See [here](https://errorprone.info/bugpattern/ReferenceEquality) for more details.
   
   This instance was found using the Muse analysis platform (of which I am a developer). See other results [here](https://console.muse.dev/result/nescohen/drill/01EG1E4GWANR2JVAJQ9V9ZZ152?tab=results). Analysis of Drill has worked out of the box to deliver errorprone and infer results among other analyses. We should consider [enabling](https://github.com/marketplace/muse-dev) Muse for the project in general. This will cause Muse to leave comments on future pull requests like [this](https://github.com/TomMD/shiro/pull/2).
   
   ## Documentation
   
   No user visible changes, just stability improvement
   
   ## Testing
   
   Build with `mvn install`, observe unit tests pass
   


----------------------------------------------------------------
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:
users@infra.apache.org


> Potentially Erroneous String Comparison by reference
> ----------------------------------------------------
>
>                 Key: DRILL-7780
>                 URL: https://issues.apache.org/jira/browse/DRILL-7780
>             Project: Apache Drill
>          Issue Type: Bug
>            Reporter: Nes Cohen
>            Priority: Minor
>              Labels: easyfix, pull-request-available
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> Comparing strings in java by reference, even the empty string, can be problematic because two "equal" strings may be different objects with different references.
> This occurs notably in two locations:
> [https://github.com/apache/drill/blob/0726b83d9347cbb8bd1bc64a8d10c12c1125549a/exec/java-exec/src/main/java/org/apache/drill/exec/server/BootStrapContext.java#L142]
> [https://github.com/apache/drill/blob/0726b83d9347cbb8bd1bc64a8d10c12c1125549a/common/src/main/java/org/apache/drill/common/KerberosUtil.java#L50|https://github.com/nescohen/drill/blob/0726b83d9347cbb8bd1bc64a8d10c12c1125549a/common/src/main/java/org/apache/drill/common/KerberosUtil.java#L50]



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