Program: 87404
Project: 87404
Buggy source:
private void registerListeners(){
  documentEventBus.addHandler(AmendmentContainerSaveEvent.TYPE,new AmendmentContainerSaveEventHandler(){
    @Override public void onEvent(    final AmendmentContainerSaveEvent event){
      for (      final AmendmentContainerDTO amendment : event.getAmendments()) {
        amendment.setBody(transformer.transform(amendment.getRoot()));
        if (amendment.getRevisionID() == null)         throw new NullPointerException("String_Node_Str");
      }
      serviceFactory.getGwtAmendmentService().saveAmendmentContainers(clientFactory.getClientContext(),new ArrayList<AmendmentContainerDTO>(Arrays.asList(event.getAmendments())),new AsyncCallback<AmendmentContainerDTO[]>(){
        @Override public void onFailure(        final Throwable caught){
          documentEventBus.fireEvent(new CriticalErrorEvent("String_Node_Str",caught));
          if (caught instanceof ValidationException) {
            LOG.log(Level.SEVERE,"String_Node_Str",caught);
          }
        }
        @Override public void onSuccess(        final AmendmentContainerDTO[] result){
          for (          final AmendmentContainerDTO amendmentContainerDTO : result) {
            final AmendmentController amendmentController=documentController.getInjector().getAmendmentController();
            amendmentController.setAmendment(amendmentContainerDTO);
            amendmentController.setDocumentController(documentController);
            int indexOfOlderRevision=-1;
            int counter=0;
            for (            final AmendmentController ac : amendmentControllers) {
              if (amendmentController.getModel().getRevisionID().equals(ac.getModel().getRevisionID())) {
                indexOfOlderRevision=counter;
                break;
              }
              counter++;
            }
            if (indexOfOlderRevision != -1) {
              final AmendmentController removed=amendmentControllers.remove(indexOfOlderRevision);
              amendmentControllers.add(indexOfOlderRevision,amendmentController);
              if (!removed.getDocumentController().equals(amendmentController.getDocumentController())) {
                throw new RuntimeException("String_Node_Str");
              }
              LOG.info("String_Node_Str" + removed + "String_Node_Str"+ amendmentController);
              documentEventBus.fireEvent(new AmendmentContainerUpdatedEvent(removed,amendmentController));
            }
 else {
              amendmentControllers.add(amendmentController);
              LOG.info("String_Node_Str" + amendmentController);
              documentEventBus.fireEvent(new AmendmentContainerInjectEvent(result));
            }
            documentEventBus.fireEvent(new AmendmentContainerSavedEvent(amendmentController));
          }
          documentEventBus.fireEvent(new NotificationEvent(clientFactory.getCoreMessages().amendmentActionSaveSuccessful(result.length)));
        }
      }
);
    }
  }
);
  documentEventBus.addHandler(AmendmentContainerDeleteEvent.TYPE,new AmendmentContainerDeleteEventHandler(){
    @Override public void onEvent(    final AmendmentContainerDeleteEvent event){
      final ArrayList<AmendmentContainerDTO> amendmentContainerDTOs=new ArrayList<AmendmentContainerDTO>(Collections2.transform(Arrays.asList(event.getAmendmentControllers()),new Function<AmendmentController,AmendmentContainerDTO>(){
        @Override public AmendmentContainerDTO apply(        AmendmentController input){
          return input.getModel();
        }
      }
));
      serviceFactory.getGwtAmendmentService().deleteAmendmentContainers(clientFactory.getClientContext(),amendmentContainerDTOs,new AsyncCallback<AmendmentContainerDTO[]>(){
        @Override public void onFailure(        Throwable caught){
          clientFactory.getEventBus().fireEvent(new CriticalErrorEvent("String_Node_Str",caught));
        }
        @Override public void onSuccess(        AmendmentContainerDTO[] result){
          amendmentControllers.removeAll(Arrays.asList(event.getAmendmentControllers()));
          for (int i=0; i < result.length; i++) {
            AmendmentController amendmentController=event.getAmendmentControllers()[i];
            documentEventBus.fireEvent(new AmendmentContainerDeletedEvent(amendmentController));
          }
          documentEventBus.fireEvent(new NotificationEvent(clientFactory.getCoreMessages().amendmentActionDeleteSuccessful(result.length)));
        }
      }
);
    }
  }
);
}

Fixed version (ground truth):
private void registerListeners(){
  final ServiceFactory serviceFactory=documentController.getServiceFactory();
  final ClientFactory clientFactory=documentController.getClientFactory();
  documentEventBus.addHandler(AmendmentContainerSaveEvent.TYPE,new AmendmentContainerSaveEventHandler(){
    @Override public void onEvent(    final AmendmentContainerSaveEvent event){
      for (      final AmendmentContainerDTO amendment : event.getAmendments()) {
        amendment.setBody(transformer.transform(amendment.getRoot()));
        if (amendment.getRevisionID() == null)         throw new NullPointerException("String_Node_Str");
      }
      serviceFactory.getGwtAmendmentService().saveAmendmentContainers(clientFactory.getClientContext(),new ArrayList<AmendmentContainerDTO>(Arrays.asList(event.getAmendments())),new AsyncCallback<AmendmentContainerDTO[]>(){
        @Override public void onFailure(        final Throwable caught){
          documentEventBus.fireEvent(new CriticalErrorEvent("String_Node_Str",caught));
          if (caught instanceof ValidationException) {
            LOG.log(Level.SEVERE,"String_Node_Str",caught);
          }
        }
        @Override public void onSuccess(        final AmendmentContainerDTO[] result){
          for (          final AmendmentContainerDTO amendmentContainerDTO : result) {
            final AmendmentController amendmentController=documentController.getInjector().getAmendmentController();
            amendmentController.setAmendment(amendmentContainerDTO);
            amendmentController.setDocumentController(documentController);
            int indexOfOlderRevision=-1;
            int counter=0;
            for (            final AmendmentController ac : amendmentControllers) {
              if (amendmentController.getModel().getRevisionID().equals(ac.getModel().getRevisionID())) {
                indexOfOlderRevision=counter;
                break;
              }
              counter++;
            }
            if (indexOfOlderRevision != -1) {
              final AmendmentController removed=amendmentControllers.remove(indexOfOlderRevision);
              amendmentControllers.add(indexOfOlderRevision,amendmentController);
              if (!removed.getDocumentController().equals(amendmentController.getDocumentController())) {
                throw new RuntimeException("String_Node_Str");
              }
              LOG.info("String_Node_Str" + removed + "String_Node_Str"+ amendmentController);
              documentEventBus.fireEvent(new AmendmentContainerUpdatedEvent(removed,amendmentController));
            }
 else {
              amendmentControllers.add(amendmentController);
              LOG.info("String_Node_Str" + amendmentController);
              documentEventBus.fireEvent(new AmendmentContainerInjectEvent(result));
            }
            documentEventBus.fireEvent(new AmendmentContainerSavedEvent(amendmentController));
          }
          documentEventBus.fireEvent(new NotificationEvent(clientFactory.getCoreMessages().amendmentActionSaveSuccessful(result.length)));
        }
      }
);
    }
  }
);
  documentEventBus.addHandler(AmendmentContainerDeleteEvent.TYPE,new AmendmentContainerDeleteEventHandler(){
    @Override public void onEvent(    final AmendmentContainerDeleteEvent event){
      final ArrayList<AmendmentContainerDTO> amendmentContainerDTOs=new ArrayList<AmendmentContainerDTO>(Collections2.transform(Arrays.asList(event.getAmendmentControllers()),new Function<AmendmentController,AmendmentContainerDTO>(){
        @Override public AmendmentContainerDTO apply(        AmendmentController input){
          return input.getModel();
        }
      }
));
      serviceFactory.getGwtAmendmentService().deleteAmendmentContainers(clientFactory.getClientContext(),amendmentContainerDTOs,new AsyncCallback<AmendmentContainerDTO[]>(){
        @Override public void onFailure(        Throwable caught){
          clientFactory.getEventBus().fireEvent(new CriticalErrorEvent("String_Node_Str",caught));
        }
        @Override public void onSuccess(        AmendmentContainerDTO[] result){
          amendmentControllers.removeAll(Arrays.asList(event.getAmendmentControllers()));
          for (int i=0; i < result.length; i++) {
            AmendmentController amendmentController=event.getAmendmentControllers()[i];
            documentEventBus.fireEvent(new AmendmentContainerDeletedEvent(amendmentController));
          }
          documentEventBus.fireEvent(new NotificationEvent(clientFactory.getCoreMessages().amendmentActionDeleteSuccessful(result.length)));
        }
      }
);
    }
  }
);
}