nus-yam/ex-repair huggingface dataset:
Program: 63083
Project: 63083
Buggy source:
public AjaxPropertySelectionEvent(AjaxRequestTarget aTarget,KBHandle newSelection){
  super(aTarget,newSelection);
}

Fixed version (ground truth):
public AjaxPropertySelectionEvent(AjaxRequestTarget aTarget,KBHandle newSelection,boolean aRedrawConceptandPropertyListPanels){
  super(aTarget,newSelection);
  redrawConceptandPropertyListPanels=aRedrawConceptandPropertyListPanels;
}
Program: 63084
Project: 63084
Buggy source:
private void actionPropertyLinkClicked(AjaxRequestTarget target){
  send(getPage(),Broadcast.BREADTH,new AjaxPropertySelectionEvent(target,groupModel.getObject().getProperty()));
}

Fixed version (ground truth):
private void actionPropertyLinkClicked(AjaxRequestTarget target){
  send(getPage(),Broadcast.BREADTH,new AjaxPropertySelectionEvent(target,groupModel.getObject().getProperty(),true));
}
Program: 63086
Project: 63086
Buggy source:
private void highlightTextAndDisplayMessage(AjaxRequestTarget aTarget,LearningRecord aRecord){
  selectedRecord=aRecord;
  vMarkerType=TEXT_MARKER;
  error("String_Node_Str");
  aTarget.addChildren(getPage(),IFeedback.class);
}

Fixed version (ground truth):
private void highlightTextAndDisplayMessage(AjaxRequestTarget aTarget,LearningRecord aRecord){
  selectedRecord=aRecord;
  vMarkerType=TEXT_MARKER;
  LOG.error("String_Node_Str");
  error("String_Node_Str");
  aTarget.addChildren(getPage(),IFeedback.class);
}
Program: 63087
Project: 63087
Buggy source:
@OnEvent public void onRecommendationRejectEvent(AjaxRecommendationRejectedEvent aEvent){
  AnnotatorState annotatorState=getModelObject();
  AnnotatorState eventState=aEvent.getAnnotatorState();
  predictionModel=recommendationService.getPredictions(annotatorState.getUser(),annotatorState.getProject());
  if (sessionActive && eventState.getUser().equals(annotatorState.getUser()) && eventState.getProject().equals(annotatorState.getProject())) {
    if (eventState.getDocument().equals(annotatorState.getDocument()) && aEvent.getVid().getLayerId() == selectedLayer.getObject().getId() && predictionModel.getPredictionByVID(aEvent.getVid()).equals(currentRecommendation)) {
      moveToNextRecommendation(aEvent.getTarget());
    }
    aEvent.getTarget().add(mainContainer);
  }
}

Fixed version (ground truth):
@OnEvent public void onRecommendationRejectEvent(AjaxRecommendationRejectedEvent aEvent){
  AnnotatorState annotatorState=getModelObject();
  AnnotatorState eventState=aEvent.getAnnotatorState();
  model=recommendationService.getPredictions(annotatorState.getUser(),annotatorState.getProject());
  if (sessionActive && eventState.getUser().equals(annotatorState.getUser()) && eventState.getProject().equals(annotatorState.getProject())) {
    SourceDocument document=eventState.getDocument();
    VID vid=aEvent.getVid();
    Optional<AnnotationObject> prediction=model.getPredictionByVID(document,vid);
    if (!prediction.isPresent()) {
      LOG.error("String_Node_Str",document,vid);
      error("String_Node_Str");
      return;
    }
    if (document.equals(annotatorState.getDocument()) && vid.getLayerId() == selectedLayer.getObject().getId() && prediction.get().equals(currentRecommendation)) {
      moveToNextRecommendation(aEvent.getTarget());
    }
    aEvent.getTarget().add(mainContainer);
  }
}
Program: 63088
Project: 63088
Buggy source:
private void highlightRecommendation(AjaxRequestTarget aTarget,int aBegin,int aEnd,String aText,String aRecommendation){
  AnnotatorState annotatorState=ActiveLearningSidebar.this.getModelObject();
  predictionModel=recommendationService.getPredictions(annotatorState.getUser(),annotatorState.getProject());
  if (predictionModel != null) {
    Optional<AnnotationObject> aoForVID=predictionModel.getPrediction(aBegin,aEnd,aRecommendation);
    if (aoForVID.isPresent()) {
      highlightVID=new VID(RecommendationEditorExtension.BEAN_NAME,selectedLayer.getObject().getId(),(int)aoForVID.get().getRecommenderId(),aoForVID.get().getId(),VID.NONE,VID.NONE);
      vMarkerType=ANNOTATION_MARKER;
    }
 else {
      error("String_Node_Str" + aText + "String_Node_Str"+ aRecommendation+ "String_Node_Str");
      aTarget.addChildren(getPage(),IFeedback.class);
    }
  }
}

Fixed version (ground truth):
private void highlightRecommendation(AjaxRequestTarget aTarget,int aBegin,int aEnd,String aText,String aRecommendation){
  AnnotatorState annotatorState=ActiveLearningSidebar.this.getModelObject();
  model=recommendationService.getPredictions(annotatorState.getUser(),annotatorState.getProject());
  if (model != null) {
    Optional<AnnotationObject> aoForVID=model.getPrediction(aBegin,aEnd,aRecommendation);
    if (aoForVID.isPresent()) {
      highlightVID=new VID(RecommendationEditorExtension.BEAN_NAME,selectedLayer.getObject().getId(),(int)aoForVID.get().getRecommenderId(),aoForVID.get().getId(),VID.NONE,VID.NONE);
      vMarkerType=ANNOTATION_MARKER;
    }
 else {
      String msg=String.format("String_Node_Str",aText,aRecommendation);
      LOG.error(msg);
      error(msg);
      aTarget.addChildren(getPage(),IFeedback.class);
    }
  }
}
Program: 63089
Project: 63089
Buggy source:
/** 
 * Returns the prediction used to generate the VID
 */
public Optional<AnnotationObject> getPrediction(int aBegin,int aEnd,String aLabel){
  return predictions.values().stream().filter(f -> f.getOffset().getBeginCharacter() == aBegin && f.getOffset().getEndCharacter() == aEnd).filter(f -> f.getAnnotation().equals(aLabel)).max((p1,p2) -> Integer.compare(p1.getId(),p2.getId()));
}

Fixed version (ground truth):
/** 
 * Returns the prediction used to generate the VID
 */
public Optional<AnnotationObject> getPrediction(int aBegin,int aEnd,String aLabel){
  return predictions.values().stream().filter(f -> f.getOffset().getBeginCharacter() == aBegin && f.getOffset().getEndCharacter() == aEnd).filter(f -> f.getAnnotation().equals(aLabel)).max(Comparator.comparingInt(TokenObject::getId));
}
Program: 63090
Project: 63090
Buggy source:
/** 
 * Returns the first one that matches recommendationId and recommenderId
 * @return
 */
public AnnotationObject getPredictionByVID(VID aVID){
  return predictions.values().stream().filter(f -> f.getId() == aVID.getSubId()).filter(f -> f.getRecommenderId() == aVID.getId()).collect(Collectors.toList()).get(0);
}

Fixed version (ground truth):
/** 
 * Returns the first prediction that matches recommendationId and recommenderId in the given document.
 */
public Optional<AnnotationObject> getPredictionByVID(SourceDocument document,VID aVID){
  return predictions.values().stream().filter(f -> f.getDocumentName().equals(document.getName())).filter(f -> f.getId() == aVID.getSubId()).filter(f -> f.getRecommenderId() == aVID.getId()).findFirst();
}
Program: 63093
Project: 63093
Buggy source:
private AutoCompleteTextField<KBHandle> createAutoCompleteTextField(AnnotatorState aState,AnnotationActionHandler aHandler){
  AutoCompleteTextField<KBHandle> field=new AutoCompleteTextField<KBHandle>(MID_VALUE,new TextRenderer<KBHandle>("String_Node_Str")){
    private static final long serialVersionUID=-1955006051950156603L;
    @Override protected List<KBHandle> getChoices(    String input){
      return listInstances(aState,aHandler,input);
    }
    @Override public void onConfigure(    JQueryBehavior behavior){
      super.onConfigure(behavior);
      behavior.setOption("String_Node_Str",true);
    }
    @Override protected IJQueryTemplate newTemplate(){
      return KendoChoiceDescriptionScriptReference.template();
    }
  }
;
  field.setOutputMarkupId(true);
  field.setMarkupId(ID_PREFIX + getModelObject().feature.getId());
  return field;
}

Fixed version (ground truth):
private AutoCompleteTextField<KBHandle> createAutoCompleteTextField(AnnotatorState aState,AnnotationActionHandler aHandler){
  AutoCompleteTextField<KBHandle> field=new AutoCompleteTextField<KBHandle>(MID_VALUE,new TextRenderer<KBHandle>("String_Node_Str")){
    private static final long serialVersionUID=-1955006051950156603L;
    @Override protected List<KBHandle> getChoices(    String input){
      return listInstances(aState,aHandler,input);
    }
    @Override public void onConfigure(    JQueryBehavior behavior){
      super.onConfigure(behavior);
      behavior.setOption("String_Node_Str",true);
    }
    @Override protected IJQueryTemplate newTemplate(){
      return KendoChoiceDescriptionScriptReference.template();
    }
  }
;
  return field;
}
Program: 63094
Project: 63094
Buggy source:
private AutoCompleteTextField<KBHandle> createAutoCompleteTextField(){
  AutoCompleteTextField<KBHandle> field=new AutoCompleteTextField<KBHandle>("String_Node_Str",new TextRenderer<KBHandle>("String_Node_Str")){
    private static final long serialVersionUID=2499259496065983734L;
    @Override protected List<KBHandle> getChoices(    String input){
      return factService.getPredicatesFromKB(project,traits);
    }
    @Override public void onConfigure(    JQueryBehavior behavior){
      super.onConfigure(behavior);
      behavior.setOption("String_Node_Str",true);
    }
    @Override protected IJQueryTemplate newTemplate(){
      return KendoChoiceDescriptionScriptReference.template();
    }
  }
;
  field.setOutputMarkupId(true);
  field.setMarkupId(ID_PREFIX + getModelObject().feature.getId());
  return field;
}

Fixed version (ground truth):
private AutoCompleteTextField<KBHandle> createAutoCompleteTextField(){
  AutoCompleteTextField<KBHandle> field=new AutoCompleteTextField<KBHandle>("String_Node_Str",new TextRenderer<KBHandle>("String_Node_Str")){
    private static final long serialVersionUID=2499259496065983734L;
    @Override protected List<KBHandle> getChoices(    String input){
      return factService.getPredicatesFromKB(project,traits);
    }
    @Override public void onConfigure(    JQueryBehavior behavior){
      super.onConfigure(behavior);
      behavior.setOption("String_Node_Str",true);
    }
    @Override protected IJQueryTemplate newTemplate(){
      return KendoChoiceDescriptionScriptReference.template();
    }
  }
;
  return field;
}
Program: 63095
Project: 63095
Buggy source:
private AutoCompleteTextField<KBHandle> createSelectPropertyAutoCompleteTextField(){
  AutoCompleteTextField<KBHandle> field=new AutoCompleteTextField<KBHandle>("String_Node_Str",new PropertyModel<KBHandle>(this,"String_Node_Str"),new TextRenderer<KBHandle>("String_Node_Str"),KBHandle.class){
    private static final long serialVersionUID=1458626823154651501L;
    @Override protected List<KBHandle> getChoices(    String input){
      ConceptFeatureTraits traits=factService.getFeatureTraits(project);
      return factService.getPredicatesFromKB(project,traits);
    }
    @Override public void onConfigure(    JQueryBehavior behavior){
      super.onConfigure(behavior);
      behavior.setOption("String_Node_Str",true);
    }
    @Override protected IJQueryTemplate newTemplate(){
      return KendoChoiceDescriptionScriptReference.template();
    }
  }
;
  field.setOutputMarkupId(true);
  field.setMarkupId(ID_PREFIX + getModelObject().feature.getId());
  return field;
}

Fixed version (ground truth):
private AutoCompleteTextField<KBHandle> createSelectPropertyAutoCompleteTextField(){
  AutoCompleteTextField<KBHandle> field=new AutoCompleteTextField<KBHandle>("String_Node_Str",new PropertyModel<KBHandle>(this,"String_Node_Str"),new TextRenderer<KBHandle>("String_Node_Str"),KBHandle.class){
    private static final long serialVersionUID=1458626823154651501L;
    @Override protected List<KBHandle> getChoices(    String input){
      ConceptFeatureTraits traits=factService.getFeatureTraits(project);
      return factService.getPredicatesFromKB(project,traits);
    }
    @Override public void onConfigure(    JQueryBehavior behavior){
      super.onConfigure(behavior);
      behavior.setOption("String_Node_Str",true);
    }
    @Override protected IJQueryTemplate newTemplate(){
      return KendoChoiceDescriptionScriptReference.template();
    }
  }
;
  return field;
}
Program: 63096
Project: 63096
Buggy source:
private AutoCompleteTextField<KBHandle> createAutoCompleteTextField(){
  AutoCompleteTextField<KBHandle> field=new AutoCompleteTextField<KBHandle>("String_Node_Str",LambdaModelAdapter.of(this::getSelectedKBItem,this::setSelectedKBItem),new TextRenderer<KBHandle>("String_Node_Str"),KBHandle.class){
    private static final long serialVersionUID=5683897252648514996L;
    @Override protected List<KBHandle> getChoices(    String input){
      return listInstances(actionHandler,input);
    }
    @Override public void onConfigure(    JQueryBehavior behavior){
      super.onConfigure(behavior);
      behavior.setOption("String_Node_Str",true);
    }
    @Override protected IJQueryTemplate newTemplate(){
      return KendoChoiceDescriptionScriptReference.template();
    }
  }
;
  field.setOutputMarkupId(true);
  field.setMarkupId(ID_PREFIX + getModelObject().feature.getId());
  return field;
}

Fixed version (ground truth):
private AutoCompleteTextField<KBHandle> createAutoCompleteTextField(){
  AutoCompleteTextField<KBHandle> field=new AutoCompleteTextField<KBHandle>("String_Node_Str",LambdaModelAdapter.of(this::getSelectedKBItem,this::setSelectedKBItem),new TextRenderer<KBHandle>("String_Node_Str"),KBHandle.class){
    private static final long serialVersionUID=5683897252648514996L;
    @Override protected List<KBHandle> getChoices(    String input){
      return listInstances(actionHandler,input);
    }
    @Override public void onConfigure(    JQueryBehavior behavior){
      super.onConfigure(behavior);
      behavior.setOption("String_Node_Str",true);
    }
    @Override protected IJQueryTemplate newTemplate(){
      return KendoChoiceDescriptionScriptReference.template();
    }
  }
;
  return field;
}
Program: 63097
Project: 63097
Buggy source:
private AutoCompleteTextField<KBHandle> createAutoCompleteTextField(AnnotatorState aState,AnnotationActionHandler aHandler){
  AutoCompleteTextField<KBHandle> field=new AutoCompleteTextField<KBHandle>(MID_VALUE,new TextRenderer<KBHandle>("String_Node_Str")){
    private static final long serialVersionUID=-1955006051950156603L;
    @Override protected List<KBHandle> getChoices(    String input){
      return listInstances(aState,aHandler,input);
    }
    @Override public void onConfigure(    JQueryBehavior behavior){
      super.onConfigure(behavior);
      behavior.setOption("String_Node_Str",true);
    }
    @Override protected IJQueryTemplate newTemplate(){
      return KendoChoiceDescriptionScriptReference.template();
    }
  }
;
  field.setOutputMarkupId(true);
  field.setMarkupId(ID_PREFIX + getModelObject().feature.getId());
  return field;
}

Fixed version (ground truth):
private AutoCompleteTextField<KBHandle> createAutoCompleteTextField(AnnotatorState aState,AnnotationActionHandler aHandler){
  AutoCompleteTextField<KBHandle> field=new AutoCompleteTextField<KBHandle>(MID_VALUE,new TextRenderer<KBHandle>("String_Node_Str")){
    private static final long serialVersionUID=-1955006051950156603L;
    @Override protected List<KBHandle> getChoices(    String input){
      return listInstances(aState,aHandler,input);
    }
    @Override public void onConfigure(    JQueryBehavior behavior){
      super.onConfigure(behavior);
      behavior.setOption("String_Node_Str",true);
    }
    @Override protected IJQueryTemplate newTemplate(){
      return KendoChoiceDescriptionScriptReference.template();
    }
  }
;
  return field;
}
Program: 63098
Project: 63098
Buggy source:
private AutoCompleteTextField<KBHandle> createAutoCompleteTextField(){
  AutoCompleteTextField<KBHandle> field=new AutoCompleteTextField<KBHandle>("String_Node_Str",new TextRenderer<KBHandle>("String_Node_Str")){
    private static final long serialVersionUID=2499259496065983734L;
    @Override protected List<KBHandle> getChoices(    String input){
      return factService.getPredicatesFromKB(project,traits);
    }
    @Override public void onConfigure(    JQueryBehavior behavior){
      super.onConfigure(behavior);
      behavior.setOption("String_Node_Str",true);
    }
    @Override protected IJQueryTemplate newTemplate(){
      return KendoChoiceDescriptionScriptReference.template();
    }
  }
;
  field.setOutputMarkupId(true);
  field.setMarkupId(ID_PREFIX + getModelObject().feature.getId());
  return field;
}

Fixed version (ground truth):
private AutoCompleteTextField<KBHandle> createAutoCompleteTextField(){
  AutoCompleteTextField<KBHandle> field=new AutoCompleteTextField<KBHandle>("String_Node_Str",new TextRenderer<KBHandle>("String_Node_Str")){
    private static final long serialVersionUID=2499259496065983734L;
    @Override protected List<KBHandle> getChoices(    String input){
      return factService.getPredicatesFromKB(project,traits);
    }
    @Override public void onConfigure(    JQueryBehavior behavior){
      super.onConfigure(behavior);
      behavior.setOption("String_Node_Str",true);
    }
    @Override protected IJQueryTemplate newTemplate(){
      return KendoChoiceDescriptionScriptReference.template();
    }
  }
;
  return field;
}
Program: 63099
Project: 63099
Buggy source:
private AutoCompleteTextField<KBHandle> createSelectPropertyAutoCompleteTextField(){
  AutoCompleteTextField<KBHandle> field=new AutoCompleteTextField<KBHandle>("String_Node_Str",new PropertyModel<KBHandle>(this,"String_Node_Str"),new TextRenderer<KBHandle>("String_Node_Str"),KBHandle.class){
    private static final long serialVersionUID=1458626823154651501L;
    @Override protected List<KBHandle> getChoices(    String input){
      ConceptFeatureTraits traits=factService.getFeatureTraits(project);
      return factService.getPredicatesFromKB(project,traits);
    }
    @Override public void onConfigure(    JQueryBehavior behavior){
      super.onConfigure(behavior);
      behavior.setOption("String_Node_Str",true);
    }
    @Override protected IJQueryTemplate newTemplate(){
      return KendoChoiceDescriptionScriptReference.template();
    }
  }
;
  field.setOutputMarkupId(true);
  field.setMarkupId(ID_PREFIX + getModelObject().feature.getId());
  return field;
}

Fixed version (ground truth):
private AutoCompleteTextField<KBHandle> createSelectPropertyAutoCompleteTextField(){
  AutoCompleteTextField<KBHandle> field=new AutoCompleteTextField<KBHandle>("String_Node_Str",new PropertyModel<KBHandle>(this,"String_Node_Str"),new TextRenderer<KBHandle>("String_Node_Str"),KBHandle.class){
    private static final long serialVersionUID=1458626823154651501L;
    @Override protected List<KBHandle> getChoices(    String input){
      ConceptFeatureTraits traits=factService.getFeatureTraits(project);
      return factService.getPredicatesFromKB(project,traits);
    }
    @Override public void onConfigure(    JQueryBehavior behavior){
      super.onConfigure(behavior);
      behavior.setOption("String_Node_Str",true);
    }
    @Override protected IJQueryTemplate newTemplate(){
      return KendoChoiceDescriptionScriptReference.template();
    }
  }
;
  return field;
}
Program: 63100
Project: 63100
Buggy source:
private AutoCompleteTextField<KBHandle> createAutoCompleteTextField(){
  AutoCompleteTextField<KBHandle> field=new AutoCompleteTextField<KBHandle>("String_Node_Str",LambdaModelAdapter.of(this::getSelectedKBItem,this::setSelectedKBItem),new TextRenderer<KBHandle>("String_Node_Str"),KBHandle.class){
    private static final long serialVersionUID=5683897252648514996L;
    @Override protected List<KBHandle> getChoices(    String input){
      return listInstances(actionHandler,input);
    }
    @Override public void onConfigure(    JQueryBehavior behavior){
      super.onConfigure(behavior);
      behavior.setOption("String_Node_Str",true);
    }
    @Override protected IJQueryTemplate newTemplate(){
      return KendoChoiceDescriptionScriptReference.template();
    }
  }
;
  field.setOutputMarkupId(true);
  field.setMarkupId(ID_PREFIX + getModelObject().feature.getId());
  return field;
}

Fixed version (ground truth):
private AutoCompleteTextField<KBHandle> createAutoCompleteTextField(){
  AutoCompleteTextField<KBHandle> field=new AutoCompleteTextField<KBHandle>("String_Node_Str",LambdaModelAdapter.of(this::getSelectedKBItem,this::setSelectedKBItem),new TextRenderer<KBHandle>("String_Node_Str"),KBHandle.class){
    private static final long serialVersionUID=5683897252648514996L;
    @Override protected List<KBHandle> getChoices(    String input){
      return listInstances(actionHandler,input);
    }
    @Override public void onConfigure(    JQueryBehavior behavior){
      super.onConfigure(behavior);
      behavior.setOption("String_Node_Str",true);
    }
    @Override protected IJQueryTemplate newTemplate(){
      return KendoChoiceDescriptionScriptReference.template();
    }
  }
;
  return field;
}
Program: 63101
Project: 63101
Buggy source:
private AutoCompleteTextField<KBHandle> createAutoCompleteTextField(AnnotatorState aState,AnnotationActionHandler aHandler){
  AutoCompleteTextField<KBHandle> field=new AutoCompleteTextField<KBHandle>(MID_VALUE,new TextRenderer<KBHandle>("String_Node_Str")){
    private static final long serialVersionUID=-1955006051950156603L;
    @Override protected List<KBHandle> getChoices(    String input){
      return listInstances(aState,aHandler,input);
    }
    @Override public void onConfigure(    JQueryBehavior behavior){
      super.onConfigure(behavior);
      behavior.setOption("String_Node_Str",true);
    }
    @Override protected IJQueryTemplate newTemplate(){
      return KendoChoiceDescriptionScriptReference.template();
    }
  }
;
  field.setOutputMarkupId(true);
  field.setMarkupId(ID_PREFIX + getModelObject().feature.getId());
  return field;
}

Fixed version (ground truth):
private AutoCompleteTextField<KBHandle> createAutoCompleteTextField(AnnotatorState aState,AnnotationActionHandler aHandler){
  AutoCompleteTextField<KBHandle> field=new AutoCompleteTextField<KBHandle>(MID_VALUE,new TextRenderer<KBHandle>("String_Node_Str")){
    private static final long serialVersionUID=-1955006051950156603L;
    @Override protected List<KBHandle> getChoices(    String input){
      return listInstances(aState,aHandler,input);
    }
    @Override public void onConfigure(    JQueryBehavior behavior){
      super.onConfigure(behavior);
      behavior.setOption("String_Node_Str",true);
    }
    @Override protected IJQueryTemplate newTemplate(){
      return KendoChoiceDescriptionScriptReference.template();
    }
  }
;
  return field;
}
Program: 63102
Project: 63102
Buggy source:
private AutoCompleteTextField<KBHandle> createAutoCompleteTextField(){
  AutoCompleteTextField<KBHandle> field=new AutoCompleteTextField<KBHandle>("String_Node_Str",new TextRenderer<KBHandle>("String_Node_Str")){
    private static final long serialVersionUID=2499259496065983734L;
    @Override protected List<KBHandle> getChoices(    String input){
      return factService.getPredicatesFromKB(project,traits);
    }
    @Override public void onConfigure(    JQueryBehavior behavior){
      super.onConfigure(behavior);
      behavior.setOption("String_Node_Str",true);
    }
    @Override protected IJQueryTemplate newTemplate(){
      return KendoChoiceDescriptionScriptReference.template();
    }
  }
;
  field.setOutputMarkupId(true);
  field.setMarkupId(ID_PREFIX + getModelObject().feature.getId());
  return field;
}

Fixed version (ground truth):
private AutoCompleteTextField<KBHandle> createAutoCompleteTextField(){
  AutoCompleteTextField<KBHandle> field=new AutoCompleteTextField<KBHandle>("String_Node_Str",new TextRenderer<KBHandle>("String_Node_Str")){
    private static final long serialVersionUID=2499259496065983734L;
    @Override protected List<KBHandle> getChoices(    String input){
      return factService.getPredicatesFromKB(project,traits);
    }
    @Override public void onConfigure(    JQueryBehavior behavior){
      super.onConfigure(behavior);
      behavior.setOption("String_Node_Str",true);
    }
    @Override protected IJQueryTemplate newTemplate(){
      return KendoChoiceDescriptionScriptReference.template();
    }
  }
;
  return field;
}
Program: 63103
Project: 63103
Buggy source:
private AutoCompleteTextField<KBHandle> createSelectPropertyAutoCompleteTextField(){
  AutoCompleteTextField<KBHandle> field=new AutoCompleteTextField<KBHandle>("String_Node_Str",new PropertyModel<KBHandle>(this,"String_Node_Str"),new TextRenderer<KBHandle>("String_Node_Str"),KBHandle.class){
    private static final long serialVersionUID=1458626823154651501L;
    @Override protected List<KBHandle> getChoices(    String input){
      ConceptFeatureTraits traits=factService.getFeatureTraits(project);
      return factService.getPredicatesFromKB(project,traits);
    }
    @Override public void onConfigure(    JQueryBehavior behavior){
      super.onConfigure(behavior);
      behavior.setOption("String_Node_Str",true);
    }
    @Override protected IJQueryTemplate newTemplate(){
      return KendoChoiceDescriptionScriptReference.template();
    }
  }
;
  field.setOutputMarkupId(true);
  field.setMarkupId(ID_PREFIX + getModelObject().feature.getId());
  return field;
}

Fixed version (ground truth):
private AutoCompleteTextField<KBHandle> createSelectPropertyAutoCompleteTextField(){
  AutoCompleteTextField<KBHandle> field=new AutoCompleteTextField<KBHandle>("String_Node_Str",new PropertyModel<KBHandle>(this,"String_Node_Str"),new TextRenderer<KBHandle>("String_Node_Str"),KBHandle.class){
    private static final long serialVersionUID=1458626823154651501L;
    @Override protected List<KBHandle> getChoices(    String input){
      ConceptFeatureTraits traits=factService.getFeatureTraits(project);
      return factService.getPredicatesFromKB(project,traits);
    }
    @Override public void onConfigure(    JQueryBehavior behavior){
      super.onConfigure(behavior);
      behavior.setOption("String_Node_Str",true);
    }
    @Override protected IJQueryTemplate newTemplate(){
      return KendoChoiceDescriptionScriptReference.template();
    }
  }
;
  return field;
}
Program: 63104
Project: 63104
Buggy source:
private AutoCompleteTextField<KBHandle> createAutoCompleteTextField(){
  AutoCompleteTextField<KBHandle> field=new AutoCompleteTextField<KBHandle>("String_Node_Str",LambdaModelAdapter.of(this::getSelectedKBItem,this::setSelectedKBItem),new TextRenderer<KBHandle>("String_Node_Str"),KBHandle.class){
    private static final long serialVersionUID=5683897252648514996L;
    @Override protected List<KBHandle> getChoices(    String input){
      return listInstances(actionHandler,input);
    }
    @Override public void onConfigure(    JQueryBehavior behavior){
      super.onConfigure(behavior);
      behavior.setOption("String_Node_Str",true);
    }
    @Override protected IJQueryTemplate newTemplate(){
      return KendoChoiceDescriptionScriptReference.template();
    }
  }
;
  field.setOutputMarkupId(true);
  field.setMarkupId(ID_PREFIX + getModelObject().feature.getId());
  return field;
}

Fixed version (ground truth):
private AutoCompleteTextField<KBHandle> createAutoCompleteTextField(){
  AutoCompleteTextField<KBHandle> field=new AutoCompleteTextField<KBHandle>("String_Node_Str",LambdaModelAdapter.of(this::getSelectedKBItem,this::setSelectedKBItem),new TextRenderer<KBHandle>("String_Node_Str"),KBHandle.class){
    private static final long serialVersionUID=5683897252648514996L;
    @Override protected List<KBHandle> getChoices(    String input){
      return listInstances(actionHandler,input);
    }
    @Override public void onConfigure(    JQueryBehavior behavior){
      super.onConfigure(behavior);
      behavior.setOption("String_Node_Str",true);
    }
    @Override protected IJQueryTemplate newTemplate(){
      return KendoChoiceDescriptionScriptReference.template();
    }
  }
;
  return field;
}
Program: 63105
Project: 63105
Buggy source:
@Override public List<List<AnnotationObject>> getRecommendationsForWholeProject(Predictions model,AnnotationLayer aLayer){
  List<List<AnnotationObject>> result=new ArrayList<>();
  Map<String,List<List<AnnotationObject>>> recommendationsMap=model.getPredictionsForWholeProject(aLayer,documentService);
  Set<String> documentNameSet=recommendationsMap.keySet();
  for (  String documentName : documentNameSet) {
    result.addAll(recommendationsMap.get(documentName));
  }
  return result;
}

Fixed version (ground truth):
@Override public List<List<AnnotationObject>> getRecommendationsForWholeProject(Predictions model,AnnotationLayer aLayer){
  List<List<AnnotationObject>> result=new ArrayList<>();
  Map<String,List<List<AnnotationObject>>> recommendationsMap=model.getPredictionsForWholeProject(aLayer,documentService,true);
  Set<String> documentNameSet=recommendationsMap.keySet();
  for (  String documentName : documentNameSet) {
    result.addAll(recommendationsMap.get(documentName));
  }
  return result;
}
Program: 63106
Project: 63106
Buggy source:
public List<AnnotationObject> getFlattenedRecommendationsFromRecommendationModel(JCas aJcas,AnnotatorState aState,AnnotationLayer aSelectedLayer){
  int windowBegin=0;
  int windowEnd=aJcas.getDocumentText().length() - 1;
  Predictions model=recommendationService.getPredictions(aState.getUser(),aState.getProject());
  return model.getFlattenedPredictions(aState.getDocument().getName(),aSelectedLayer,windowBegin,windowEnd,aJcas);
}

Fixed version (ground truth):
public List<AnnotationObject> getFlattenedRecommendationsFromRecommendationModel(JCas aJcas,AnnotatorState aState,AnnotationLayer aSelectedLayer){
  int windowBegin=0;
  int windowEnd=aJcas.getDocumentText().length() - 1;
  Predictions model=recommendationService.getPredictions(aState.getUser(),aState.getProject());
  return model.getFlattenedPredictions(aState.getDocument().getName(),aSelectedLayer,windowBegin,windowEnd,aJcas,true);
}
Program: 63107
Project: 63107
Buggy source:
/** 
 * TODO #176 use the document Id once it it available in the CAS Get the predictions of a document for a given window in a flattened list
 * @param aJcas 
 */
public List<AnnotationObject> getFlattenedPredictions(String aDocumentName,AnnotationLayer aLayer,int aWindowBegin,int aWindowEnd,JCas aJcas){
  return predictions.entrySet().stream().filter(f -> f.getKey().getDocumentName().equals(aDocumentName)).filter(f -> f.getKey().getLayerId() == aLayer.getId()).filter(f -> f.getKey().getOffset().getBeginCharacter() >= aWindowBegin).filter(f -> f.getKey().getOffset().getEndCharacter() <= aWindowEnd).map(Map.Entry::getValue).sorted(Comparator.comparingInt(e2 -> e2.getOffset().getBeginCharacter())).collect(Collectors.toList());
}

Fixed version (ground truth):
/** 
 * TODO #176 use the document Id once it it available in the CAS Get the predictions of a document for a given window in a flattened list
 * @param aJcas 
 */
public List<AnnotationObject> getFlattenedPredictions(String aDocumentName,AnnotationLayer aLayer,int aWindowBegin,int aWindowEnd,JCas aJcas,boolean aFilterExisting){
  List<Map.Entry<ExtendedId,AnnotationObject>> p=predictions.entrySet().stream().filter(f -> f.getKey().getDocumentName().equals(aDocumentName)).filter(f -> f.getKey().getLayerId() == aLayer.getId()).filter(f -> f.getKey().getOffset().getBeginCharacter() >= aWindowBegin).filter(f -> f.getKey().getOffset().getEndCharacter() <= aWindowEnd).sorted(Comparator.comparingInt(e2 -> e2.getValue().getOffset().getBeginCharacter())).collect(Collectors.toList());
  if (aFilterExisting) {
    Type type=CasUtil.getType(aJcas.getCas(),aLayer.getName());
    List<AnnotationFS> existingAnnotations=CasUtil.selectCovered(aJcas.getCas(),type,aWindowBegin,aWindowEnd);
    List<Integer> existingOffsets=existingAnnotations.stream().map(AnnotationFS::getBegin).collect(Collectors.toList());
    return p.stream().filter(f -> !existingOffsets.contains(f.getKey().getOffset().getBeginCharacter())).map(Map.Entry::getValue).collect(Collectors.toList());
  }
 else {
    return p.stream().map(Map.Entry::getValue).collect(Collectors.toList());
  }
}
Program: 63108
Project: 63108
Buggy source:
/** 
 * Get the predictions of a given window for each document,  where the outer list is a list of tokens  and the inner list is a list of predictions for a token. The method filters all tokens which already have an annotation and don't need further recommendation.
 */
public Map<String,List<List<AnnotationObject>>> getPredictionsForWholeProject(AnnotationLayer aLayer,DocumentService aDocumentService){
  Map<String,List<List<AnnotationObject>>> predictions=new HashMap<>();
  List<AnnotationDocument> docs=aDocumentService.listAnnotationDocuments(project,user);
  for (  AnnotationDocument doc : docs) {
    JCas jcas;
    try {
      jcas=aDocumentService.readAnnotationCas(doc);
      List<List<AnnotationObject>> p=getPredictions(doc.getName(),aLayer,0,jcas.getDocumentText().length() - 1,jcas);
      predictions.put(doc.getName(),p);
    }
 catch (    IOException e) {
      logger.info("String_Node_Str",e);
    }
  }
  return predictions;
}

Fixed version (ground truth):
/** 
 * Get the predictions of a given window for each document,  where the outer list is a list of tokens  and the inner list is a list of predictions for a token. The method filters all tokens which already have an annotation and don't need further recommendation.
 */
public Map<String,List<List<AnnotationObject>>> getPredictionsForWholeProject(AnnotationLayer aLayer,DocumentService aDocumentService,boolean aFilterExisting){
  Map<String,List<List<AnnotationObject>>> predictions=new HashMap<>();
  List<AnnotationDocument> docs=aDocumentService.listAnnotationDocuments(project,user);
  for (  AnnotationDocument doc : docs) {
    JCas jcas;
    try {
      jcas=aDocumentService.readAnnotationCas(doc);
      List<List<AnnotationObject>> p=getPredictions(doc.getName(),aLayer,0,jcas.getDocumentText().length() - 1,jcas,aFilterExisting);
      predictions.put(doc.getName(),p);
    }
 catch (    IOException e) {
      logger.info("String_Node_Str",e);
    }
  }
  return predictions;
}
Program: 63110
Project: 63110
Buggy source:
private void showAndHighlightRecommendationAndJumpToRecommendationLocation(AjaxRequestTarget aTarget){
  if (currentDifference != null) {
    hasUnseenRecommendation=true;
    currentRecommendation=currentDifference.getRecommendation1();
    try {
      actionShowSelectedDocument(aTarget,getModelObject().getDocument(),currentRecommendation.getOffset().getBeginCharacter());
    }
 catch (    IOException e) {
      LOG.error("String_Node_Str",e.getMessage(),e);
      error("String_Node_Str" + e.getMessage());
      aTarget.addChildren(getPage(),IFeedback.class);
    }
    setShowingRecommendation();
    highlightCurrentRecommendation(aTarget);
  }
 else   if (learnSkippedRecommendationTime == null) {
    hasUnseenRecommendation=false;
    hasSkippedRecommendation=activeLearningRecommender.hasRecommendationWhichIsSkipped(learningRecordService,activeLearningService);
  }
 else {
    hasUnseenRecommendation=false;
    hasSkippedRecommendation=false;
  }
}

Fixed version (ground truth):
private void showAndHighlightRecommendationAndJumpToRecommendationLocation(AjaxRequestTarget aTarget){
  if (currentDifference != null) {
    hasUnseenRecommendation=true;
    currentRecommendation=currentDifference.getRecommendation1();
    try {
      actionShowSelectedDocument(aTarget,documentService.getSourceDocument(this.getModelObject().getProject(),currentRecommendation.getDocumentName()),currentRecommendation.getOffset().getBeginCharacter());
    }
 catch (    IOException e) {
      LOG.error("String_Node_Str",e.getMessage(),e);
      error("String_Node_Str" + e.getMessage());
      aTarget.addChildren(getPage(),IFeedback.class);
    }
    setShowingRecommendation();
    highlightCurrentRecommendation(aTarget);
  }
 else   if (learnSkippedRecommendationTime == null) {
    hasUnseenRecommendation=false;
    hasSkippedRecommendation=activeLearningRecommender.hasRecommendationWhichIsSkipped(learningRecordService,activeLearningService);
  }
 else {
    hasUnseenRecommendation=false;
    hasSkippedRecommendation=false;
  }
}
Program: 63111
Project: 63111
Buggy source:
private void jumpToRecommendationLocationAndHighlightRecommendation(AjaxRequestTarget aTarget) throws IOException {
  actionShowSelectedDocument(aTarget,getModelObject().getDocument(),currentRecommendation.getOffset().getBeginCharacter());
  highlightCurrentRecommendation(aTarget);
}

Fixed version (ground truth):
private void jumpToRecommendationLocationAndHighlightRecommendation(AjaxRequestTarget aTarget) throws IOException {
  actionShowSelectedDocument(aTarget,documentService.getSourceDocument(this.getModelObject().getProject(),currentRecommendation.getDocumentName()),currentRecommendation.getOffset().getBeginCharacter());
  highlightCurrentRecommendation(aTarget);
}
Program: 63112
Project: 63112
Buggy source:
private List<CandidateEntity> sortByFrequency(List<CandidateEntity> candidates){
  candidates.sort((e1,e2) -> Comparator.comparingInt(CandidateEntity::getFrequency).reversed().compare(e1,e2));
  return candidates;
}

Fixed version (ground truth):
private List<CandidateEntity> sortByFrequency(List<CandidateEntity> candidates){
  candidates.sort((e1,e2) -> Comparator.comparingInt(CandidateEntity::getFrequency).compare(e1,e2));
  return candidates;
}
Program: 63113
Project: 63113
Buggy source:
public Transaction addMultiSign(Transaction tx,int M,byte[][] pubKeys,byte[] signatureData) throws Exception {
  pubKeys=Program.sortPublicKeys(pubKeys);
  if (tx.sigs == null) {
    tx.sigs=new Sig[0];
  }
 else {
    if (tx.sigs.length > Common.TX_MAX_SIG_SIZE || M > pubKeys.length || M <= 0 || signatureData == null || pubKeys == null) {
      throw new SDKException(ErrorCode.ParamError);
    }
    for (int i=0; i < tx.sigs.length; i++) {
      if (Arrays.equals(tx.sigs[i].pubKeys,pubKeys)) {
        if (tx.sigs[i].sigData.length + 1 > pubKeys.length) {
          throw new SDKException(ErrorCode.ParamErr("String_Node_Str"));
        }
        if (tx.sigs[i].M != M) {
          throw new SDKException(ErrorCode.ParamErr("String_Node_Str"));
        }
        int len=tx.sigs[i].sigData.length;
        byte[][] sigData=new byte[len + 1][];
        for (int j=0; j < tx.sigs[i].sigData.length; j++) {
          sigData[j]=tx.sigs[i].sigData[j];
        }
        sigData[len]=signatureData;
        tx.sigs[i].sigData=sigData;
        return tx;
      }
    }
  }
  Sig[] sigs=new Sig[tx.sigs.length + 1];
  for (int i=0; i < tx.sigs.length; i++) {
    sigs[i]=tx.sigs[i];
  }
  sigs[tx.sigs.length]=new Sig();
  sigs[tx.sigs.length].M=M;
  sigs[tx.sigs.length].pubKeys=pubKeys;
  sigs[tx.sigs.length].sigData=new byte[1][];
  sigs[tx.sigs.length].sigData[0]=signatureData;
  tx.sigs=sigs;
  return tx;
}

Fixed version (ground truth):
public Transaction addMultiSign(Transaction tx,int M,byte[][] pubKeys,byte[] signatureData) throws Exception {
  pubKeys=Program.sortPublicKeys(pubKeys);
  if (tx.sigs == null) {
    tx.sigs=new Sig[0];
  }
 else {
    if (tx.sigs.length > Common.TX_MAX_SIG_SIZE || M > pubKeys.length || M <= 0 || signatureData == null || pubKeys == null) {
      throw new SDKException(ErrorCode.ParamError);
    }
    for (int i=0; i < tx.sigs.length; i++) {
      if (Arrays.deepEquals(tx.sigs[i].pubKeys,pubKeys)) {
        if (tx.sigs[i].sigData.length + 1 > pubKeys.length) {
          throw new SDKException(ErrorCode.ParamErr("String_Node_Str"));
        }
        if (tx.sigs[i].M != M) {
          throw new SDKException(ErrorCode.ParamErr("String_Node_Str"));
        }
        int len=tx.sigs[i].sigData.length;
        byte[][] sigData=new byte[len + 1][];
        for (int j=0; j < tx.sigs[i].sigData.length; j++) {
          sigData[j]=tx.sigs[i].sigData[j];
        }
        sigData[len]=signatureData;
        tx.sigs[i].sigData=sigData;
        return tx;
      }
    }
  }
  Sig[] sigs=new Sig[tx.sigs.length + 1];
  for (int i=0; i < tx.sigs.length; i++) {
    sigs[i]=tx.sigs[i];
  }
  sigs[tx.sigs.length]=new Sig();
  sigs[tx.sigs.length].M=M;
  sigs[tx.sigs.length].pubKeys=pubKeys;
  sigs[tx.sigs.length].sigData=new byte[1][];
  sigs[tx.sigs.length].sigData[0]=signatureData;
  tx.sigs=sigs;
  return tx;
}
Program: 63114
Project: 63114
Buggy source:
public Transaction makeTransfer(State[] states,String payer,long gaslimit,long gasprice) throws Exception {
  if (states == null || payer == null || payer.equals("String_Node_Str")) {
    throw new SDKException(ErrorCode.ParamErr("String_Node_Str"));
  }
  if (gasprice < 0 || gaslimit < 0) {
    throw new SDKException(ErrorCode.ParamError);
  }
  List list=new ArrayList();
  Struct[] structs=new Struct[states.length];
  for (int i=0; i < states.length; i++) {
    structs[i]=new Struct().add(states[i].from,states[i].to,states[i].value);
  }
  list.add(structs);
  byte[] args=NativeBuildParams.createCodeParamsScript(list);
  Transaction tx=sdk.vm().buildNativeParams(new Address(Helper.hexToBytes(ongContract)),"String_Node_Str",args,payer,gaslimit,gasprice);
  return tx;
}

Fixed version (ground truth):
public Transaction makeTransfer(State[] states,String payer,long gaslimit,long gasprice) throws Exception {
  if (states == null || payer == null || payer.equals("String_Node_Str")) {
    throw new SDKException(ErrorCode.ParamErr("String_Node_Str"));
  }
  if (gasprice < 0 || gaslimit < 0) {
    throw new SDKException(ErrorCode.ParamError);
  }
  List list=new ArrayList();
  List listStruct=new ArrayList();
  for (int i=0; i < states.length; i++) {
    listStruct.add(new Struct().add(states[i].from,states[i].to,states[i].value));
  }
  list.add(listStruct);
  byte[] args=NativeBuildParams.createCodeParamsScript(list);
  Transaction tx=sdk.vm().buildNativeParams(new Address(Helper.hexToBytes(ongContract)),"String_Node_Str",args,payer,gaslimit,gasprice);
  return tx;
}
Program: 63115
Project: 63115
Buggy source:
public Transaction makeTransfer(State[] states,String payer,long gaslimit,long gasprice) throws Exception {
  if (states == null || payer == null || payer.equals("String_Node_Str")) {
    throw new SDKException(ErrorCode.ParamErr("String_Node_Str"));
  }
  if (gasprice < 0 || gaslimit < 0) {
    throw new SDKException(ErrorCode.ParamError);
  }
  List list=new ArrayList();
  Struct[] structs=new Struct[states.length];
  for (int i=0; i < states.length; i++) {
    structs[i]=new Struct().add(states[i].from,states[i].to,states[i].value);
  }
  list.add(structs);
  byte[] args=NativeBuildParams.createCodeParamsScript(list);
  Transaction tx=sdk.vm().buildNativeParams(new Address(Helper.hexToBytes(ontContract)),"String_Node_Str",args,payer,gaslimit,gasprice);
  return tx;
}

Fixed version (ground truth):
public Transaction makeTransfer(State[] states,String payer,long gaslimit,long gasprice) throws Exception {
  if (states == null || payer == null || payer.equals("String_Node_Str")) {
    throw new SDKException(ErrorCode.ParamErr("String_Node_Str"));
  }
  if (gasprice < 0 || gaslimit < 0) {
    throw new SDKException(ErrorCode.ParamError);
  }
  List list=new ArrayList();
  List listStruct=new ArrayList();
  for (int i=0; i < states.length; i++) {
    listStruct.add(new Struct().add(states[i].from,states[i].to,states[i].value));
  }
  list.add(listStruct);
  byte[] args=NativeBuildParams.createCodeParamsScript(list);
  Transaction tx=sdk.vm().buildNativeParams(new Address(Helper.hexToBytes(ontContract)),"String_Node_Str",args,payer,gaslimit,gasprice);
  return tx;
}
Program: 63116
Project: 63116
Buggy source:
/** 
 * @param list
 * @return
 */
public static byte[] createCodeParamsScript(List<Object> list){
  ScriptBuilder sb=new ScriptBuilder();
  try {
    for (int i=list.size() - 1; i >= 0; i--) {
      Object val=list.get(i);
      if (val instanceof byte[]) {
        sb.emitPushByteArray((byte[])val);
      }
 else       if (val instanceof Boolean) {
        sb.emitPushBool((Boolean)val);
      }
 else       if (val instanceof Integer) {
        sb.emitPushInteger(BigInteger.valueOf((int)val));
      }
 else       if (val instanceof Long) {
        sb.emitPushInteger(BigInteger.valueOf((Long)val));
      }
 else       if (val instanceof BigInteger) {
        sb.emitPushInteger((BigInteger)val);
      }
 else       if (val instanceof Address) {
        sb.emitPushByteArray(((Address)val).toArray());
      }
 else       if (val instanceof String) {
        sb.emitPushByteArray(((String)val).getBytes());
      }
 else       if (val instanceof Struct) {
        sb.emitPushInteger(BigInteger.valueOf(0));
        sb.add(ScriptOp.OP_NEWSTRUCT);
        sb.add(ScriptOp.OP_TOALTSTACK);
        for (int k=0; k < ((Struct)val).list.size(); k++) {
          Object o=((Struct)val).list.get(k);
          createCodeParamsScript(sb,o);
          sb.add(ScriptOp.OP_DUPFROMALTSTACK);
          sb.add(ScriptOp.OP_SWAP);
          sb.add(ScriptOp.OP_APPEND);
        }
        sb.add(ScriptOp.OP_FROMALTSTACK);
      }
 else       if (val instanceof Struct[]) {
        sb.emitPushInteger(BigInteger.valueOf(0));
        sb.add(ScriptOp.OP_NEWSTRUCT);
        sb.add(ScriptOp.OP_TOALTSTACK);
        Struct[] structs=(Struct[])val;
        for (int k=0; k < structs.length; k++) {
          createCodeParamsScript(sb,structs[k]);
        }
        sb.add(ScriptOp.OP_FROMALTSTACK);
        sb.emitPushInteger(new BigInteger(String.valueOf(structs.length)));
        sb.pushPack();
      }
 else       if (val instanceof List) {
        List tmp=(List)val;
        createCodeParamsScript(sb,tmp);
        sb.emitPushInteger(new BigInteger(String.valueOf(tmp.size())));
        sb.pushPack();
      }
 else {
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return sb.toArray();
}

Fixed version (ground truth):
/** 
 * @param list
 * @return
 */
public static byte[] createCodeParamsScript(List<Object> list){
  ScriptBuilder sb=new ScriptBuilder();
  return createCodeParamsScript(sb,list);
}
Program: 63117
Project: 63117
Buggy source:
@Override public void serialize(BinaryWriter writer) throws IOException {
  writer.writeVarBytes(from.toArray());
  writer.writeVarBytes(to.toArray());
  writer.writeVarBytes(Helper.BigInt2Bytes(BigInteger.valueOf(value)));
}

Fixed version (ground truth):
@Override public void serialize(BinaryWriter writer) throws IOException {
  writer.writeVarBytes(from.toArray());
  writer.writeVarBytes(to.toArray());
  writer.writeVarBytes(Helper.BigIntToNeoBytes(BigInteger.valueOf(value)));
}
Program: 63118
Project: 63118
Buggy source:
@Override public void deserialize(BinaryReader reader) throws IOException {
  from=new Address(reader.readVarBytes());
  to=new Address(reader.readVarBytes());
  value=Helper.BigIntFromBytes(reader.readVarBytes()).longValue();
}

Fixed version (ground truth):
@Override public void deserialize(BinaryReader reader) throws IOException {
  from=new Address(reader.readVarBytes());
  to=new Address(reader.readVarBytes());
  value=Helper.BigIntFromNeoBytes(reader.readVarBytes()).longValue();
}
Program: 63119
Project: 63119
Buggy source:
@Override public void serialize(BinaryWriter writer) throws IOException {
  long l=params.length;
  byte[] aa=Helper.BigInt2Bytes(BigInteger.valueOf(l));
  String bb=Helper.toHexString(aa);
  writer.writeVarBytes(aa);
  for (int i=0; i < params.length; i++) {
    writer.writeVarString(params[i].key);
    writer.writeVarString(params[i].value);
  }
}

Fixed version (ground truth):
@Override public void serialize(BinaryWriter writer) throws IOException {
  long l=params.length;
  byte[] aa=Helper.BigIntToNeoBytes(BigInteger.valueOf(l));
  String bb=Helper.toHexString(aa);
  writer.writeVarBytes(aa);
  for (int i=0; i < params.length; i++) {
    writer.writeVarString(params[i].key);
    writer.writeVarString(params[i].value);
  }
}