You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@sentry.apache.org by "Sergio Peña (JIRA)" <ji...@apache.org> on 2017/07/10 15:30:00 UTC

[jira] [Resolved] (SENTRY-1664) HMSPaths compares strings using ==

     [ https://issues.apache.org/jira/browse/SENTRY-1664?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergio Peña resolved SENTRY-1664.
---------------------------------
    Resolution: Duplicate

> HMSPaths compares strings using ==
> ----------------------------------
>
>                 Key: SENTRY-1664
>                 URL: https://issues.apache.org/jira/browse/SENTRY-1664
>             Project: Sentry
>          Issue Type: Bug
>          Components: Sentry
>    Affects Versions: 1.8.0
>            Reporter: Alexander Kolbasov
>            Assignee: kalyan kumar kalvagadda
>            Priority: Minor
>              Labels: bite-sized, newbie
>
> HMSPaths contains the following code:
> {code}
>   void renameAuthzObject(String oldName, List<List<String>> oldPathElems,
>       String newName, List<List<String>> newPathElems) {
>     if ( oldPathElems == null || oldPathElems.size() == 0 || newPathElems == null || newPathElems.size() == 0
>             || newName == null || oldName == null || oldName == newName) {
>       return;
>     }
> {code}
> Note that it used oldName == newName comparison which isn't correct - it should use equals(). Also, instead of using size() it should use isEmpty()



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)