Program: 962
Project: 962
Buggy source:
@Override public void registerEventHandler(ComponentSystem handler){
  Class handlerClass=handler.getClass();
  if (!Modifier.isPublic(handlerClass.getModifiers())) {
    logger.error("String_Node_Str",handler.getClass().getName());
    return;
  }
  logger.debug("String_Node_Str" + handlerClass.getName());
  for (  Method method : handlerClass.getMethods()) {
    ReceiveEvent receiveEventAnnotation=method.getAnnotation(ReceiveEvent.class);
    if (receiveEventAnnotation != null) {
      if (!receiveEventAnnotation.netFilter().isValidFor(networkSystem.getMode(),false)) {
        continue;
      }
      Set<Class<? extends Component>> requiredComponents=Sets.newLinkedHashSet();
      method.setAccessible(true);
      Class<?>[] types=method.getParameterTypes();
      logger.debug("String_Node_Str" + method.toString());
      if (!Event.class.isAssignableFrom(types[0]) || !EntityRef.class.isAssignableFrom(types[1])) {
        logger.error("String_Node_Str",method.getName());
        return;
      }
      requiredComponents.addAll(Arrays.asList(receiveEventAnnotation.components()));
      List<Class<? extends Component>> componentParams=Lists.newArrayList();
      for (int i=2; i < types.length; ++i) {
        if (!Component.class.isAssignableFrom(types[i])) {
          logger.error("String_Node_Str",method.getName(),types[i]);
          return;
        }
        requiredComponents.add((Class<? extends Component>)types[i]);
        componentParams.add((Class<? extends Component>)types[i]);
      }
      ByteCodeEventHandlerInfo handlerInfo=new ByteCodeEventHandlerInfo(handler,method,receiveEventAnnotation.priority(),requiredComponents,componentParams);
      if (requiredComponents.isEmpty()) {
        generalHandlers.put((Class<? extends Event>)types[0],handlerInfo);
      }
 else {
        for (        Class<? extends Component> c : requiredComponents) {
          addEventHandler((Class<? extends Event>)types[0],handlerInfo,c);
          for (          Class<? extends Event> childType : childEvents.get((Class<? extends Event>)types[0])) {
            addEventHandler(childType,handlerInfo,c);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void registerEventHandler(ComponentSystem handler){
  Class handlerClass=handler.getClass();
  if (!Modifier.isPublic(handlerClass.getModifiers())) {
    logger.error("String_Node_Str",handler.getClass().getName());
    return;
  }
  logger.debug("String_Node_Str" + handlerClass.getName());
  for (  Method method : handlerClass.getMethods()) {
    ReceiveEvent receiveEventAnnotation=method.getAnnotation(ReceiveEvent.class);
    if (receiveEventAnnotation != null) {
      if (!receiveEventAnnotation.netFilter().isValidFor(networkSystem.getMode(),false)) {
        continue;
      }
      Set<Class<? extends Component>> requiredComponents=Sets.newLinkedHashSet();
      method.setAccessible(true);
      Class<?>[] types=method.getParameterTypes();
      logger.debug("String_Node_Str" + method.toString());
      if (!Event.class.isAssignableFrom(types[0]) || !EntityRef.class.isAssignableFrom(types[1])) {
        logger.error("String_Node_Str",method.getName());
        return;
      }
      requiredComponents.addAll(Arrays.asList(receiveEventAnnotation.components()));
      List<Class<? extends Component>> componentParams=Lists.newArrayList();
      for (int i=2; i < types.length; ++i) {
        if (!Component.class.isAssignableFrom(types[i])) {
          logger.error("String_Node_Str",method.getName(),types[i]);
          return;
        }
        requiredComponents.add((Class<? extends Component>)types[i]);
        componentParams.add((Class<? extends Component>)types[i]);
      }
      ByteCodeEventHandlerInfo handlerInfo=new ByteCodeEventHandlerInfo(handler,method,receiveEventAnnotation.priority(),requiredComponents,componentParams);
      addEventHandler((Class<? extends Event>)types[0],handlerInfo,requiredComponents);
    }
  }
}