<commit_before>package com.apps.darkstorm.swrpg.StarWars.CharStuff;

import java.util.ArrayList;

public class Weapon{
    //<editor-fold desc="Vars v1">
    //Version 1 0-12
    public String name;
    public int dmg;
    public int crit;
    public int hp;
    public int range;
    public int skill;
    public int skillBase;
    public WeapChars chars = new WeapChars();
    public boolean addBrawn;
    public boolean loaded = true;
    public boolean slug;
    //0-Good,1-Minor,2-Moderate,3-Major
    public int itemState;
    public int ammo;
    //Version 2 13
    public String firingArc;
    //</editor-fold>
    public void copyFrom(Weapon w){
        name = w.name;
        dmg = w.dmg;
        crit = w.crit;
        hp = w.hp;
        range = w.range;
        skill = w.skill;
        skillBase = w.skillBase;
        chars = w.chars.clone();
        addBrawn = w.addBrawn;
        loaded = w.loaded;
        slug = w.slug;
        itemState = w.itemState;
        ammo = w.ammo;
        firingArc = w.firingArc;
    }
    public Weapon clone(){
        Weapon tmp;
        try {
            tmp = (Weapon)super.clone();
        } catch (CloneNotSupportedException ignored) {
            tmp = new Weapon();
        }
        tmp.name = name;
        tmp.dmg = dmg;
        tmp.crit = crit;
        tmp.hp = hp;
        tmp.range = range;
        tmp.skill = skill;
        tmp.skillBase = skillBase;
        tmp.chars = chars.clone();
        tmp.addBrawn = addBrawn;
        tmp.loaded = loaded;
        tmp.slug = slug;
        tmp.itemState = itemState;
        tmp.ammo = ammo;
        tmp.firingArc = firingArc;
        return tmp;
    }
    public Object serialObject(){
        ArrayList<Object> tmp = new ArrayList<>();
        tmp.add(name);
        tmp.add(dmg);
        tmp.add(crit);
        tmp.add(hp);
        tmp.add(range);
        tmp.add(skill);
        tmp.add(skillBase);
        tmp.add(chars.serialObject());
        tmp.add(addBrawn);
        tmp.add(loaded);
        tmp.add(slug);
        tmp.add(itemState);
        tmp.add(ammo);
        tmp.add(firingArc);
        return tmp.toArray();
    }
    public void loadFromObject(Object obj){
        Object[] tmp = (Object[])obj;
        switch (tmp.length){
            case 14:
                firingArc = (String)tmp[13];
            case 13:
                firingArc = "";
                name = (String)tmp[0];
                dmg = (int)tmp[1];
                crit = (int)tmp[2];
                hp = (int)tmp[3];
                range = (int)tmp[4];
                skill = (int)tmp[5];
                skillBase = (int)tmp[6];
                WeapChars wc = new WeapChars();
                wc.loadFromObject(tmp[7]);
                chars = wc;
                addBrawn = (boolean)tmp[8];
                loaded = (boolean)tmp[9];
                slug = (boolean)tmp[10];
                itemState = (int)tmp[11];
                ammo = (int)tmp[12];
        }
    }
    public boolean equals(Object obj){
        if (!(obj instanceof Weapon))
            return false;
        Weapon in = (Weapon)obj;
        return in.name.equals(name) && in.dmg == dmg && in.crit == crit && in.hp == hp && in.range == range && in.skill == skill
                && in.skillBase == skillBase && in.chars.equals(chars) && in.addBrawn == addBrawn && in.loaded == loaded && in.slug == slug
                && in.itemState == itemState && in.ammo == ammo && in.firingArc.equals(firingArc);
    }
}<commit_msg>Fixed possible crash<commit_after>package com.apps.darkstorm.swrpg.StarWars.CharStuff;

import java.util.ArrayList;

public class Weapon{
    //<editor-fold desc="Vars v1">
    //Version 1 0-12
    public String name;
    public int dmg;
    public int crit;
    public int hp;
    public int range;
    public int skill;
    public int skillBase;
    public WeapChars chars = new WeapChars();
    public boolean addBrawn;
    public boolean loaded = true;
    public boolean slug;
    //0-Good,1-Minor,2-Moderate,3-Major
    public int itemState;
    public int ammo;
    //Version 2 13
    public String firingArc;
    //</editor-fold>
    public void copyFrom(Weapon w){
        name = w.name;
        dmg = w.dmg;
        crit = w.crit;
        hp = w.hp;
        range = w.range;
        skill = w.skill;
        skillBase = w.skillBase;
        chars = w.chars.clone();
        addBrawn = w.addBrawn;
        loaded = w.loaded;
        slug = w.slug;
        itemState = w.itemState;
        ammo = w.ammo;
        firingArc = w.firingArc;
    }
    public Weapon clone(){
        Weapon tmp;
        try {
            tmp = (Weapon)super.clone();
        } catch (CloneNotSupportedException ignored) {
            tmp = new Weapon();
        }
        tmp.name = name;
        tmp.dmg = dmg;
        tmp.crit = crit;
        tmp.hp = hp;
        tmp.range = range;
        tmp.skill = skill;
        tmp.skillBase = skillBase;
        tmp.chars = chars.clone();
        tmp.addBrawn = addBrawn;
        tmp.loaded = loaded;
        tmp.slug = slug;
        tmp.itemState = itemState;
        tmp.ammo = ammo;
        tmp.firingArc = firingArc;
        return tmp;
    }
    public Object serialObject(){
        ArrayList<Object> tmp = new ArrayList<>();
        tmp.add(name);
        tmp.add(dmg);
        tmp.add(crit);
        tmp.add(hp);
        tmp.add(range);
        tmp.add(skill);
        tmp.add(skillBase);
        tmp.add(chars.serialObject());
        tmp.add(addBrawn);
        tmp.add(loaded);
        tmp.add(slug);
        tmp.add(itemState);
        tmp.add(ammo);
        tmp.add(firingArc);
        return tmp.toArray();
    }
    public void loadFromObject(Object obj){
        Object[] tmp = (Object[])obj;
        switch (tmp.length){
            case 14:
                firingArc = (String)tmp[13];
            case 13:
                if (firingArc == null)
                    firingArc = "";
                name = (String)tmp[0];
                dmg = (int)tmp[1];
                crit = (int)tmp[2];
                hp = (int)tmp[3];
                range = (int)tmp[4];
                skill = (int)tmp[5];
                skillBase = (int)tmp[6];
                WeapChars wc = new WeapChars();
                wc.loadFromObject(tmp[7]);
                chars = wc;
                addBrawn = (boolean)tmp[8];
                loaded = (boolean)tmp[9];
                slug = (boolean)tmp[10];
                itemState = (int)tmp[11];
                ammo = (int)tmp[12];
        }
    }
    public boolean equals(Object obj){
        if (!(obj instanceof Weapon))
            return false;
        Weapon in = (Weapon)obj;
        return in.name.equals(name) && in.dmg == dmg && in.crit == crit && in.hp == hp && in.range == range && in.skill == skill
                && in.skillBase == skillBase && in.chars.equals(chars) && in.addBrawn == addBrawn && in.loaded == loaded && in.slug == slug
                && in.itemState == itemState && in.ammo == ammo && in.firingArc.equals(firingArc);
    }
}
{'fraction_non_alphanumeric': 0.12887624466571834, 'fraction_numerical': 0.009672830725462305, 'mean_word_length': 1.583976479235575, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '4334699', 'n_tokens_mistral': 2266, 'n_tokens_neox': 2207, 'n_words': 501}