private void attachHeader(SIPHeader h){
  if (h == null)   throw new IllegalArgumentException("null header!");
  try {
    if (h instanceof SIPHeaderList) {
      SIPHeaderList<?> hl=(SIPHeaderList<?>)h;
      if (hl.isEmpty()) {
        return;
      }
    }
    attachHeader(h,false,false);
  }
 catch (  SIPDuplicateHeaderException ex) {
  }
}

private void attachHeader ( SIPHeader h ) { if ( h == null ) throw new IllegalArgumentException ( "null header!" ) ; try { if ( h instanceof SIPHeaderList ) { SIPHeaderList < ? > hl = ( SIPHeaderList < ? > ) h ; if ( hl . isEmpty ( ) ) { return ; } } attachHeader ( h , false , false ) ; } catch ( SIPDuplicateHeaderException ex ) { } }
attach a header and die if you get a duplicate header exception .
