<commit_before>package com.thoughtworks.go.plugin.configrepo.material;


import com.thoughtworks.go.plugin.configrepo.ErrorCollection;
import org.apache.commons.lang.StringUtils;

public class CRPackageMaterial_1 extends CRMaterial_1 {
    public static final String TYPE_NAME = "package";

    private String packageId;

    public CRPackageMaterial_1() {
        type = TYPE_NAME;
    }
    public CRPackageMaterial_1(String packageId)
    {
        type = TYPE_NAME;
        this.packageId = packageId;
    }
    public CRPackageMaterial_1(String material,String packageId)
    {
        super(TYPE_NAME,material);
        this.packageId = packageId;
    }

    @Override
    public String typeName() {
        return TYPE_NAME;
    }

    @Override
    public void getErrors(ErrorCollection errors) {
        validatePackageId(errors);
    }

    private void validatePackageId(ErrorCollection errors) {
        if (StringUtils.isBlank(packageId)) {
            errors.add(this,"Package repository not set. Please select a repository and package");
        }
    }

    public String getPackageId() {
        return packageId;
    }

    public void setPackageId(String packageId) {
        this.packageId = packageId;
    }
}<commit_msg>#1133 fix - CRPackageMaterial_1 equals impl<commit_after>package com.thoughtworks.go.plugin.configrepo.material;


import com.thoughtworks.go.plugin.configrepo.ErrorCollection;
import org.apache.commons.lang.StringUtils;

public class CRPackageMaterial_1 extends CRMaterial_1 {
    public static final String TYPE_NAME = "package";

    private String packageId;

    public CRPackageMaterial_1() {
        type = TYPE_NAME;
    }
    public CRPackageMaterial_1(String packageId)
    {
        type = TYPE_NAME;
        this.packageId = packageId;
    }
    public CRPackageMaterial_1(String material,String packageId)
    {
        super(TYPE_NAME,material);
        this.packageId = packageId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        CRPackageMaterial_1 that = (CRPackageMaterial_1) o;
        if(!super.equals(that))
            return false;

        if (packageId != null ? !packageId.equals(that.packageId) : that.packageId != null) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        int result = super.hashCode();
        result = 31 * result + (packageId != null ? packageId.hashCode() : 0);
        return result;
    }

    @Override
    public String typeName() {
        return TYPE_NAME;
    }

    @Override
    public void getErrors(ErrorCollection errors) {
        validatePackageId(errors);
    }

    private void validatePackageId(ErrorCollection errors) {
        if (StringUtils.isBlank(packageId)) {
            errors.add(this,"Package repository not set. Please select a repository and package");
        }
    }

    public String getPackageId() {
        return packageId;
    }

    public void setPackageId(String packageId) {
        this.packageId = packageId;
    }
}
{'fraction_non_alphanumeric': 0.08822605965463108, 'fraction_numerical': 0.006279434850863423, 'mean_word_length': 2.532150776053215, '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': '382705', 'n_tokens_mistral': 904, 'n_tokens_neox': 874, 'n_words': 208}