#vulnerable code 
                              @Test
  public void testConfirmPattern() {
    final SqlLine line = new SqlLine();
    assertThat(line.getOpts().getConfirm(), is(false));
    final ByteArrayOutputStream os = new ByteArrayOutputStream();

    begin(line, os, false, "-e",
        "!set confirmPattern \"^(?i:(TRUNCATE|ALTER))\"");
    assertThat(line.getOpts().getConfirmPattern(),
        is("^(?i:(TRUNCATE|ALTER))"));

    begin(line, os, false, "-e", "!set confirmPattern default");
    assertThat(line.getOpts().getConfirmPattern(),
        is(line.loc("default-confirm-pattern")));
  } 
                            #location 7 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                              @Test
  public void testConfirmPattern() {
    assertThat(sqlLine.getOpts().getConfirm(), is(false));
    final ByteArrayOutputStream os = new ByteArrayOutputStream();

    begin(sqlLine, os, false, "-e",
        "!set confirmPattern \"^(?i:(TRUNCATE|ALTER))\"");
    assertThat(sqlLine.getOpts().getConfirmPattern(),
        is("^(?i:(TRUNCATE|ALTER))"));

    begin(sqlLine, os, false, "-e", "!set confirmPattern default");
    assertThat(sqlLine.getOpts().getConfirmPattern(),
        is(sqlLine.loc("default-confirm-pattern")));
  }