#vulnerable code 
                                @Test
    public void testSelectUsingNameNotGiven() {
        db() //
                .select("select score from person where name=:name and name<>:name2") //
                .parameter("name", "FRED") //
                .parameter("name", "JOSEPH") //
                .getAs(Integer.class) //
                .test() //
                .awaitDone(TIMEOUT_SECONDS, TimeUnit.SECONDS) //
                .assertError(NamedParameterMissingException.class) //
                .assertNoValues();
    } 
                            #location 7 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                @Test
    public void testSelectUsingNameNotGiven() {
        try (Database db = db()) {
            db //
                    .select("select score from person where name=:name and name<>:name2") //
                    .parameter("name", "FRED") //
                    .parameter("name", "JOSEPH") //
                    .getAs(Integer.class) //
                    .test() //
                    .awaitDone(TIMEOUT_SECONDS, TimeUnit.SECONDS) //
                    .assertError(NamedParameterMissingException.class) //
                    .assertNoValues();
        }
    }