<commit_before>package seedu.tasklist.model.task;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Objects;

import seedu.tasklist.commons.util.CollectionUtil;
import seedu.tasklist.model.tag.UniqueTagList;

/**
* Represents a Task with duedate in the task list.
* Guarantees: details are present and not null, field values are validated.
*/
public class DeadlineTask extends Task implements ReadOnlyDeadlineTask {

    private Name name;
    private Comment comment;
    private Priority priority;
    private Status status;
    private Date deadline;

    private UniqueTagList tags;

    public static final String TYPE = "deadline";

    public DeadlineTask(Name name, Comment comment, Priority priority,
                        Status status, Date deadline, UniqueTagList tags) {
        assert !CollectionUtil.isAnyNull(name, deadline, status);
        this.name = name;
        this.comment = comment;
        this.priority = priority;
        this.status = status;
        this.deadline = deadline;
        this.tags = new UniqueTagList(tags); // protect internal tags from changes in the arg list

    }

    /**
     * Creates a copy of the given ReadOnlyDeadlineTask.
     */
    public DeadlineTask(ReadOnlyDeadlineTask source) {
        this(source.getName(), source.getComment(), source.getPriority(),
             source.getStatus(), source.getDeadline(), source.getTags());
    }

    public void setDeadline(Date deadline) {
        assert deadline != null;
        this.deadline = deadline;
    }

    @Override
    public Date getDeadline() {
        return deadline;
    }

    @Override
    public String getDeadlineString() {
        DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
        return dateFormat.format(deadline);
    }

    public void setName(Name name) {
        assert name != null;
        this.name = name;
    }

    @Override
    public Name getName() {
        return name;
    }

    public void setComment(Comment comment) {
        assert comment != null;
        this.comment = comment;
    }

    @Override
    public Comment getComment() {
        return comment;
    }

    @Override
    public UniqueTagList getTags() {
        return tags;
    }

    public void setPriority(Priority priority) {
        assert priority != null;
        this.priority = priority;
    }

    public Priority getPriority() {
        return priority;
    }

    public void setStatus(Status status) {
        assert status != null;
        this.status = status;
    }


    public Status getStatus() {
        return status;
    }

    /**
     * Replaces this task's tags with the tags in the argument tag list.
     */
    public void setTags(UniqueTagList replacement) {
        tags.setTags(replacement);
    }

    /**
     * Updates this task with the details of {@code replacement}.
     */
    public void resetData(ReadOnlyDeadlineTask replacement) {
        assert replacement != null;

        this.setName(replacement.getName());
        this.setComment(replacement.getComment());
        this.setPriority(replacement.getPriority());
        this.setStatus(replacement.getStatus());
        this.setDeadline(replacement.getDeadline());
        this.setTags(replacement.getTags());
    }

    @Override
    public boolean equals(Object other) {
        return other == this // short circuit if same object
                || (other instanceof ReadOnlyDeadlineTask // instanceof handles nulls
                && this.isSameStateAs((ReadOnlyDeadlineTask) other));
    }

    @Override
    public int hashCode() {
        // use this method for custom fields hashing instead of implementing your own
        return Objects.hash(name, deadline, tags);
    }

    @Override
    public String toString() {
        return getAsText();
    }

    @Override
    public String getType() {
        return TYPE;
    }

    @Override
    public String getAsText() {
        final StringBuilder builder = new StringBuilder();
        builder.append(getName())
                .append(" Deadline: ")
                .append(getDeadlineString())
                .append(" Comment: ")
                .append(getComment())
                .append(" Priority: ")
                .append(getPriority())
                .append(" Tags: ");
        getTags().forEach(builder::append);
        return builder.toString();
    }

    @Override
    public Date getDeadlineParameter() throws ParseException {
        DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
        Date deadlineParameter = formatter.parse(formatter.format(deadline));
        return deadlineParameter;
    }

    @Override
    public Date getStartDateParameter() throws ParseException {
        Date deadlineParameter = new Date(Long.MAX_VALUE -1); //appear before floating task
        return deadlineParameter;
    }

    @Override
    public Date getEndDateParameter() throws ParseException {
        Date deadlineParameter = new Date(Long.MAX_VALUE -1); //appear before floating task
        return deadlineParameter;
    }
}<commit_msg>Fix Checkstyle Errors<commit_after>package seedu.tasklist.model.task;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Objects;

import seedu.tasklist.commons.util.CollectionUtil;
import seedu.tasklist.model.tag.UniqueTagList;

/**
* Represents a Task with duedate in the task list.
* Guarantees: details are present and not null, field values are validated.
*/
public class DeadlineTask extends Task implements ReadOnlyDeadlineTask {

    private Name name;
    private Comment comment;
    private Priority priority;
    private Status status;
    private Date deadline;

    private UniqueTagList tags;

    public static final String TYPE = "deadline";

    public DeadlineTask(Name name, Comment comment, Priority priority,
                        Status status, Date deadline, UniqueTagList tags) {
        assert !CollectionUtil.isAnyNull(name, deadline, status);
        this.name = name;
        this.comment = comment;
        this.priority = priority;
        this.status = status;
        this.deadline = deadline;
        this.tags = new UniqueTagList(tags); // protect internal tags from changes in the arg list

    }

    /**
     * Creates a copy of the given ReadOnlyDeadlineTask.
     */
    public DeadlineTask(ReadOnlyDeadlineTask source) {
        this(source.getName(), source.getComment(), source.getPriority(),
             source.getStatus(), source.getDeadline(), source.getTags());
    }

    public void setDeadline(Date deadline) {
        assert deadline != null;
        this.deadline = deadline;
    }

    @Override
    public Date getDeadline() {
        return deadline;
    }

    @Override
    public String getDeadlineString() {
        DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
        return dateFormat.format(deadline);
    }

    public void setName(Name name) {
        assert name != null;
        this.name = name;
    }

    @Override
    public Name getName() {
        return name;
    }

    public void setComment(Comment comment) {
        assert comment != null;
        this.comment = comment;
    }

    @Override
    public Comment getComment() {
        return comment;
    }

    @Override
    public UniqueTagList getTags() {
        return tags;
    }

    public void setPriority(Priority priority) {
        assert priority != null;
        this.priority = priority;
    }

    public Priority getPriority() {
        return priority;
    }

    public void setStatus(Status status) {
        assert status != null;
        this.status = status;
    }


    public Status getStatus() {
        return status;
    }

    /**
     * Replaces this task's tags with the tags in the argument tag list.
     */
    public void setTags(UniqueTagList replacement) {
        tags.setTags(replacement);
    }

    /**
     * Updates this task with the details of {@code replacement}.
     */
    public void resetData(ReadOnlyDeadlineTask replacement) {
        assert replacement != null;

        this.setName(replacement.getName());
        this.setComment(replacement.getComment());
        this.setPriority(replacement.getPriority());
        this.setStatus(replacement.getStatus());
        this.setDeadline(replacement.getDeadline());
        this.setTags(replacement.getTags());
    }

    @Override
    public boolean equals(Object other) {
        return other == this // short circuit if same object
                || (other instanceof ReadOnlyDeadlineTask // instanceof handles nulls
                && this.isSameStateAs((ReadOnlyDeadlineTask) other));
    }

    @Override
    public int hashCode() {
        // use this method for custom fields hashing instead of implementing your own
        return Objects.hash(name, deadline, tags);
    }

    @Override
    public String toString() {
        return getAsText();
    }

    @Override
    public String getType() {
        return TYPE;
    }

    @Override
    public String getAsText() {
        final StringBuilder builder = new StringBuilder();
        builder.append(getName())
                .append(" Deadline: ")
                .append(getDeadlineString())
                .append(" Comment: ")
                .append(getComment())
                .append(" Priority: ")
                .append(getPriority())
                .append(" Tags: ");
        getTags().forEach(builder::append);
        return builder.toString();
    }

    @Override
    public Date getDeadlineParameter() throws ParseException {
        DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
        Date deadlineParameter = formatter.parse(formatter.format(deadline));
        return deadlineParameter;
    }

    @Override
    public Date getStartDateParameter() throws ParseException {
      //appear before floating task
        Date deadlineParameter = new Date(Long.MAX_VALUE - 1);
        return deadlineParameter;
    }

    @Override
    public Date getEndDateParameter() throws ParseException {
        //appear before floating task
        Date deadlineParameter = new Date(Long.MAX_VALUE - 1);
        return deadlineParameter;
    }
}
{'fraction_non_alphanumeric': 0.09175377468060394, 'fraction_numerical': 0.00038714672861014324, 'mean_word_length': 2.418127687727423, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3953034', 'n_tokens_mistral': 2711, 'n_tokens_neox': 2601, 'n_words': 756}