#vulnerable code 
                                @Procedure(mode = Mode.READ)
    public Stream<StreamedStatement> streamRDF(@Name("url") String url, @Name("format") String format,
                                               @Name("props") Map<String, Object> props) {

        URLConnection urlConn;

        StatementStreamer statementStreamer = new StatementStreamer();
        try {
            urlConn = new URL(url).openConnection();
            if (props.containsKey("headerParams")) {
                ((Map<String, String>) props.get("headerParams")).forEach( (k,v) -> urlConn.setRequestProperty(k,v));
            }
            InputStream inputStream = urlConn.getInputStream();
            RDFFormat rdfFormat = getFormat(format);
            log.info("Data set to be parsed as " + rdfFormat);
            RDFParser rdfParser = Rio.createParser(rdfFormat);
            rdfParser.setRDFHandler(statementStreamer);
            rdfParser.parse(inputStream, "http://neo4j.com/base/");
        } catch (MalformedURLException e) {
            e.printStackTrace();
        } catch (IOException | RDFHandlerException | QueryExecutionException | RDFParseException | RDFImportPreRequisitesNotMet e) {
            e.printStackTrace();
        }

        return statementStreamer.getStatements().stream();


    } 
                            #location 19 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                @Procedure(mode = Mode.READ)
    public Stream<StreamedStatement> streamRDF(@Name("url") String url, @Name("format") String format,
                                               @Name("props") Map<String, Object> props) {

        StatementStreamer statementStreamer = new StatementStreamer();
        try {

            InputStream inputStream = getInputStream(url, props);
            RDFFormat rdfFormat = getFormat(format);
            log.info("Data set to be parsed as " + rdfFormat);
            RDFParser rdfParser = Rio.createParser(rdfFormat);
            rdfParser.setRDFHandler(statementStreamer);
            rdfParser.parse(inputStream, "http://neo4j.com/base/");
        } catch (MalformedURLException e) {
            e.printStackTrace();
        } catch (IOException | RDFHandlerException | QueryExecutionException | RDFParseException | RDFImportPreRequisitesNotMet e) {
            e.printStackTrace();
        }

        return statementStreamer.getStatements().stream();


    }