Invocation of hasNext() on 
org.apache.camel.util.ObjectHelper.createIterator(...).new Iterator<Node>() 
{...} return different results
-------------------------------------------------------------------------------------------------------------------------------------

                 Key: CAMEL-2622
                 URL: https://issues.apache.org/activemq/browse/CAMEL-2622
             Project: Apache Camel
          Issue Type: Bug
          Components: camel-core
    Affects Versions: 2.2.0, 2.3.0
            Reporter: Sergey Zolotaryov
            Priority: Minor


{code}
                    public boolean hasNext() {
                        // empty string should not be regarded as having next
                        return ++idx == 0 && ObjectHelper.isNotEmpty(s);
                    }

                    public String next() {
                        return s;
                    }
{code}

This is incorrect. Should be:

{code}
                    public boolean hasNext() {
                        // empty string should not be regarded as having next
                        return idx+1 == 0 && ObjectHelper.isNotEmpty(s);
                    }

                    public String next() {
                                                idx++;
                        return s;
                    }
{code}


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to