Buggy code:
public class Container implements Cloneable { private ContextManager contextM ; Context context ; public static final int UNKNOWN_MAP = 0 ; public static final int PATH_MAP = 1 ; public static final int PREFIX_MAP = 2 ; public static final int EXTENSION_MAP = 3 ; public static final int DEFAULT_MAP = 4 ; int mapType = 0 ; String transport ; String path ; String proto ; String [ ] vhosts ; private Hashtable attributes = new Hashtable ( ) ; Handler handler ; String handlerName ; String [ ] roles = null ; String [ ] methods = null ; public Container ( ) { } public ContextManager getContextManager ( ) { } public void setContextManager ( ContextManager cm ) { } public void setContext ( Context ctx ) { } public Context getContext ( ) { } public int getMapType ( ) { } public void setPath ( String path ) { } public String getPath ( ) { } public void setProtocol ( String protocol ) { } public String getProtocol ( ) { } public void setTransport ( String transport ) { } public String getTransport ( ) { } public String [ ] getVhosts ( ) { } public void setVhosts ( String [ ] vhosts ) { } public String [ ] getMethods ( ) { } public void setMethods ( String [ ] m ) { } public Handler getHandler ( ) { } public void setHandler ( Handler h ) { } public void setHandlerName ( String hn ) { } public String getHandlerName ( ) { } public String [ ] getRoles ( ) { } public void setRoles ( String [ ] roles ) { } public Object getAttribute ( String name ) { } public Enumeration getAttributeNames ( ) { } public void setAttribute ( String name , Object object ) { } public void removeAttribute ( String name ) { } public String toString ( ) { } public Container getClone ( ) { } Object [ ] notes = new Object [ ContextManager . MAX_NOTES ] ; public void setNote ( int pos , Object value ) { } public Object getNote ( int pos ) { } public static final int H_requestMap = 0 ; public static final int H_contextMap = 1 ; public static final int H_authenticate = 2 ; public static final int H_authorize = 3 ; public static final int H_preService = 4 ; public static final int H_beforeBody = 5 ; public static final int H_findSession = 6 ; public static final int H_sessionState = 7 ; public static final int H_beforeCommit = 8 ; public static final int H_afterBody = 9 ; public static final int H_postService = 10 ; public static final int H_postRequest = 11 ; public static final int H_handleError = 12 ; public static final int H_engineInit = 13 ; public static final int H_COUNT = 14 ; Hooks hooks = new Hooks ( ) ; BaseInterceptor [ ] [ ] hooksCache = null ; BaseInterceptor [ ] allHooksCache = null ; private void initHooks ( ) { } public Hooks getHooks ( ) { } public void addInterceptor ( BaseInterceptor bi ) { bi . setContext ( getContext ( ) ) ; if ( Hooks . hasHook ( bi , "registerHooks" ) ) { <START_BUG> bi . registerHooks ( hooks ) ; <END_BUG> } else { hooks . addModule ( bi ) ; } hooksCache = null ; allHooksCache = null ; } public void removeInterceptor ( BaseInterceptor bi ) { } public BaseInterceptor [ ] getInterceptors ( int type ) { } public BaseInterceptor [ ] getInterceptors ( ) { } private BaseInterceptor [ ] mergeHooks ( Object [ ] globalM , Object [ ] localM ) { } public void resetInterceptorCache ( int id ) { } public static final int dL = 0 ; private void debug ( String s ) { } }

Fix:
bi . registerHooks ( hooks , contextM , context ) ;