#fixed code
                                @Test
    public void testUpdateCalendarParameter() {
        Calendar c = GregorianCalendar.from(ZonedDateTime.parse("2017-03-25T15:37Z"));
        try (Database db = db()) {
            db.update("update person set registered=?") //
                    .parameter(c) //
                    .counts() //
                    .test() //
                    .awaitDone(TIMEOUT_SECONDS, TimeUnit.SECONDS) //
                    .assertValue(3) //
                    .assertComplete();
            db.select("select registered from person") //
                    .getAs(Long.class) //
                    .firstOrError() //
                    .test() //
                    .awaitDone(TIMEOUT_SECONDS, TimeUnit.SECONDS) //
                    .assertValue(c.getTimeInMillis()) //
                    .assertComplete();
        }
    }
#vulnerable code 
                                @Test
    public void testUpdateCalendarParameter() {
        Calendar c = GregorianCalendar.from(ZonedDateTime.parse("2017-03-25T15:37Z"));
        Database db = db();
        db.update("update person set registered=?") //
                .parameter(c) //
                .counts() //
                .test() //
                .awaitDone(TIMEOUT_SECONDS, TimeUnit.SECONDS) //
                .assertValue(3) //
                .assertComplete();
        db.select("select registered from person") //
                .getAs(Long.class) //
                .firstOrError() //
                .test() //
                .awaitDone(TIMEOUT_SECONDS, TimeUnit.SECONDS) //
                .assertValue(c.getTimeInMillis()) //
                .assertComplete();
    } 
                            #location 13 
                            #vulnerability type RESOURCE_LEAK