Bug 115099 - ImageSizer.computeImageSize(String) : a not null test lacks.
ImageSizer.computeImageSize(String) : a not null test lacks.
Status: NEW
Product: Red Hat Web Application Framework
Classification: Retired
Component: other (Show other bugs)
6.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: ccm-bugs-list
Jon Orris
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-02-06 12:22 EST by durnez
Modified: 2008-05-01 11:39 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description durnez 2004-02-06 12:22:38 EST
Description of problem:
com.arsdigita.mimetypes.image.ImageSizer(String path) :

public Dimension computeImageSize(String path) throws IOException 
{
        DataInputStream in = null;
        Dimension size = null;
        try {
            in = new DataInputStream(new FileInputStream(path));
            size = computeSize(in);
        } catch (IOException e) {
            throw e;
        } finally {
            in.close();
        }
        return size;
    }

In finally, in must be checked it is not null before closing it.
line 64 :
     in.close();
should must replaced by :
     if (in != null) in.close();

Version-Release number of selected component (if applicable):


How reproducible:
always

Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Note You need to log in before you can comment on or make changes to this bug.