<commit_before>package de.fau.osr.bl;

import java.io.File;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.revwalk.RevWalk;

import de.fau.osr.core.vcs.base.CommitFile;
import de.fau.osr.core.vcs.base.CommitState;
import de.fau.osr.core.vcs.base.VcsController;
import de.fau.osr.parser.CommitMessageParser;
import de.fau.osr.parser.GitCommitMessageParser;
import fj.Ord;
import fj.P2;
import fj.data.Array;
import fj.data.Option;
import fj.data.Set;
import fj.data.Tree;
import fj.data.TreeMap;
/**
 * @author Gayathery
 * @desc This class tracks the relationship between files and requirements. It
 * internally keeps all information for all commits in memory. This leads to
 * efficient incremental updates if commits are added.
 * It assumes that the content of a commit with a constant commitID cannot change,
 * which is a valid assumption for git. If a commit were to change without
 * changing its commitID the internal metadata would become stale and the
 * VcsInterpreter should be recreated.
 *
 */
public class VcsInterpreter {

	VcsController vcsController;

	public VcsInterpreter(VcsController vcsController) {
		this.vcsController = vcsController;
	}

	Map<String,TreeMap<Integer,Set<File>>> commitToReqToFiles = new HashMap<String,TreeMap<Integer,Set<File>>>();
	Map<String,TreeMap<File,Set<Integer>>> commitToFileToReqs = new HashMap<String,TreeMap<File,Set<Integer>>>();

	/* (non-Javadoc)
	 * @see de.fau.osr.bl.VcsInterpreter#getCommitFilesForRequirementID(java.lang.String)
	 * @author Gayathery
	 */
	public Iterable<File> getCommitFilesForRequirementID(Integer requirementID)
	{
		Tree<String> history = vcsController.getCommitTree("HEAD");<commit_msg>proper javadoc comment<commit_after>package de.fau.osr.bl;

import java.io.File;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.revwalk.RevWalk;

import de.fau.osr.core.vcs.base.CommitFile;
import de.fau.osr.core.vcs.base.CommitState;
import de.fau.osr.core.vcs.base.VcsController;
import de.fau.osr.parser.CommitMessageParser;
import de.fau.osr.parser.GitCommitMessageParser;
import fj.Ord;
import fj.P2;
import fj.data.Array;
import fj.data.Option;
import fj.data.Set;
import fj.data.Tree;
import fj.data.TreeMap;
/**
 * This class tracks the relationship between files and requirements. It
 * internally keeps all information for all commits in memory. This leads to
 * efficient incremental updates if commits are added.
 * It assumes that the content of a commit with a constant commitID cannot change,
 * which is a valid assumption for git. If a commit were to change without
 * changing its commitID the internal metadata would become stale and the
 * VcsInterpreter should be recreated.
 * @author Gayathery
 *
 */
public class VcsInterpreter {

	VcsController vcsController;

	public VcsInterpreter(VcsController vcsController) {
		this.vcsController = vcsController;
	}

	Map<String,TreeMap<Integer,Set<File>>> commitToReqToFiles = new HashMap<String,TreeMap<Integer,Set<File>>>();
	Map<String,TreeMap<File,Set<Integer>>> commitToFileToReqs = new HashMap<String,TreeMap<File,Set<Integer>>>();

	/* (non-Javadoc)
	 * @see de.fau.osr.bl.VcsInterpreter#getCommitFilesForRequirementID(java.lang.String)
	 * @author Gayathery
	 */
	public Iterable<File> getCommitFilesForRequirementID(Integer requirementID)
	{
		Tree<String> history = vcsController.getCommitTree("HEAD");
{'fraction_non_alphanumeric': 0.10494946877429386, 'fraction_numerical': 0.0005182689816014512, 'mean_word_length': 5.433333333333334, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '927075', 'n_tokens_mistral': 1273, 'n_tokens_neox': 1263, 'n_words': 308}