Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-1541

PropertiesSettings does not close properties files properly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.1
    • 2.0.2
    • None
    • None
    • Patch

    Description

      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 }

      }

      Attachments

        Activity

          People

            ddewolf David H. DeWolf
            roberg Rickard Öberg
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: