<commit_before>package seedu.task.storage;

import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlElement;

import seedu.task.commons.exceptions.IllegalValueException;
import seedu.task.model.tag.Tag;
import seedu.task.model.tag.UniqueTagList;
import seedu.task.model.task.Complete;
import seedu.task.model.task.Description;
import seedu.task.model.task.DueDate;
import seedu.task.model.task.Duration;
import seedu.task.model.task.ReadOnlyTask;
import seedu.task.model.task.Task;
import seedu.task.model.task.TaskId;

/**
 * JAXB-friendly version of the Task.
 */
public class XmlAdaptedTask {

    @XmlElement(required = true)
    private String description;
    @XmlElement(required = false)
    private String dueDate;
    @XmlElement(required = false)
    private String start;
    @XmlElement(required = false)
    private String end;
    @XmlElement(required = true)
    private String complete;
    @XmlElement(required = true)
    private long id;

    @XmlElement
    private List<XmlAdaptedTag> tagged = new ArrayList<>();

    /**
     * Constructs an XmlAdaptedTask.
     * This is the no-arg constructor that is required by JAXB.
     */
    public XmlAdaptedTask() {}


    /**
     * Converts a given Task into this class for JAXB use.
     *
     * @param source future changes to this will not affect the created XmlAdaptedTask
     */
    public XmlAdaptedTask(ReadOnlyTask source) {
        description = source.getDescription().description;

        Duration duration = source.getDuration();
        start = duration != null ? duration.getStartString() : null;
        end = duration != null ? duration.getEndString() : null;
        dueDate = source.getDueDate() != null ?
                source.getDueDate().toString() :
                null;
        complete = source.getComplete().getString();
        id = source.getTaskId().id;
        tagged = new ArrayList<>();
        for (Tag tag : source.getTags()) {
            tagged.add(new XmlAdaptedTag(tag));
        }
    }

    /**
     * Converts this jaxb-friendly adapted task object into the model's Task object.
     *
     * @throws IllegalValueException if there were any data constraints violated in the adapted task
     */
    public Task toModelType() throws IllegalValueException {
        final List<Tag> taskTags = new ArrayList<>();
        for (XmlAdaptedTag tag : tagged) {
            taskTags.add(tag.toModelType());
        }
        final Description description = new Description(this.description);
        final Duration duration = this.start != null && this.end != null ?
            new Duration(this.start, this.end) :
            null;
        final DueDate dueDate = this.dueDate != null ?
                new DueDate(this.dueDate) :
                null;
        final UniqueTagList tags = new UniqueTagList(taskTags);
        final Complete complete = this.complete.equals(Complete.COMPLETE_VALUE) ?
            new Complete(Complete.COMPLETE_VALUE) : new Complete(Complete.UNCOMPLETE_VALUE);
        final TaskId id = new TaskId(this.id);
        return new Task(description, dueDate, duration, tags, complete, id);
    }
}<commit_msg>Fix a mistake in COMPLETE_WORD<commit_after>package seedu.task.storage;

import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlElement;

import seedu.task.commons.exceptions.IllegalValueException;
import seedu.task.model.tag.Tag;
import seedu.task.model.tag.UniqueTagList;
import seedu.task.model.task.Complete;
import seedu.task.model.task.Description;
import seedu.task.model.task.DueDate;
import seedu.task.model.task.Duration;
import seedu.task.model.task.ReadOnlyTask;
import seedu.task.model.task.Task;
import seedu.task.model.task.TaskId;

/**
 * JAXB-friendly version of the Task.
 */
public class XmlAdaptedTask {

    @XmlElement(required = true)
    private String description;
    @XmlElement(required = false)
    private String dueDate;
    @XmlElement(required = false)
    private String start;
    @XmlElement(required = false)
    private String end;
    @XmlElement(required = true)
    private String complete;
    @XmlElement(required = true)
    private long id;

    @XmlElement
    private List<XmlAdaptedTag> tagged = new ArrayList<>();

    /**
     * Constructs an XmlAdaptedTask.
     * This is the no-arg constructor that is required by JAXB.
     */
    public XmlAdaptedTask() {}


    /**
     * Converts a given Task into this class for JAXB use.
     *
     * @param source future changes to this will not affect the created XmlAdaptedTask
     */
    public XmlAdaptedTask(ReadOnlyTask source) {
        description = source.getDescription().description;

        Duration duration = source.getDuration();
        start = duration != null ? duration.getStartString() : null;
        end = duration != null ? duration.getEndString() : null;
        dueDate = source.getDueDate() != null ?
                source.getDueDate().toString() :
                null;
        complete = source.getComplete().getString();
        id = source.getTaskId().id;
        tagged = new ArrayList<>();
        for (Tag tag : source.getTags()) {
            tagged.add(new XmlAdaptedTag(tag));
        }
    }

    /**
     * Converts this jaxb-friendly adapted task object into the model's Task object.
     *
     * @throws IllegalValueException if there were any data constraints violated in the adapted task
     */
    public Task toModelType() throws IllegalValueException {
        final List<Tag> taskTags = new ArrayList<>();
        for (XmlAdaptedTag tag : tagged) {
            taskTags.add(tag.toModelType());
        }
        final Description description = new Description(this.description);
        final Duration duration = this.start != null && this.end != null ?
            new Duration(this.start, this.end) :
            null;
        final DueDate dueDate = this.dueDate != null ?
                new DueDate(this.dueDate) :
                null;
        final UniqueTagList tags = new UniqueTagList(taskTags);
        final Complete complete = this.complete.equals(Complete.COMPLETE_WORD) ?
            new Complete(Complete.COMPLETE_VALUE) : new Complete(Complete.UNCOMPLETE_VALUE);
        final TaskId id = new TaskId(this.id);
        return new Task(description, dueDate, duration, tags, complete, id);
    }
}
{'fraction_non_alphanumeric': 0.10119421747328725, 'fraction_numerical': 0.0, 'mean_word_length': 2.781937017231135, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '3134064', 'n_tokens_mistral': 1808, 'n_tokens_neox': 1755, 'n_words': 472}