Buggy code:
@ Component ( "commonProblemMetricsDisplayActionNG" ) public class ProblemMetricsDisplayActionNG extends BaseActionNG implements ViewPreparer { private final Log log = LogFactory . getLog ( ProblemMetricsDisplayActionNG . class ) ; private static final String RESOURCE_NAMES = "ProblemMetricsDisplayAction_resourceNames" ; @ Autowired private AppdefBoss appdefBoss ; @ Autowired private MeasurementBoss measurementBoss ; public void execute ( TilesRequestContext tilesContext , AttributeContext attributeContext ) { try { WebUser user = RequestUtils . getWebUser ( getServletRequest ( ) ) ; int sessionId = user . getSessionId ( ) . intValue ( ) ; AppdefEntityID aeid = RequestUtils . getEntityId ( getServletRequest ( ) ) ; Map < String , Object > range = user . getMetricRangePreference ( ) ; long begin = ( ( Long ) ( range . get ( BEGIN ) ) ) . longValue ( ) ; long end = ( ( Long ) ( range . get ( END ) ) ) . longValue ( ) ; ProblemMetricsDisplayFormNG probForm = new ProblemMetricsDisplayFormNG ( ) ; Object childObj = getServletRequest ( ) . getSession ( ) . getAttribute ( "child" ) ; Object hostObj = getServletRequest ( ) . getSession ( ) . getAttribute ( "host" ) ; <START_BUG> Object eidObj = getServletRequest ( ) . getSession ( ) . getAttribute ( "eid" ) ; <END_BUG> if ( childObj instanceof String ) { probForm . setChild ( new String [ ] { ( ( String ) ( childObj ) ) } ) ; } if ( childObj instanceof String [ ] ) { probForm . setChild ( ( ( String [ ] ) ( childObj ) ) ) ; } if ( hostObj instanceof String ) { probForm . setHost ( new String [ ] { ( ( String ) ( hostObj ) ) } ) ; } if ( hostObj instanceof String [ ] ) { probForm . setHost ( ( ( String [ ] ) ( hostObj ) ) ) ; } if ( eidObj instanceof String ) { probForm . setEid ( new String [ ] { ( ( String ) ( eidObj ) ) } ) ; } if ( eidObj instanceof String [ ] ) { probForm . setEid ( ( ( String [ ] ) ( eidObj ) ) ) ; } String [ ] resStrs ; AppdefEntityID [ ] hosts = null ; Map < String , String > resourceNames = new HashMap < String , String > ( ) ; getServletRequest ( ) . getSession ( ) . removeAttribute ( ProblemMetricsDisplayActionNG . RESOURCE_NAMES ) ; if ( ( ( resStrs = probForm . getHost ( ) ) . length ) > 0 ) { hosts = new AppdefEntityID [ resStrs . length ] ; for ( int i = 0 ; i < ( resStrs . length ) ; i ++ ) { hosts [ i ] = new AppdefEntityID ( resStrs [ i ] ) ; } PageList < AppdefResourceValue > resources = appdefBoss . findByIds ( sessionId , hosts , null ) ; for ( Iterator < AppdefResourceValue > i = resources . iterator ( ) ; i . hasNext ( ) ; ) { AppdefResourceValue resource = i . next ( ) ; resourceNames . put ( resource . getEntityId ( ) . getAppdefKey ( ) , resource . getName ( ) ) ; } if ( ! ( resourceNames . isEmpty ( ) ) ) { getServletRequest ( ) . getSession ( ) . setAttribute ( ProblemMetricsDisplayActionNG . RESOURCE_NAMES , resourceNames ) ; } } AppdefEntityTypeID childTypeID = null ; if ( ( ( probForm . getCtype ( ) ) != null ) && ( ( probForm . getCtype ( ) . length ( ) ) > 0 ) ) { childTypeID = new AppdefEntityTypeID ( probForm . getCtype ( ) ) ; } List < ProblemMetricSummary > problems ; if ( ( ( resStrs = probForm . getEids ( ) ) . length ) > 0 ) { AppdefEntityID [ ] entities = new AppdefEntityID [ resStrs . length ] ; for ( int i = 0 ; i < ( resStrs . length ) ; i ++ ) { entities [ i ] = new AppdefEntityID ( resStrs [ i ] ) ; } AppdefEntityTypeID [ ] childTypes = null ; if ( childTypeID != null ) { childTypes = new AppdefEntityTypeID [ ] { childTypeID } ; } problems = measurementBoss . findAllMetrics ( sessionId , aeid , hosts , childTypes , entities , begin , end ) ; getServletRequest ( ) . getSession ( ) . setAttribute ( ( ( aeid . getAppdefKey ( ) ) + ".entities" ) , entities ) ; } else if ( childTypeID != null ) { if ( ( probForm . getHost ( ) . length ) > 0 ) { AppdefEntityTypeID [ ] children = new AppdefEntityTypeID [ ] { childTypeID } ; problems = measurementBoss . findAllMetrics ( sessionId , aeid , null , children , begin , end ) ; } else { problems = measurementBoss . findAllMetrics ( sessionId , aeid , childTypeID , begin , end ) ; } } else { AppdefEntityTypeID [ ] children = null ; if ( ( ( resStrs = probForm . getChild ( ) ) . length ) > 0 ) { children = new AppdefEntityTypeID [ resStrs . length ] ; for ( int i = 0 ; i < ( resStrs . length ) ; i ++ ) { children [ i ] = new AppdefEntityTypeID ( resStrs [ i ] ) ; } } problems = measurementBoss . findAllMetrics ( sessionId , aeid , hosts , children , begin , end ) ; getServletRequest ( ) . getSession ( ) . removeAttribute ( ( ( aeid . getAppdefKey ( ) ) + ".entities" ) ) ; } tilesContext . getRequestScope ( ) . put ( "problems" , problems ) ; tilesContext . getRequestScope ( ) . put ( "probForm" , probForm ) ; }

Fix:
Object eidObj = getServletRequest ( ) . getSession ( ) . getAttribute ( "eids" ) ;