[
https://issues.apache.org/jira/browse/CHUKWA-816?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15849338#comment-15849338
]
ASF GitHub Bot commented on CHUKWA-816:
---------------------------------------
GitHub user lifove opened a pull request:
https://github.com/apache/chukwa/pull/5
CHUKWA-816. Fix wrong use of incrementers in a for loop.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/lifove/chukwa master
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/chukwa/pull/5.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #5
----
commit d861af881a8c36d8e51a795f2056f376454b9514
Author: JC <[email protected]>
Date: 2017-02-02T03:23:48Z
CHUKWA-816. Fix wrong use of incrementers in a for loop.
----
> 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)