Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-7988

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Minor
    • None
    • 7.1.0.DR9
    • REST
    • 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: