Program: 63092
Project: 63092
Buggy source:
private void actionRejectRecommendation(AnnotationActionHandler aActionHandler,AnnotatorState aState,AjaxRequestTarget aTarget,JCas aJCas,VID aVID,int aBegin,int aEnd) throws AnnotationException {
  Predictions model=recommendationService.getPredictions(aState.getUser(),aState.getProject());
  Recommender recommender=recommendationService.getRecommender(aVID.getId());
  AnnotationLayer layer=annotationService.getLayer(aVID.getLayerId());
  AnnotationFeature feature=annotationService.getFeature(recommender.getFeature(),layer);
  AnnotationObject prediction=model.getPredictionByVID(aVID);
  String predictedValue=prediction.getAnnotation();
  String tokenText=aJCas.getDocumentText().substring(aBegin,aEnd);
  LearningRecord record=new LearningRecord();
  record.setUser(aState.getUser().getUsername());
  record.setSourceDocument(aState.getDocument());
  record.setUserAction(LearningRecordUserAction.REJECTED);
  record.setOffsetCharacterBegin(prediction.getOffset().getBeginCharacter());
  record.setOffsetCharacterEnd(prediction.getOffset().getEndCharacter());
  record.setOffsetTokenBegin(prediction.getOffset().getBeginToken());
  record.setOffsetTokenEnd(prediction.getOffset().getEndToken());
  record.setTokenText(tokenText);
  record.setAnnotation(predictedValue);
  record.setLayer(layer);
  record.setChangeLocation(LearningRecordChangeLocation.MAIN_EDITOR);
  learningRecordService.create(record);
  aActionHandler.actionSelect(aTarget,aJCas);
  aTarget.getPage().send(aTarget.getPage(),Broadcast.BREADTH,new AjaxRecommendationRejectedEvent(aTarget,aState,aVID));
  applicationEventPublisher.publishEvent(new RecommendationRejectedEvent(this,aState.getDocument(),aState.getUser().getUsername(),aBegin,aEnd,tokenText,feature,predictedValue));
}

Fixed version (ground truth):
private void actionRejectRecommendation(AnnotationActionHandler aActionHandler,AnnotatorState aState,AjaxRequestTarget aTarget,JCas aJCas,VID aVID,int aBegin,int aEnd) throws AnnotationException {
  Predictions model=recommendationService.getPredictions(aState.getUser(),aState.getProject());
  Recommender recommender=recommendationService.getRecommender(aVID.getId());
  AnnotationLayer layer=annotationService.getLayer(aVID.getLayerId());
  AnnotationFeature feature=annotationService.getFeature(recommender.getFeature(),layer);
  SourceDocument document=aState.getDocument();
  Optional<AnnotationObject> oPrediction=model.getPredictionByVID(document,aVID);
  if (!oPrediction.isPresent()) {
    log.error("String_Node_Str",document,aVID);
    aTarget.getPage().error("String_Node_Str");
    aTarget.addChildren(aTarget.getPage(),IFeedback.class);
    return;
  }
  AnnotationObject prediction=oPrediction.get();
  String predictedValue=prediction.getAnnotation();
  String tokenText=aJCas.getDocumentText().substring(aBegin,aEnd);
  LearningRecord record=new LearningRecord();
  record.setUser(aState.getUser().getUsername());
  record.setSourceDocument(document);
  record.setUserAction(LearningRecordUserAction.REJECTED);
  record.setOffsetCharacterBegin(prediction.getOffset().getBeginCharacter());
  record.setOffsetCharacterEnd(prediction.getOffset().getEndCharacter());
  record.setOffsetTokenBegin(prediction.getOffset().getBeginToken());
  record.setOffsetTokenEnd(prediction.getOffset().getEndToken());
  record.setTokenText(tokenText);
  record.setAnnotation(predictedValue);
  record.setLayer(layer);
  record.setChangeLocation(LearningRecordChangeLocation.MAIN_EDITOR);
  learningRecordService.create(record);
  aActionHandler.actionSelect(aTarget,aJCas);
  aTarget.getPage().send(aTarget.getPage(),Broadcast.BREADTH,new AjaxRecommendationRejectedEvent(aTarget,aState,aVID));
  applicationEventPublisher.publishEvent(new RecommendationRejectedEvent(this,document,aState.getUser().getUsername(),aBegin,aEnd,tokenText,feature,predictedValue));
}