#vulnerable code 
                                @Test
    public void testGremlinOLAP() throws Exception {
        Graph g = TinkerFactory.createClassic();
        ComputeResult result =
                g.compute().program(GremlinVertexProgram.create().gremlin(() -> (Gremlin)
                        //Gremlin.of().out("created").in("created").property("name"))
                        Gremlin.of().as("x").outE().inV().loop("x", o -> o.getLoops() < 2).value("name").map(s -> s.toString().length()).path())
                        .build())
                        .submit().get();

        /////////// GREMLIN REPL LOOK

        System.out.println("gremlin> " + result.getGraphMemory().<Supplier>get("gremlinPipeline").get());
        StreamFactory.stream(g.query().vertices()).forEach(v -> {
            final GremlinTracker tracker = result.getVertexMemory().<GremlinTracker>getProperty(v, GremlinVertexProgram.GREMLIN_TRACKER).get();
            tracker.getDoneGraphHolders().forEach((a, b) -> Stream.generate(() -> 1).limit(b.size()).forEach(t -> System.out.println("==>" + a)));
            tracker.getDoneObjectHolders().forEach((a, b) -> Stream.generate(() -> 1).limit(b.size()).forEach(t -> System.out.println("==>" + a)));
        });
    } 
                            #location 14 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                @Test
    public void testGremlinOLAP() throws Exception {
        Graph g = TinkerFactory.createClassic();
        ComputeResult result =
                g.compute().program(GremlinVertexProgram.create().gremlin(() -> (Gremlin)
                        //Gremlin.of().out("created").in("created").value("name").map(o -> o.toString().length()))
                        Gremlin.of().out().out().property("name").value().path())
                        //Gremlin.of().as("x").outE().inV().loop("x", o -> o.getLoops() < 2).value("name").map(s -> s.toString().length()).path())
                        .build())
                        .submit().get();

        /////////// GREMLIN REPL LOOK

        if (result.getGraphMemory().get(GremlinVertexProgram.TRACK_PATHS)) {
            System.out.println("gremlin> " + result.getGraphMemory().<Supplier>get("gremlinPipeline").get());
            StreamFactory.stream(g.query().vertices()).forEach(v -> {
                final GremlinPaths tracker = result.getVertexMemory().<GremlinPaths>getProperty(v, GremlinVertexProgram.GREMLIN_TRACKER).get();
                tracker.getDoneGraphTracks().forEach((a, b) -> Stream.generate(() -> 1).limit(((List) b).size()).forEach(t -> System.out.println("==>" + a)));
                tracker.getDoneObjectTracks().forEach((a, b) -> Stream.generate(() -> 1).limit(((List) b).size()).forEach(t -> System.out.println("==>" + a)));
            });
        } else {
            System.out.println("gremlin> " + result.getGraphMemory().<Supplier>get("gremlinPipeline").get());
            StreamFactory.stream(g.query().vertices()).forEach(v -> {
                final GremlinCounter tracker = result.getVertexMemory().<GremlinCounter>getProperty(v, GremlinVertexProgram.GREMLIN_TRACKER).get();
                tracker.getDoneGraphTracks().forEach((a, b) -> Stream.generate(() -> 1).limit(b).forEach(t -> System.out.println("==>" + a)));
                tracker.getDoneObjectTracks().forEach((a, b) -> Stream.generate(() -> 1).limit(b).forEach(t -> System.out.println("==>" + a)));
            });
        }
    }