question: @ LogMessageDoc ( level = "ERROR" , message = "No listener dependency solution: " + "No listeners without incoming dependencies" , explanation = "The set of listeners installed " + "have dependencies with no solution" , recommendation = "Install a different set of listeners " + "or install all dependencies.  This is a defect in " + "the controller installation." ) public void addListener ( U type , T listener ) { List < T > newlisteners = new ArrayList < T > ( ) ; if ( listeners != null ) newlisteners . addAll ( listeners ) ; newlisteners . add ( listener ) ; List < T > terminals = new ArrayList < T > ( ) ; for ( T i : newlisteners ) { boolean isterm = true ; for ( T j : newlisteners ) { if ( ispre ( type , i , j ) ) { isterm = false ; break ; } } if ( isterm ) { terminals . add ( i ) ; } } if ( terminals . size ( ) == 0 ) { logger . error ( "No listener dependency solution: " + "No listeners without incoming dependencies" ) ; listeners = newlisteners ; return ; } HashSet < T > visited = new HashSet < T > ( ) ; List < T > ordering = new ArrayList < T > ( ) ; for ( T term : terminals ) { visit ( newlisteners , type , visited , ordering , term ) ; } listeners = ordering ; }
target:  Add a listener to the list of listeners