canonUnitNames.add(name);
canonUnitNames.addElement(name);
    private void postLoadInit(Entity ent) throws EntityLoadingException {        // Walk through the list of equipment.        for (Enumeration e = ent.getMisc(); e.hasMoreElements(); ) {            Mounted m = (Mounted)e.nextElement();            // Link Artemis IV fire-control systems to their missle racks.            if (m.getType().hasFlag(MiscType.F_ARTEMIS) && m.getLinked() == null) {                // link up to a weapon in the same location                for (Enumeration e2 = ent.getWeapons(); e2.hasMoreElements(); ) {                    Mounted mWeapon = (Mounted)e2.nextElement();                    WeaponType wtype = (WeaponType)mWeapon.getType();                    // only srm and lrm are valid for artemis                    if (wtype.getAmmoType() != AmmoType.T_LRM && wtype.getAmmoType() != AmmoType.T_SRM) {                        continue;                    }                    // already linked?                    if (mWeapon.getLinkedBy() != null) {                        continue;                    }                    // check location                    if (mWeapon.getLocation() == m.getLocation()) {                        m.setLinked(mWeapon);                        break;                    }                    // also, mechs have a special location rule                    else if (ent instanceof Mech && m.getLocation() == Mech.LOC_HEAD &&                                mWeapon.getLocation() == Mech.LOC_CT) {                        m.setLinked(mWeapon);                        break;                    }                }                if (m.getLinked() == null) {                    // huh.  this shouldn't happen                    throw new EntityLoadingException("Unable to match Artemis to launcher");                }            } // End link-Artemis            else if ( Mech.STEALTH.equals(m.getType().getInternalName()) &&                      m.getLinked() == null ) {                // Find an ECM suite to link to the stealth system.                // Stop looking after we find the first ECM suite.                for ( Enumeration equips = ent.getMisc(); equips.hasMoreElements(); ) {                    Mounted mEquip = (Mounted) equips.nextElement();                    MiscType mtype = (MiscType) mEquip.getType();                    if ( mtype.hasFlag(MiscType.F_ECM) ) {                        m.setLinked( mEquip );                        break;                    }                }                if (m.getLinked() == null) {                    // This mech has stealth armor but no ECM.  Probably                    //  an improperly created custom.                    throw new EntityLoadingException("Unable to find an ECM Suite.  Mechs with Stealth Armor must also be equipped with an ECM Suite.");                }            } // End link-Stealth        } // Check the next piece of equipment.                //Check if it's canon; if it is, mark it as such.        ent.setCanon(false);//Guilty until proven innocent        try {            if(canonUnitNames==null) {                canonUnitNames=new Vector();                //init the list.                BufferedReader br = null;                try {                    br = new BufferedReader(new FileReader(OFFICIALUNITS));                } catch (FileNotFoundException e) {                }                String s;                String name;                while ((s = br.readLine()) != null) {                    int nIndex1 = s.indexOf('|');                    name=s.substring(0, nIndex1);                    canonUnitNames.add(name);                }            }        } catch (IOException e) {            }        for(Enumeration i = canonUnitNames.elements(); i.hasMoreElements();) {            String s = (String)i.nextElement();            if(s.equals(ent.getShortName())) {                ent.setCanon(true);            }        }                        } // End private void postLoadInit(Entity) throws EntityLoadingException