public static void compareContextState ( String filterName , SessionContext context , SessionContext copy ) { // TODO - only comparing Attributes. Need to compare the messages too. Iterator < String > it = context . keySet ( ) . iterator ( ) ; String key = it . next ( ) ; while ( key != null ) { if ( ( ! key . equals ( "routingDebug" ) && ! key . equals ( "requestDebug" ) ) ) { Object newValue = context . get ( key ) ; Object oldValue = copy . get ( key ) ; if ( oldValue == null && newValue != null ) { addRoutingDebug ( context , "{" + filterName + "} added " + key + "=" + newValue . toString ( ) ) ; } else if ( oldValue != null && newValue != null ) { if ( ! ( oldValue . equals ( newValue ) ) ) { addRoutingDebug ( context , "{" + filterName + "} changed " + key + "=" + newValue . toString ( ) ) ; } } } if ( it . hasNext ( ) ) { key = it . next ( ) ; } else { key = null ; } } }
Adds debug details about changes that a given filter made to the request context .