Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-1574

org.jboss.resteasy.spi.FactoryFinder doesn't close resources

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Minor
    • 3.1.1.Final
    • 3.1.0.Final
    • None
    • None

    Description

      In org.jboss.resteasy.spi.FactoryFinder:

      The FileInputStream is created, but not closed, this may cause a resource leak:

      if (f.exists()) {
         Properties props = new Properties();
         props.load(new FileInputStream(f));
         String factoryClassName = props.getProperty(factoryId);
         return newInstance(factoryClassName, classLoader);
      }
      

      The BufferedReader is not closed in case of IOException is thrown this may cause resource leak:

      if (is != null) {
              BufferedReader rd = new BufferedReader(new InputStreamReader(is, "UTF-8"));
      
              String factoryClassName = rd.readLine();
              rd.close();
      
              if (factoryClassName != null && !"".equals(factoryClassName)) {
              return newInstance(factoryClassName, classLoader);
              }
      }
      

      Attachments

        Issue Links

          Activity

            People

              psotirop@redhat.com Panagiotis Sotiropoulos
              kanovotn Katerina Odabasi (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: