<commit_before>package scrum.server.project;

import ilarkesto.fp.Predicate;
import scrum.server.issues.Issue;

public class RequirementDao extends GRequirementDao {

	@Override
	public Requirement newEntityInstance() {
		Requirement requirement = super.newEntityInstance();
		requirement.setLabel("New Story");
		return requirement;
	}

	public Requirement getRequirementByNumber(final int number, final Project project) {
		return getEntity(new Predicate<Requirement>() {

			public boolean test(Requirement r) {
				return r.isNumber(number) && r.isProject(project);
			}
		});
	}

	// --- test data ---

	public Requirement postRequirement(Project project, String label, Float estimation) {
		Requirement requirement = newEntityInstance();
		requirement.setProject(project);
		requirement.setLabel(label);
		requirement.setEstimatedWork(estimation);
		saveEntity(requirement);
		requirement.updateNumber();
		return requirement;
	}

	public Requirement postRequirement(Issue issue) {
		Requirement requirement = newEntityInstance();
		requirement.setProject(issue.getProject());
		requirement.setLabel(issue.getLabel());
		requirement.setIssue(issue);
		issue.setStory(requirement);
		saveEntity(requirement);
		requirement.updateNumber();
		return requirement;
	}
}
<commit_msg>when creating a story from an issue, carry description over<commit_after>package scrum.server.project;

import ilarkesto.fp.Predicate;
import scrum.server.issues.Issue;

public class RequirementDao extends GRequirementDao {

	@Override
	public Requirement newEntityInstance() {
		Requirement requirement = super.newEntityInstance();
		requirement.setLabel("New Story");
		return requirement;
	}

	public Requirement getRequirementByNumber(final int number, final Project project) {
		return getEntity(new Predicate<Requirement>() {

			public boolean test(Requirement r) {
				return r.isNumber(number) && r.isProject(project);
			}
		});
	}

	// --- test data ---

	public Requirement postRequirement(Project project, String label, Float estimation) {
		Requirement requirement = newEntityInstance();
		requirement.setProject(project);
		requirement.setLabel(label);
		requirement.setEstimatedWork(estimation);
		saveEntity(requirement);
		requirement.updateNumber();
		return requirement;
	}

	public Requirement postRequirement(Issue issue) {
		Requirement requirement = newEntityInstance();
		requirement.setProject(issue.getProject());
		requirement.setLabel(issue.getLabel());
		requirement.setDescription(issue.getDescription());
		requirement.setIssue(issue);
		issue.setStory(requirement);
		saveEntity(requirement);
		requirement.updateNumber();
		return requirement;
	}
}

{'fraction_non_alphanumeric': 0.10427606901725431, 'fraction_numerical': 0.0, 'mean_word_length': 5.617866004962779, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '252040', 'n_tokens_mistral': 815, 'n_tokens_neox': 743, 'n_words': 160}