Uploaded image for project: 'Commons Logging'
  1. Commons Logging
  2. LOGGING-163

BufferedReader is not closed properly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.1.1, 1.2
    • 1.3.0
    • None

    Description

      In LogFactory class at line 552 there is BufferedReader that is not closed properly. For example if rd.readLine(); throw an exception then the Reader will remain open.

       BufferedReader rd;
      try {
          rd = new BufferedReader(new InputStreamReader(is, "UTF-8"));
       } catch (java.io.UnsupportedEncodingException e) {
           rd = new BufferedReader(new InputStreamReader(is));
      }
      
      String factoryClassName = rd.readLine();
      rd.close();
      

      In SimpleLog class at line 163 there is InputStream that is not closed properly.

              InputStream in = getResourceAsStream("simplelog.properties");
              if(null != in) {
                  try {
                      simpleLogProps.load(in);
                      in.close();
                  } catch(java.io.IOException e) {
                      // ignored
                  }
              }
      

      Attachments

        Activity

          People

            ggregory Gary D. Gregory
            kal0ian Kaloyan Spiridonov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: