<commit_before>package scrum.client.project;

import scrum.client.common.ABlockWidget;
import scrum.client.common.AScrumAction;
import scrum.client.common.BlockHeaderWidget;
import scrum.client.common.BlockWidgetFactory;
import scrum.client.dnd.TrashSupport;
import scrum.client.img.Img;

import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.Widget;

public class RequirementBlock extends ABlockWidget<Requirement> implements TrashSupport {

	private SimplePanel statusIcon;
	private Label estimationLabel;
	private SprintBorderIndicatorWidget sprintBorderIndicator;

	@Override
	protected void onInitializationHeader(BlockHeaderWidget header) {
		Requirement requirement = getObject();
		statusIcon = header.insertPrefixIcon();
		estimationLabel = header.appendCenterSuffix(null);

		header.appendCell(new EstimationBarWidget(requirement), "150px", false, null);

		header.addMenuAction(new AddRequirementToCurrentSprintAction(requirement));
		header.addMenuAction(new RemoveRequirementFromSprintAction(requirement));
		header.addMenuAction(new CloseRequirementAction(requirement));
		header.addMenuAction(new ReopenRequirementAction(requirement));
		header.addMenuAction(new SetRequirementDirtyAction(requirement));
		header.addMenuAction(new SetRequirementCleanAction(requirement));
		header.addMenuAction(new DeleteRequirementAction(requirement));
	}

	@Override
	protected void onUpdateHeader(BlockHeaderWidget header) {
		Requirement requirement = getObject();
		header.setDragHandle(requirement.getReference());
		Image statusImage = null;
		if (requirement.isInCurrentSprint()) {
			statusImage = Img.bundle.reqInSprint().createImage();
			statusImage.setTitle("In current sprint.");
		} else if (requirement.isClosed()) {
			statusImage = Img.bundle.reqClosed().createImage();
			statusImage.setTitle("Closed.");
		} else if (!requirement.isEstimatedWorkValid()) {
			statusImage = Img.bundle.reqDirty().createImage();
			statusImage.setTitle("Needs estimation.");
		}
		estimationLabel.setText(requirement.getEstimatedWorkAsString());
		statusIcon.setWidget(statusImage);
		header.setCenter(requirement.getLabel());

		boolean sprintBorder = false;
		Requirement previous = getList().getPrevious(requirement);
		if (previous != null) {
			sprintBorder = !requirement.getEstimationBar().isCompetedOnSameSprint(previous.getEstimationBar());
		}

		if (sprintBorder) {
			if (sprintBorderIndicator == null) {
				sprintBorderIndicator = new SprintBorderIndicatorWidget();
				getPreHeaderPanel().add(sprintBorderIndicator);
			}
		} else {
			if (sprintBorderIndicator != null) {
				getPreHeaderPanel().remove(sprintBorderIndicator);
				sprintBorderIndicator = null;
			}
		}
	}

	@Override
	protected Widget onExtendedInitialization() {
		return new RequirementWidget(getObject(), true, true, false, true);
	}

	public AScrumAction getTrashAction() {
		return new DeleteRequirementAction(getObject());
	}

	public static final BlockWidgetFactory<Requirement> FACTORY = new BlockWidgetFactory<Requirement>() {

		public RequirementBlock createBlock() {
			return new RequirementBlock();
		}
	};

}
<commit_msg>bugfix<commit_after>package scrum.client.project;

import scrum.client.common.ABlockWidget;
import scrum.client.common.AScrumAction;
import scrum.client.common.BlockHeaderWidget;
import scrum.client.common.BlockWidgetFactory;
import scrum.client.dnd.TrashSupport;
import scrum.client.img.Img;

import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.Widget;

public class RequirementBlock extends ABlockWidget<Requirement> implements TrashSupport {

	private SimplePanel statusIcon;
	private Label estimationLabel;
	private SprintBorderIndicatorWidget sprintBorderIndicator;

	@Override
	protected void onInitializationHeader(BlockHeaderWidget header) {
		Requirement requirement = getObject();
		statusIcon = header.insertPrefixIcon();
		estimationLabel = header.appendCenterSuffix(null);

		header.appendCell(new EstimationBarWidget(requirement), "150px", false, null);

		header.addMenuAction(new AddRequirementToCurrentSprintAction(requirement));
		header.addMenuAction(new RemoveRequirementFromSprintAction(requirement));
		header.addMenuAction(new CloseRequirementAction(requirement));
		header.addMenuAction(new ReopenRequirementAction(requirement));
		header.addMenuAction(new SetRequirementDirtyAction(requirement));
		header.addMenuAction(new SetRequirementCleanAction(requirement));
		header.addMenuAction(new DeleteRequirementAction(requirement));
	}

	@Override
	protected void onUpdateHeader(BlockHeaderWidget header) {
		Requirement requirement = getObject();
		header.setDragHandle(requirement.getReference());
		Image statusImage = null;
		if (requirement.isInCurrentSprint()) {
			statusImage = Img.bundle.reqInSprint().createImage();
			statusImage.setTitle("In current sprint.");
		} else if (requirement.isClosed()) {
			statusImage = Img.bundle.reqClosed().createImage();
			statusImage.setTitle("Closed.");
		} else if (!requirement.isEstimatedWorkValid()) {
			statusImage = Img.bundle.reqDirty().createImage();
			statusImage.setTitle("Needs estimation.");
		}
		estimationLabel.setText(requirement.getEstimatedWorkAsString());
		statusIcon.setWidget(statusImage);
		header.setCenter(requirement.getLabel());

		boolean sprintBorder = false;
		Requirement previous = getList().getPrevious(requirement);
		if (previous != null && previous.getEstimatedWork() != null) {
			sprintBorder = !requirement.getEstimationBar().isCompetedOnSameSprint(previous.getEstimationBar());
		}

		if (sprintBorder) {
			if (sprintBorderIndicator == null) {
				sprintBorderIndicator = new SprintBorderIndicatorWidget();
				getPreHeaderPanel().add(sprintBorderIndicator);
			}
		} else {
			if (sprintBorderIndicator != null) {
				getPreHeaderPanel().remove(sprintBorderIndicator);
				sprintBorderIndicator = null;
			}
		}
	}

	@Override
	protected Widget onExtendedInitialization() {
		return new RequirementWidget(getObject(), true, true, false, true);
	}

	public AScrumAction getTrashAction() {
		return new DeleteRequirementAction(getObject());
	}

	public static final BlockWidgetFactory<Requirement> FACTORY = new BlockWidgetFactory<Requirement>() {

		public RequirementBlock createBlock() {
			return new RequirementBlock();
		}
	};

}

{'fraction_non_alphanumeric': 0.10730733804114216, 'fraction_numerical': 0.00092109303039607, 'mean_word_length': 6.353273137697517, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '5214064', 'n_tokens_mistral': 2038, 'n_tokens_neox': 1883, 'n_words': 324}