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

Sebb resolved IMAGING-189.
--------------------------
       Resolution: Fixed
    Fix Version/s: 1.0

URL: http://svn.apache.org/viewvc?rev=1763961&view=rev
Log:
IMAGING-189 - parseXpmValuesSection uses && instead of ||

Modified:
    commons/proper/imaging/trunk/src/changes/changes.xml
    
commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/xpm/XpmImageParser.java


> parseXpmValuesSection uses && instead of ||
> -------------------------------------------
>
>                 Key: IMAGING-189
>                 URL: https://issues.apache.org/jira/browse/IMAGING-189
>             Project: Commons Imaging
>          Issue Type: Bug
>            Reporter: Sebb
>             Fix For: 1.0
>
>
> The parseXpmValuesSection method in the class XpmImageParser has the code:
> {code}
>  if (tokens.length < 4 && tokens.length > 7) { // FindBugs reports this
>     throw new ImageReadException("Parsing XPM file failed, "
>          + "<Values> section has incorrect tokens");
> }
> ...
> // subsequent code
> if (tokens.length == 5 || tokens.length == 7) {
> ...
> {code}
> Findbugs points out that the second part of the condition is impossible.
> The code that follows the condition expects that tokens.length may be > 4, so 
> clearly the original condition should have used || rather than &&



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to