chukwa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Yang (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CHUKWA-816) A suspicious use of incrementer in a for statement
Date Thu, 02 Feb 2017 04:52:51 GMT

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

Eric Yang updated CHUKWA-816:
-----------------------------
             Assignee: Jaechang Nam
        Fix Version/s: 0.9.0
    Affects Version/s: 0.6.0
                       0.7.0
                       0.8.0
               Status: Patch Available  (was: Open)

+1 looks good.

> A suspicious use of incrementer in a for statement
> --------------------------------------------------
>
>                 Key: CHUKWA-816
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-816
>             Project: Chukwa
>          Issue Type: Bug
>    Affects Versions: 0.8.0, 0.7.0, 0.6.0
>            Reporter: Jaechang Nam
>            Assignee: Jaechang Nam
>            Priority: Trivial
>             Fix For: 0.9.0
>
>
> Is this incorrect use of incrementers in this for statement?
> (From the recent snapshot in github mirror. Path: src/main/java/org/apache/hadoop/chukwa/rest/bean/WidgetBean.java
> In Line 170, plist[i] should be plist[j] and parameters[j] should be parameters[i]??
> {code:java}
> 167           for(int i=0;i<this.parameters.length;i++) {
> 168             Collection<String> value = this.parameters[i].getValue();
> 169             for(int j=0;j<plist.length;j++) {
> 170               if(plist[i].getName().intern()==this.parameters[j].getName().intern())
{
> 171                 plist[j].setValue(value);
> 172               }
> 173             }
> 174           }
> 175           this.parameters=plist;
> {code}
> Since I do not have domain knowledge, I have no idea if  parameters.length and plist.length
is always same. But, I thought it might be worth to report just in case.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message