Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
The parseXpmValuesSection method in the class XpmImageParser has the 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) { ...
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 &&