#vulnerable code 
                              @Test public void readerUnusedPromotionDoesntPersist() throws Exception {
    JsonReader reader = new JsonReader(new Buffer().writeUtf8("[{},{\"a\":5}]"));
    reader.beginArray();
    reader.beginObject();
    reader.promoteNameToValue();
    reader.endObject();
    reader.beginObject();
    try {
      reader.nextString();
      fail();
    } catch (JsonDataException expected) {
    }
    assertThat(reader.nextName()).isEqualTo("a");
  } 
                            #location 2 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                              @Test public void readerUnusedPromotionDoesntPersist() throws Exception {
    JsonReader reader = newReader("[{},{\"a\":5}]");
    reader.beginArray();
    reader.beginObject();
    reader.promoteNameToValue();
    reader.endObject();
    reader.beginObject();
    try {
      reader.nextString();
      fail();
    } catch (JsonDataException expected) {
    }
    assertThat(reader.nextName()).isEqualTo("a");
  }