#vulnerable code 
                              @SuppressWarnings("unchecked")
  @Test
  public void should_parse_example() throws Exception {
    TomlParser parser = Parboiled.createParser(TomlParser.class);

    String toml = new Scanner(new File(getClass().getResource("example.toml").getFile())).useDelimiter("\\Z").next();
    ParsingResult<Object> result = new RecoveringParseRunner<Object>(parser.Toml()).run(toml);

    Map<String, Object> root = (Map<String, Object>) result.valueStack.peek(result.valueStack.size() - 2);

    // printMap(root);

    assertEquals("TOML Example", root.get("title"));

    Map<String, Object> owner = get(root, "owner");
    assertEquals("Tom Preston-Werner", owner.get("name"));
    assertEquals("GitHub", owner.get("organization"));
    assertEquals("GitHub Cofounder & CEO\nLikes tater tots and beer.", owner.get("bio"));

    Calendar dob = Calendar.getInstance();
    dob.set(1979, Calendar.MAY, 27, 7, 32, 0);
    dob.set(Calendar.MILLISECOND, 0);
    dob.setTimeZone(TimeZone.getTimeZone("UTC"));
    assertEquals(dob.getTime(), owner.get("dob"));

    Map<String, Object> database = get(root, "database");
    assertEquals("192.168.1.1", database.get("server"));
    assertEquals(5000L, database.get("connection_max"));
    assertTrue((Boolean) database.get("enabled"));
    assertEquals(Arrays.asList(8001L, 8001L, 8002L), database.get("ports"));

    Map<String, Object> servers = get(root, "servers");
    Map<String, Object> alphaServers = get(servers, "alpha");
    assertEquals("10.0.0.1", alphaServers.get("ip"));
    assertEquals("eqdc10", alphaServers.get("dc"));
    Map<String, Object> betaServers = get(servers, "beta");
    assertEquals("10.0.0.2", betaServers.get("ip"));
    assertEquals("eqdc10", betaServers.get("dc"));

    Map<String, Object> clients = get(root, "clients");
    assertEquals(asList(asList("gamma", "delta"), asList(1L, 2L)), clients.get("data"));
    assertEquals(asList("alpha", "omega"), clients.get("hosts"));
  } 
                            #location 6 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                              @SuppressWarnings("unchecked")
  @Test
  public void should_parse_example() throws Exception {
    Toml toml = new Toml().parse(new File(getClass().getResource("example.toml").getFile()));

    // printMap(root);

    assertEquals("TOML Example", toml.getString("title"));

    Toml owner = toml.getKeyGroup("owner");
    assertEquals("Tom Preston-Werner", owner.getString("name"));
    assertEquals("GitHub", owner.getString("organization"));
    assertEquals("GitHub Cofounder & CEO\nLikes tater tots and beer.", owner.getString("bio"));

    Calendar dob = Calendar.getInstance();
    dob.set(1979, Calendar.MAY, 27, 7, 32, 0);
    dob.set(Calendar.MILLISECOND, 0);
    dob.setTimeZone(TimeZone.getTimeZone("UTC"));
    assertEquals(dob.getTime(), owner.getDate("dob"));

    Toml database = toml.getKeyGroup("database");
    assertEquals("192.168.1.1", database.getString("server"));
    assertEquals(5000L, database.getLong("connection_max").longValue());
    assertTrue(database.getBoolean("enabled"));
    assertEquals(Arrays.asList(8001L, 8001L, 8002L), database.getList("ports", Long.class));

    Toml servers = toml.getKeyGroup("servers");
    Toml alphaServers = servers.getKeyGroup("alpha");
    assertEquals("10.0.0.1", alphaServers.getString("ip"));
    assertEquals("eqdc10", alphaServers.getString("dc"));
    Toml betaServers = servers.getKeyGroup("beta");
    assertEquals("10.0.0.2", betaServers.getString("ip"));
    assertEquals("eqdc10", betaServers.getString("dc"));

    Toml clients = toml.getKeyGroup("clients");
    assertEquals(asList(asList("gamma", "delta"), asList(1L, 2L)), clients.getList("data", String.class));
    assertEquals(asList("alpha", "omega"), clients.getList("hosts", String.class));
  }