Bug 115099 - ImageSizer.computeImageSize(String) : a not null test lacks.
Summary: ImageSizer.computeImageSize(String) : a not null test lacks.
Keywords:
Status: CLOSED EOL
Alias: None
Product: Red Hat Web Application Framework
Classification: Retired
Component: other
Version: 6.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: ccm-bugs-list
QA Contact: Jon Orris
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-02-06 17:22 UTC by durnez
Modified: 2020-03-27 20:11 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-27 20:11:51 UTC
Embargoed:


Attachments (Terms of Use)

Description durnez 2004-02-06 17:22:38 UTC
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.