struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rickard Öberg (JIRA) <j...@apache.org>
Subject [jira] Created: (WW-1541) PropertiesSettings does not close properties files properly
Date Wed, 06 Dec 2006 12:31:00 GMT
PropertiesSettings does not close properties files properly
-----------------------------------------------------------

                 Key: WW-1541
                 URL: http://issues.apache.org/struts/browse/WW-1541
             Project: Struts 2
          Issue Type: Bug
    Affects Versions: 2.0.1
            Reporter: Rickard Öberg


PropertiesSettings does not close the stream to the properties file that is read. This causes
redeploy issues, since the properties file cannot be removed on undeploy. Fix the constructor
code like this:
InputStream inStream = null;
        try {
           inStream = settingsUrl.openStream();
            settings.load(inStream);
        } catch (IOException e) {
            throw new StrutsException("Could not load " + name + ".properties:" + e, e);
        } finally
        {
           if (inStream != null)
              try
              {
                 inStream.close();
              } catch (IOException e)
              {
                 // Ignore
              }
        }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

Mime
View raw message