nameTable.remove(headerName.toLowerCase());  if (toRemove instanceof From) { this.fromHeader = null; } else if (toRemove instanceof To) { this.toHeader = null; } else if (toRemove instanceof CSeq) { this.cSeqHeader = null; } else if (toRemove instanceof CallID) { this.callIdHeader = null; } else if (toRemove instanceof MaxForwards) { this.maxForwardsHeader = null; } else if (toRemove instanceof ContentLength) { this.contentLengthHeader = null;
if (toRemove instanceof SIPHeaderList) { SIPHeaderList hdrList = (SIPHeaderList) toRemove; if (top) hdrList.removeFirst(); else hdrList.removeLast();  if (hdrList.isEmpty()) { ListIterator li = this.headers.listIterator(); while (li.hasNext()) { SIPHeader sipHeader = (SIPHeader) li.next(); if (sipHeader.getName().equalsIgnoreCase(headerName)) li.remove(); } } } else { this.nameTable.remove(headerName.toLowerCase()); if (toRemove instanceof From) { this.fromHeader = null; } else if (toRemove instanceof To) { this.toHeader = null; } else if (toRemove instanceof CSeq) { this.cSeqHeader = null; } else if (toRemove instanceof CallID) { this.callIdHeader = null; } else if (toRemove instanceof MaxForwards) { this.maxForwardsHeader = null; } else if (toRemove instanceof ContentLength) { this.contentLengthHeader = null; } ListIterator li = this.headers.listIterator(); while (li.hasNext()) { SIPHeader sipHeader = (SIPHeader) li.next(); if (sipHeader.getName().equalsIgnoreCase(headerName)) li.remove(); }
	public void removeHeader(String headerName) {		if (headerName == null)			throw new NullPointerException("null arg");		SIPHeader toRemove =			(SIPHeader) nameTable.get(headerName.toLowerCase());		// nothing to do then we are done.		if (toRemove == null)			return;		nameTable.remove(headerName.toLowerCase());		// Remove the fast accessor fields.		if (toRemove instanceof From) {			this.fromHeader = null;		} else if (toRemove instanceof To) {			this.toHeader = null;		} else if (toRemove instanceof CSeq) {			this.cSeqHeader = null;		} else if (toRemove instanceof CallID) {			this.callIdHeader = null;		} else if (toRemove instanceof MaxForwards) {			this.maxForwardsHeader = null;		} else if (toRemove instanceof ContentLength) {			this.contentLengthHeader = null;		}		ListIterator li = this.headers.listIterator();		while (li.hasNext()) {			SIPHeader sipHeader = (SIPHeader) li.next();			if (sipHeader.getName().equalsIgnoreCase(headerName))				li.remove();		}	}