if (!attValue.startsWith(ENCODE_PREFIX)) { throw new IllegalArgumentException("badly encoded module revision id: '"+encoded+"': "+attValue+" doesn't start with "+ENCODE_PREFIX); } else { attValue = attValue.substring(1); }
    public static ModuleRevisionId decode(String encoded) {        String[] parts = encoded.split(ENCODE_SEPARATOR);        if (parts.length % 2 != 0) {            throw new IllegalArgumentException("badly encoded module revision id: '"+encoded+"'");        }        Map attributes = new HashMap();        for (int i = 0; i < parts.length; i+=2) {            String attName = parts[i];            String attValue = parts[i+1];            attributes.put(attName, attValue);        }        String org = (String)attributes.remove(IvyPatternHelper.ORGANISATION_KEY);        String mod = (String)attributes.remove(IvyPatternHelper.MODULE_KEY);        String rev = (String)attributes.remove(IvyPatternHelper.REVISION_KEY);        if (org == null) {            throw new IllegalArgumentException("badly encoded module revision id: '"+encoded+"': no organisation");        }        if (mod == null) {            throw new IllegalArgumentException("badly encoded module revision id: '"+encoded+"': no module name");        }        if (rev == null) {            throw new IllegalArgumentException("badly encoded module revision id: '"+encoded+"': no revision");        }        return newInstance(org, mod, rev, attributes);    }