public PermissionInfo(String encodedPermission) { if (encodedPermission == null) { throw new NullPointerException("missing encoded permission");
public PermissionInfo(String type, String name, String actions) { this.type = type; this.name = name; this.actions = actions; if (type == null) { throw new NullPointerException("type is null");
	public PermissionInfo(String encodedPermission) {		if (encodedPermission == null) {			throw new NullPointerException("missing encoded permission");		}		if (encodedPermission.length() == 0) {			throw new IllegalArgumentException("empty encoded permission");		}		try {			char[] encoded = encodedPermission.toCharArray();			/* the first character must be '(' */			if (encoded[0] != '(') {				throw new IllegalArgumentException(						"first character not open parenthesis");			}			/* type is not quoted or encoded */			int end = 1;			int begin = end;			while ((encoded[end] != ' ') && (encoded[end] != ')')) {				end++;			}			if (end == begin) {				throw new IllegalArgumentException("expecting type");			}			this.type = new String(encoded, begin, end - begin);			/* type may be followed by name which is quoted and encoded */			if (encoded[end] == ' ') {				end++;				if (encoded[end] != '"') {					throw new IllegalArgumentException("expecting quoted name");				}				end++;				begin = end;				while (encoded[end] != '"') {					if (encoded[end] == '\\') {						end++;					}					end++;				}				this.name = decodeString(encoded, begin, end);				end++;				/* name may be followed by actions which is quoted and encoded */				if (encoded[end] == ' ') {					end++;					if (encoded[end] != '"') {						throw new IllegalArgumentException(								"expecting quoted actions");					}					end++;					begin = end;					while (encoded[end] != '"') {						if (encoded[end] == '\\') {							end++;						}						end++;					}					this.actions = decodeString(encoded, begin, end);					end++;				}			}			/* the final character must be ')' */			if ((encoded[end] != ')') || (end + 1 != encoded.length)) {				throw new IllegalArgumentException("last character not "						+ "close parenthesis");			}		}		catch (ArrayIndexOutOfBoundsException e) {			throw new IllegalArgumentException("parsing terminated abruptly");		}	}