Jaechang Nam created CHUKWA-816:
-----------------------------------

             Summary: 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
            Reporter: Jaechang Nam
            Priority: Trivial


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)

Reply via email to