if (m.getType() instanceof MiscType && m.getType().hasFlag(MiscType.F_ECM)) {
EquipmentType type = m.getType(); if (type instanceof MiscType && type.hasFlag(MiscType.F_ECM)) {
    public boolean hasActiveECM() {        for (Enumeration e = getMisc(); e.hasMoreElements(); ) {            Mounted m = (Mounted)e.nextElement();            if (m.getType() instanceof MiscType && m.getType().hasFlag(MiscType.F_ECM)) {                return !(m.isDestroyed() || m.isMissing());            }        }        return false;    }