#vulnerable code 
                                public BxDocument getDocument() throws TransformationException {
        InputStreamReader isr = new InputStreamReader(inputStream);

        TrueVizToBxDocumentReader reader = new TrueVizToBxDocumentReader();
        return new BxDocument().setPages(reader.read(isr));
    } 
                            #location 5 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                public BxDocument getDocument() throws TransformationException {
        InputStreamReader isr = null;
        try {
            isr = new InputStreamReader(inputStream, "UTF-8");
            TrueVizToBxDocumentReader reader = new TrueVizToBxDocumentReader();
            return new BxDocument().setPages(reader.read(isr));
        } catch (UnsupportedEncodingException ex) {
            throw new TransformationException("Unsupported encoding!", ex);
        } finally {
            try {
                if (isr != null) {
                    isr.close();
                }
            } catch (IOException ex) {
                Logger.getLogger(FileExtractor.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }