#fixed code
                                public void getGitChangeSets() throws IOException, GitAPIException {
        Repository localRepository = new FileRepository(new File("./repo/server/.git"));

        Git git = new Git(localRepository);
        Iterable<RevCommit> logs = git.log().call();

        List<String> revisions = new ArrayList<>();
        for(RevCommit rev: logs) {
            System.out.println(rev.getCommitTime() + " " + rev.getName());
            revisions.add(rev.getName());
        }
        revisions = Lists.reverse(revisions);

        for (int i = 1; i < revisions.size(); i++) {
            System.out.println("///////////////////////////////////////////////");
            this.getRevisionChanges(revisions.get(i - 1), revisions.get(i));
        }

    }
#vulnerable code 
                                public void getGitChangeSets() throws IOException, GitAPIException {
        Repository localRepository = new FileRepository(new File("./repo/.timelord/test/.git"));

        Git git = new Git(localRepository);
        Iterable<RevCommit> logs = git.log().call();

        for(RevCommit rev: logs) {
            System.out.println(rev.getName());
            git.checkout().setName(rev.getName()).call();
        }
    } 
                            #location 10 
                            #vulnerability type RESOURCE_LEAK