String next = tokenizer.getToken(";,");
String next = tokenizer.getString(";,");
	public static ManifestElement[] parseHeader(String header, String value) throws BundleException {		if (value == null)			return (null);		ArrayList headerElements = new ArrayList(10);		Tokenizer tokenizer = new Tokenizer(value);		parseloop: while (true) {			String next = tokenizer.getToken(";,"); //$NON-NLS-1$			if (next == null)				throw new BundleException(NLS.bind(Msg.MANIFEST_INVALID_HEADER_EXCEPTION, header, value));			ArrayList headerValues = new ArrayList();			StringBuffer headerValue = new StringBuffer(next);			headerValues.add(next);			if (Debug.DEBUG && Debug.DEBUG_MANIFEST)				Debug.print("paserHeader: " + next); //$NON-NLS-1$			boolean directive = false;			char c = tokenizer.getChar();			// Header values may be a list of ';' separated values.  Just append them all into one value until the first '=' or ','			while (c == ';') {				next = tokenizer.getToken(";,=:"); //$NON-NLS-1$				if (next == null)					throw new BundleException(NLS.bind(Msg.MANIFEST_INVALID_HEADER_EXCEPTION, header, value));				c = tokenizer.getChar();				while (c == ':') { // may not really be a :=					c = tokenizer.getChar();					if (c != '=') {						String restOfNext = tokenizer.getToken(";,=:"); //$NON-NLS-1$						if (restOfNext == null)							throw new BundleException(NLS.bind(Msg.MANIFEST_INVALID_HEADER_EXCEPTION, header, value));						next += ":" + c + restOfNext; //$NON-NLS-1$						c = tokenizer.getChar();					} else						directive = true;				}				if (c == ';' || c == '\0') /* more */{					headerValues.add(next);					headerValue.append(";").append(next); //$NON-NLS-1$					if (Debug.DEBUG && Debug.DEBUG_MANIFEST)						Debug.print(";" + next); //$NON-NLS-1$				}			}			// found the header value create a manifestElement for it.			ManifestElement manifestElement = new ManifestElement();			manifestElement.value = headerValue.toString();			manifestElement.valueComponents = (String[]) headerValues.toArray(new String[headerValues.size()]);			// now add any attributes/directives for the manifestElement.			while (c == '=' || c == ':') {				while (c == ':') { // may not really be a :=					c = tokenizer.getChar();					if (c != '=') {						String restOfNext = tokenizer.getToken("=:"); //$NON-NLS-1$						if (restOfNext == null)							throw new BundleException(NLS.bind(Msg.MANIFEST_INVALID_HEADER_EXCEPTION, header, value));						next += ":" + c + restOfNext; //$NON-NLS-1$						c = tokenizer.getChar();					} else						directive = true;				}				String val = tokenizer.getString(";,"); //$NON-NLS-1$				if (val == null)					throw new BundleException(NLS.bind(Msg.MANIFEST_INVALID_HEADER_EXCEPTION, header, value));				if (Debug.DEBUG && Debug.DEBUG_MANIFEST)					Debug.print(";" + next + "=" + val); //$NON-NLS-1$ //$NON-NLS-2$				try {					if (directive)						manifestElement.addDirective(next, val);					else						manifestElement.addAttribute(next, val);					directive = false;				} catch (Exception e) {					throw new BundleException(NLS.bind(Msg.MANIFEST_INVALID_HEADER_EXCEPTION, header, value));				}				c = tokenizer.getChar();				if (c == ';') /* more */{					next = tokenizer.getToken("=:"); //$NON-NLS-1$					if (next == null)						throw new BundleException(NLS.bind(Msg.MANIFEST_INVALID_HEADER_EXCEPTION, header, value));					c = tokenizer.getChar();				}			}			headerElements.add(manifestElement);			if (Debug.DEBUG && Debug.DEBUG_MANIFEST)				Debug.println(""); //$NON-NLS-1$			if (c == ',') /* another manifest element */				continue parseloop;			if (c == '\0') /* end of value */				break parseloop;			throw new BundleException(NLS.bind(Msg.MANIFEST_INVALID_HEADER_EXCEPTION, header, value));		}		int size = headerElements.size();		if (size == 0)			return (null);		ManifestElement[] result = (ManifestElement[]) headerElements.toArray(new ManifestElement[size]);		return (result);	}