commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] Created: (COLLECTIONS-319) IteratorUtils.getIterator(Object obj) performs redundant null check
Date Mon, 16 Feb 2009 19:36:02 GMT
IteratorUtils.getIterator(Object obj) performs redundant null check
-------------------------------------------------------------------

                 Key: COLLECTIONS-319
                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-319
             Project: Commons Collections
          Issue Type: Bug
          Components: Collection
            Reporter: Sebb
            Priority: Minor


IteratorUtils.getIterator(Object obj) performs redundant null check:

{code}
        if (obj == null) {
            return emptyIterator();            
...
        } else if (obj != null && obj.getClass().isArray()) {
            return new ArrayIterator(obj);
{code}

obj cannot be null at that point, so the check can be removed. 
[This will also prevent a false positive in Eclipse which later says tha obj may be null]

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


Mime
View raw message