#vulnerable code 
                                @Override
    public List<BxDocument> getDocuments() throws TransformationException {
        TrueVizToBxDocumentReader tvReader = new TrueVizToBxDocumentReader();
        List<BxDocument> documents = new ArrayList<BxDocument>();

        for (File file : FileUtils.listFiles(directory, new String[]{"xml"}, true)) {
            InputStream is = null;
            try {
                is = new FileInputStream(file);
                List<BxPage> pages = tvReader.read(new InputStreamReader(is));
                BxDocument doc = new BxDocument();
                doc.setFilename(file.getName());
                doc.setPages(pages);
                documents.add(doc);
            } catch (FileNotFoundException ex) {
                throw new TransformationException(ex);
            } finally {
                if (is != null) {
                    try {
                        is.close();
                    } catch (IOException ex) {
                        throw new TransformationException("Cannot close stream!", ex);
                    }
                }
            }
        }

        return documents;
    } 
                            #location 10 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                @Override
    public List<BxDocument> getDocuments() throws TransformationException {
        TrueVizToBxDocumentReader tvReader = new TrueVizToBxDocumentReader();
        List<BxDocument> documents = new ArrayList<BxDocument>();

        for (File file : FileUtils.listFiles(directory, new String[]{"xml"}, true)) {
            InputStream is = null;
            try {
                is = new FileInputStream(file);
                List<BxPage> pages = tvReader.read(new InputStreamReader(is, "UTF-8"));
                BxDocument doc = new BxDocument();
                doc.setFilename(file.getName());
                doc.setPages(pages);
                documents.add(doc);
            } catch (FileNotFoundException ex) {
                throw new TransformationException(ex);
            } catch (UnsupportedEncodingException ex) {
                throw new TransformationException(ex);
            } finally {
                if (is != null) {
                    try {
                        is.close();
                    } catch (IOException ex) {
                        throw new TransformationException("Cannot close stream!", ex);
                    }
                }
            }
        }

        return documents;
    }