public void addExceptionContext(ExceptionContext exceptionContext){
  ExceptionMessage mostRecent;
  mostRecent=m_exceptionMessages.lastElement();
  if (null != mostRecent) {
    mostRecent.addExceptionContext(exceptionContext);
  }
 else {
    m_exceptionContexts.addElement(exceptionContext);
  }
  if (null != m_nestedException) {
    Enumeration<?> enumeration;
    enumeration=m_nestedException.getAllExceptionMessages();
    ExceptionMessage exceptionMessage;
    while (enumeration.hasMoreElements()) {
      exceptionMessage=(ExceptionMessage)enumeration.nextElement();
      exceptionMessage.addExceptionContext(exceptionContext);
    }
  }
}

public void addExceptionContext ( ExceptionContext exceptionContext ) { ExceptionMessage mostRecent ; mostRecent = m_exceptionMessages . lastElement ( ) ; if ( null != mostRecent ) { mostRecent . addExceptionContext ( exceptionContext ) ; } else { m_exceptionContexts . addElement ( exceptionContext ) ; } if ( null != m_nestedException ) { Enumeration < ? > enumeration ; enumeration = m_nestedException . getAllExceptionMessages ( ) ; ExceptionMessage exceptionMessage ; while ( enumeration . hasMoreElements ( ) ) { exceptionMessage = ( ExceptionMessage ) enumeration . nextElement ( ) ; exceptionMessage . addExceptionContext ( exceptionContext ) ; } } }
add context to exception messages within this exception . the context is effectively a named parameter used within the messages . < p > the rules : < p > 1 . if this exception contains messages the context will be applied only to the most recent message . 2 . if this exception contains no messages the context will be applied to the next exception message that is added if one is ever added . 3 . regardless of the outcome of ( 1 ) and ( 2 ) above , the context will be applied to all messages contained within any child exceptions ( exceptions nested within this exception ) .
