#vulnerable code 
                              @Test public void readerBooleanValue() throws Exception {
    JsonReader reader = newReader("{\"true\":1}");
    reader.beginObject();
    reader.promoteNameToValue();
    assertThat(reader.getPath()).isEqualTo("$.true");
    assertThat(reader.peek()).isEqualTo(JsonReader.Token.STRING);
    try {
      reader.nextBoolean();
      fail();
    } catch (JsonDataException e) {
      assertThat(e).hasMessage("Expected a boolean but was STRING at path $.true");
    }
    assertThat(reader.getPath()).isEqualTo("$.true");
    assertThat(reader.nextString()).isEqualTo("true");
    assertThat(reader.getPath()).isEqualTo("$.true");
    assertThat(reader.nextInt()).isEqualTo(1);
    reader.endObject();
    assertThat(reader.getPath()).isEqualTo("$");
  } 
                            #location 12 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                              @Test public void readerBooleanValue() throws Exception {
    JsonReader reader = factory.newReader("{\"true\":1}");
    reader.beginObject();
    reader.promoteNameToValue();
    assertThat(reader.getPath()).isEqualTo("$.true");
    assertThat(reader.peek()).isEqualTo(JsonReader.Token.STRING);
    try {
      reader.nextBoolean();
      fail();
    } catch (JsonDataException e) {
      assertThat(e.getMessage()).isIn(
          "Expected BOOLEAN but was true, a java.lang.String, at path $.true",
          "Expected a boolean but was STRING at path $.true");
    }
    assertThat(reader.getPath()).isEqualTo("$.true");
    assertThat(reader.nextString()).isEqualTo("true");
    assertThat(reader.getPath()).isEqualTo("$.true");
    assertThat(reader.nextInt()).isEqualTo(1);
    reader.endObject();
    assertThat(reader.getPath()).isEqualTo("$");
  }