<commit_before>public class Pet {
    private String name;
    private int age;
    private double weight;

    // If no starting attributes are given, assign the defaults
    public Pet() {
        name = "Pet";
        age = 0;
        weight = 0;
    }

    public Pet(String name, int age, double weight) {
        this.name = name;

        // If age or weight are invalid, show an error and quit the whole program
        if((age < 0) || (weight < 0)) {
            System.out.println("Error: Negative age or weight!");
            System.exit(0);
        }

        this.age = age;
        this.weight = weight;
    }

    public void setPet(String newName, int newAge, double newWeight) {
        name = newName;
        if((newAge < 0) || (newWeight < 0)) {
            System.out.println("Error: Negative age or weight!");
            System.exit(0);
        }
        weight = newWeight;
    }
    
    /**
     * Change the name of a pet to the given new name.
     * @param newName String containing the new name.
     * @return Nothing.
     */
    public void setName(String newName) {
        name = newName;
    }
    
    /**
     * Changes the pet's age to the given new age. If it is negative, it print an error and quits the program.
     * 
     * @param newAge A positive Integer to set the age to.
     * @return Nothing.
     */
    public void setAge(int newAge) {
        if(newAge < 0) {
            System.out.println("Error: Negative age!");
            System.exit(0);
        }

        age = newAge;
    }
    
    /**
     * Changes the pet's age to the given new weight. If it is negative, it prints an error and quits the program.
     * 
     * @param newWeight A positive double to set the new weight to. 
     * @return Nothing.
     */
    public void setWeight(double newWeight) {
        if(weight < 0) {
            System.out.println("Error: Negative weight!");
            System.exit(0);
        }
        weight = newWeight;
    }
    
    /**
     * Get's the value of the pet's name.
     * 
     * @return String The pet's name.
     */
    public String getName() {
        return name;
    }
    
    /**
     * Gets the value of the pet's age.
     * 
     * @return Integer The pet's age.
     */
    public int getAge() {
        return age;
    }
    
    /**
     * Gets the value of the pet's weight.
     * 
     * @return Double The pet's weight.
     */
    public double getWeight() {
        return weight;
    }

    public void writeOutput() {
        System.out.println("Name: " + name);
        System.out.println("Age: " + age + " years");
        System.out.println("Weight: " + weight + " pounds");
    }
}
<commit_msg>More documentation<commit_after>public class Pet {
    private String name;
    private int age;
    private double weight;

    // If no starting attributes are given, assign the defaults
    public Pet() {
        name = "Pet";
        age = 0;
        weight = 0;
    }

    public Pet(String name, int age, double weight) {
        this.name = name;

        // If age or weight are invalid, show an error and quit the whole program
        if((age < 0) || (weight < 0)) {
            System.out.println("Error: Negative age or weight!");
            System.exit(0);
        }

        this.age = age;
        this.weight = weight;
    }
    
    /**
     * Sets all the traits of a pet at once. If the new age or new weight is negative
     * the program displays and error and quits the program.
     * 
     * @param newName A String containing the new pet name.
     * @param newAge A positive Integer for the new pet age.
     * @param newWeight A positive Double for the new pet weight.
     * @return Nothing.
     */
    public void setPet(String newName, int newAge, double newWeight) {
        name = newName;
        if((newAge < 0) || (newWeight < 0)) {
            System.out.println("Error: Negative age or weight!");
            System.exit(0);
        }
        weight = newWeight;
    }
    
    /**
     * Change the name of a pet to the given new name.
     * 
     * @param newName String containing the new name.
     * @return Nothing.
     */
    public void setName(String newName) {
        name = newName;
    }
    
    /**
     * Changes the pet's age to the given new age. If it is negative,
     * it print an error and quits the program.
     * 
     * @param newAge A positive Integer to set the age to.
     * @return Nothing.
     */
    public void setAge(int newAge) {
        if(newAge < 0) {
            System.out.println("Error: Negative age!");
            System.exit(0);
        }

        age = newAge;
    }
    
    /**
     * Changes the pet's age to the given new weight. If it is negative,
     * it prints an error and quits the program.
     * 
     * @param newWeight A positive double to set the new weight to. 
     * @return Nothing.
     */
    public void setWeight(double newWeight) {
        if(weight < 0) {
            System.out.println("Error: Negative weight!");
            System.exit(0);
        }
        weight = newWeight;
    }
    
    /**
     * Get's the value of the pet's name.
     * 
     * @return String The pet's name.
     */
    public String getName() {
        return name;
    }
    
    /**
     * Gets the value of the pet's age.
     * 
     * @return Integer The pet's age.
     */
    public int getAge() {
        return age;
    }
    
    /**
     * Gets the value of the pet's weight.
     * 
     * @return Double The pet's weight.
     */
    public double getWeight() {
        return weight;
    }

    public void writeOutput() {
        System.out.println("Name: " + name);
        System.out.println("Age: " + age + " years");
        System.out.println("Weight: " + weight + " pounds");
    }
}

{'fraction_non_alphanumeric': 0.10585391124158176, 'fraction_numerical': 0.004144361940942842, 'mean_word_length': 1.6728195662205814, 'pattern_counts': {'":': 0, '<': 15, '<?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': '1039483', 'n_tokens_mistral': 1736, 'n_tokens_neox': 1647, 'n_words': 593}