Bug 115099 - ImageSizer.computeImageSize(String) : a not null test lacks.
Summary: ImageSizer.computeImageSize(String) : a not null test lacks.
Status: NEW
Alias: None
Product: Red Hat Web Application Framework
Classification: Retired
Component: other (Show other bugs)
(Show other bugs)
Version: 6.0
Hardware: All Linux
medium
medium
Target Milestone: ---
Assignee: ccm-bugs-list
QA Contact: Jon Orris
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-02-06 17:22 UTC by durnez
Modified: 2008-05-01 15:39 UTC (History)
0 users

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)

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.