juddi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex O'Ree (JIRA)" <juddi-...@ws.apache.org>
Subject [jira] [Assigned] (JUDDI-967) Suspicious incrementers in for loops
Date Fri, 03 Feb 2017 00:53:51 GMT

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

Alex O'Ree reassigned JUDDI-967:
--------------------------------

    Assignee: Alex O'Ree

> Suspicious incrementers in for loops
> ------------------------------------
>
>                 Key: JUDDI-967
>                 URL: https://issues.apache.org/jira/browse/JUDDI-967
>             Project: jUDDI
>          Issue Type: Bug
>            Reporter: JC
>            Assignee: Alex O'Ree
>             Fix For: 3.3.4
>
>
> In recent github snapshot, I've found suspicious use of incrementers in for loops
> juddi-core/src/main/java/org/apache/juddi/validation/vsv/Uddiuddiorgcategorizationderivedfrom.java
> {code:java}
> 154                 for (int i = 0; i < items.size(); i++) {
> 155                         List<String> validValues = getValidValues();
> 156                         if (validValues != null) {
> 157                                 //ok we have some work to do
> 158                                 boolean valid = false;
> 159                                 for (int k = 0; k < validValues.size(); k++) {
> 160                                         if (validValues.get(i).equals(items.get(i).getKeyValue()))
{
> 161                                                 valid = true;
> 162                                         }
> 163                                 }
> 164                                 if (!valid) {
> 165                                         err += xpath + "keyedReference(" + i + ")
    ";
> 166                                 }
> 167                         }
> 168                 }
> {code}
> In Line 160, validValues.get( i ) should be validValues.get(j)?
> juddi-core/src/main/java/org/apache/juddi/validation/vsv/Uddiuddiorgidentifierisreplacedby.java
> {code:java}
> 303                 for (int i = 0; i < items.size(); i++) {
> 304                         List<String> validValues = getValidValues();
> 305                         if (validValues != null) {
> 306                                 //ok we have some work to do
> 307                                 boolean valid = false;
> 308                                 for (int k = 0; k < validValues.size(); k++) {
> 309                                         if (validValues.get(i).equals(items.get(i).getKeyValue()))
{
> 310                                                 valid = true;
> 311                                         }
> 312                                 }
> 313                                 if (!valid) {
> 314                                         err += xpath + "keyedReference(" + i + ")
    ";
> 315                                 }
> 316                         }
> 317                 }
> {code}
> In Line 309, validValues.get( i ) should be validValues.get(j)?
> When inner loops iterate, equals always compare the same objects.



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

Mime
View raw message