nus-yam/ex-repair huggingface dataset:
Program: 63026
Project: 63026
Buggy source:
private int indexFeatureValue(MtasTokenCollection aTokenCollection,AnnotationFeature aFeature,AnnotationFS aAnnotation,int aBeginToken,int aEndToken,int aMtasId,String annotationUiName){
  int mtasId=aMtasId;
  String featureValue=WebAnnoCasUtil.getFeature(aAnnotation,aFeature.getName());
  addToIndex(aTokenCollection,annotationUiName + "String_Node_Str" + aFeature.getUiName(),featureValue,mtasId++,aAnnotation.getBegin(),aAnnotation.getEnd(),aBeginToken,aEndToken);
  return mtasId;
}

Fixed version (ground truth):
private int indexFeatureValue(MtasTokenCollection aTokenCollection,AnnotationFeature aFeature,AnnotationFS aAnnotation,int aBeginToken,int aEndToken,int aMtasId,String annotationUiName){
  int mtasId=aMtasId;
  FeatureSupport<?> featSup=featureSupportRegistry.getFeatureSupport(aFeature);
  String featureValue=featSup.renderFeatureValue(aFeature,aAnnotation);
  addToIndex(aTokenCollection,annotationUiName + "String_Node_Str" + aFeature.getUiName(),featureValue,mtasId++,aAnnotation.getBegin(),aAnnotation.getEnd(),aBeginToken,aEndToken);
  return mtasId;
}
Program: 63027
Project: 63027
Buggy source:
public void write(RepositoryConnection aConn,KnowledgeBase kb){
  ValueFactory vf=aConn.getValueFactory();
  IRI subject=vf.createIRI(identifier);
  originalStatements.clear();
  Statement typeStmt=vf.createStatement(subject,kb.getTypeIri(),vf.createIRI(type.toString()));
  originalStatements.add(typeStmt);
  aConn.add(typeStmt);
  if (isNotBlank(name)) {
    Statement nameStmt=vf.createStatement(subject,kb.getLabelIri(),vf.createLiteral(name,language));
    originalStatements.add(nameStmt);
    aConn.add(nameStmt);
  }
  if (isNotBlank(description)) {
    Statement descStmt=vf.createStatement(subject,kb.getDescriptionIri(),vf.createLiteral(description,language));
    originalStatements.add(descStmt);
    aConn.add(descStmt);
  }
}

Fixed version (ground truth):
public void write(RepositoryConnection aConn,KnowledgeBase kb){
  ValueFactory vf=aConn.getValueFactory();
  IRI subject=vf.createIRI(identifier);
  originalStatements.clear();
  Statement typeStmt=vf.createStatement(subject,kb.getTypeIri(),vf.createIRI(type.toString()));
  originalStatements.add(typeStmt);
  aConn.add(typeStmt);
  if (isNotBlank(name)) {
    Literal nameLiteral;
    if (language == null) {
      nameLiteral=vf.createLiteral(name);
    }
 else {
      nameLiteral=vf.createLiteral(name,language);
    }
    Statement nameStmt=vf.createStatement(subject,kb.getLabelIri(),nameLiteral);
    originalStatements.add(nameStmt);
    aConn.add(nameStmt);
  }
  if (isNotBlank(description)) {
    Literal descriptionLiteral;
    if (language == null) {
      descriptionLiteral=vf.createLiteral(description);
    }
 else {
      descriptionLiteral=vf.createLiteral(description,language);
    }
    Statement descStmt=vf.createStatement(subject,kb.getDescriptionIri(),descriptionLiteral);
    originalStatements.add(descStmt);
    aConn.add(descStmt);
  }
}
Program: 63030
Project: 63030
Buggy source:
public NamedEntityLinkerClassificationTool(long recommenderId,String feature,AnnotationLayer aLayer,KnowledgeBaseService kbService,ConceptLinkingService clService,DocumentService docService,AnnotationSchemaService annoService,FeatureSupportRegistry fsRegistry){
  super(recommenderId,NamedEntityLinkerClassificationToolFactory.class.getName(),new NamedEntityTrainer(new ClassifierConfiguration<>(feature,recommenderId)),new NamedEntityLinker(new ClassifierConfiguration<>(feature,recommenderId),kbService,clService,docService,annoService,fsRegistry,feature),new NerAnnotationObjectLoader(aLayer,NAMED_ENTITY_CLASSIFICATION_FEATURE),false);
}

Fixed version (ground truth):
public NamedEntityLinkerClassificationTool(long recommenderId,String feature,AnnotationLayer aLayer,KnowledgeBaseService kbService,ConceptLinkingService clService,DocumentService docService,AnnotationSchemaService annoService,FeatureSupportRegistry fsRegistry){
  super(recommenderId,NamedEntityLinkerClassificationToolFactory.class.getName(),new NamedEntityTrainer(new ClassifierConfiguration<>(feature,recommenderId)),new NamedEntityLinker(new ClassifierConfiguration<>(feature,recommenderId),kbService,clService,docService,annoService,fsRegistry,feature),new NerAnnotationObjectLoader(aLayer,NAMED_ENTITY_CLASSIFICATION_FEATURE),false,false);
}
Program: 63031
Project: 63031
Buggy source:
public ExternalClassificationTool(long recommenderId,String feature,String type,ExternalClassifierTraits traits){
  super(recommenderId,ExternalClassificationTool.class.getName(),new ExternalTrainer(new BaseConfiguration()),new ExternalClassifier(new BaseConfiguration(feature),new CustomAnnotationObjectLoader(feature,type),traits,recommenderId),new CustomAnnotationObjectLoader(feature,type),true);
}

Fixed version (ground truth):
public ExternalClassificationTool(long recommenderId,String feature,String type,ExternalClassifierTraits traits){
  super(recommenderId,ExternalClassificationTool.class.getName(),new ExternalTrainer(new BaseConfiguration()),new ExternalClassifier(new BaseConfiguration(feature),new CustomAnnotationObjectLoader(feature,type),traits,recommenderId),new CustomAnnotationObjectLoader(feature,type),true,false);
}
Program: 63032
Project: 63032
Buggy source:
public MiraPosClassificationTool(long recommenderId,String feature,AnnotationLayer aLayer){
  super(recommenderId,MiraPosClassificationTool.class.getName(),new MiraPosTrainer(new BaseConfiguration(feature,recommenderId)),new MiraPosClassifier(new BaseConfiguration(feature,recommenderId)),new PosAnnotationObjectLoader(aLayer,feature),true);
}

Fixed version (ground truth):
public MiraPosClassificationTool(long recommenderId,String feature,AnnotationLayer aLayer){
  super(recommenderId,MiraPosClassificationTool.class.getName(),new MiraPosTrainer(new BaseConfiguration(feature,recommenderId)),new MiraPosClassifier(new BaseConfiguration(feature,recommenderId)),new PosAnnotationObjectLoader(aLayer,feature),true,true);
}
Program: 63033
Project: 63033
Buggy source:
public OpenNlpNerClassificationTool(long recommenderId,String feature,AnnotationLayer aLayer){
  super(recommenderId,OpenNlpNerClassificationTool.class.getName(),new OpenNlpNerTrainer(new BaseConfiguration(feature,recommenderId)),new OpenNlpNerClassifier(new BaseConfiguration(feature,recommenderId)),new NerAnnotationObjectLoader(aLayer,feature),false);
}

Fixed version (ground truth):
public OpenNlpNerClassificationTool(long recommenderId,String feature,AnnotationLayer aLayer){
  super(recommenderId,OpenNlpNerClassificationTool.class.getName(),new OpenNlpNerTrainer(new BaseConfiguration(feature,recommenderId)),new OpenNlpNerClassifier(new BaseConfiguration(feature,recommenderId)),new NerAnnotationObjectLoader(aLayer,feature),false,true);
}
Program: 63034
Project: 63034
Buggy source:
public OpenNlpPosClassificationTool(long recommenderId,int beamSize,String feature,AnnotationLayer aLayer){
  super(recommenderId,OpenNlpPosClassificationTool.class.getName(),new OpenNlpPosTrainer(new CustomConfiguration(beamSize,feature,recommenderId)),new OpenNlpPosClassifier(new CustomConfiguration(beamSize,feature,recommenderId)),new PosAnnotationObjectLoader(aLayer,feature),true);
}

Fixed version (ground truth):
public OpenNlpPosClassificationTool(long recommenderId,int beamSize,String feature,AnnotationLayer aLayer){
  super(recommenderId,OpenNlpPosClassificationTool.class.getName(),new OpenNlpPosTrainer(new CustomConfiguration(beamSize,feature,recommenderId)),new OpenNlpPosClassifier(new CustomConfiguration(beamSize,feature,recommenderId)),new PosAnnotationObjectLoader(aLayer,feature),true,true);
}
Program: 63035
Project: 63035
Buggy source:
public StringMatchingNerClassificationTool(long recommenderId,String feature,AnnotationLayer aLayer){
  super(recommenderId,StringMatchingNerClassificationTool.class.getName(),new StringMatchingNerTrainer(new ClassifierConfiguration<>(feature,recommenderId)),new StringMatchingNerClassifier(new ClassifierConfiguration<>(feature,recommenderId)),new NerAnnotationObjectLoader(aLayer,feature),false);
}

Fixed version (ground truth):
public StringMatchingNerClassificationTool(long recommenderId,String feature,AnnotationLayer aLayer){
  super(recommenderId,StringMatchingNerClassificationTool.class.getName(),new StringMatchingNerTrainer(new ClassifierConfiguration<>(feature,recommenderId)),new StringMatchingNerClassifier(new ClassifierConfiguration<>(feature,recommenderId)),new NerAnnotationObjectLoader(aLayer,feature),false,true);
}
Program: 63036
Project: 63036
Buggy source:
public StringMatchingPosClassificationTool(long recommenderId,String feature,AnnotationLayer aLayer){
  super(recommenderId,StringMatchingPosClassificationTool.class.getName(),new StringMatchingPosTrainer(new ClassifierConfiguration<>(feature,recommenderId)),new StringMatchingPosClassifier(new ClassifierConfiguration<>(feature,recommenderId)),new PosAnnotationObjectLoader(aLayer,feature),false);
}

Fixed version (ground truth):
public StringMatchingPosClassificationTool(long recommenderId,String feature,AnnotationLayer aLayer){
  super(recommenderId,StringMatchingPosClassificationTool.class.getName(),new StringMatchingPosTrainer(new ClassifierConfiguration<>(feature,recommenderId)),new StringMatchingPosClassifier(new ClassifierConfiguration<>(feature,recommenderId)),new PosAnnotationObjectLoader(aLayer,feature),false,true);
}
Program: 63037
Project: 63037
Buggy source:
protected void setTrainer(Trainer<C> trainer){
  this.trainer=trainer;
}

Fixed version (ground truth):
public void setTrainer(Trainer<C> trainer){
  this.trainer=trainer;
}
Program: 63038
Project: 63038
Buggy source:
protected void setTrainOnCompleteSentences(boolean trainOnCompleteSentences){
  this.trainOnCompleteSentences=trainOnCompleteSentences;
}

Fixed version (ground truth):
public void setTrainOnCompleteSentences(boolean trainOnCompleteSentences){
  this.trainOnCompleteSentences=trainOnCompleteSentences;
}
Program: 63039
Project: 63039
Buggy source:
/** 
 * Constructs a new ClassificationTool
 * @param id A id for the classification tool. It is recommended to use a unique id.
 * @param name A name for the classification tool. It is recommended to use a unique name.
 * @param trainer The trainer class training the model of the implementing machine learning algorithm.
 * @param classifier The classifier, i.e. the machine learning algorithm.
 * @param loader A loader class, used to load annotated data out of a  {@link JCas}
 * @param trainOnCompleteSentences true, if sentences have to be fully annotated, i.e. every token needs an annotation label != null, to be used for training.
 */
protected ClassificationTool(long id,String name,Trainer<C> trainer,Classifier<C> classifier,AnnotationObjectLoader loader,boolean trainOnCompleteSentences){
  super();
  this.id=id;
  this.name=name;
  this.trainer=trainer;
  this.classifier=classifier;
  this.loader=loader;
  this.trainOnCompleteSentences=trainOnCompleteSentences;
}

Fixed version (ground truth):
/** 
 * Constructs a new ClassificationTool
 * @param id A id for the classification tool. It is recommended to use a unique id.
 * @param name A name for the classification tool. It is recommended to use a unique name.
 * @param trainer The trainer class training the model of the implementing machine learning algorithm.
 * @param classifier The classifier, i.e. the machine learning algorithm.
 * @param loader A loader class, used to load annotated data out of a  {@link JCas}
 * @param trainOnCompleteSentences true, if sentences have to be fully annotated, i.e. every token needs an annotation label != null, to be used for training.
 * @param isEvaluable Some classification tools should be skipped during evaluation, since they do not train or are trained externally. true, if the classifier is locally evaluable.
 */
protected ClassificationTool(long id,String name,Trainer<C> trainer,Classifier<C> classifier,AnnotationObjectLoader loader,boolean trainOnCompleteSentences,boolean isEvaluable){
  super();
  this.id=id;
  this.name=name;
  this.trainer=trainer;
  this.classifier=classifier;
  this.loader=loader;
  this.trainOnCompleteSentences=trainOnCompleteSentences;
  this.isEvaluable=isEvaluable;
}
Program: 63040
Project: 63040
Buggy source:
protected void setLoader(AnnotationObjectLoader loader){
  this.loader=loader;
}

Fixed version (ground truth):
public void setLoader(AnnotationObjectLoader loader){
  this.loader=loader;
}
Program: 63041
Project: 63041
Buggy source:
protected void setClassifier(Classifier<C> classifier){
  this.classifier=classifier;
}

Fixed version (ground truth):
public void setClassifier(Classifier<C> classifier){
  this.classifier=classifier;
}
Program: 63043
Project: 63043
Buggy source:
public NamedEntityLinker(ClassifierConfiguration<Object> aConf,KnowledgeBaseService aKbService,ConceptLinkingService aClService,DocumentService aDocService,AnnotationSchemaService aAnnoService,FeatureSupportRegistry aFsRegistry){
  super(aConf);
  kbService=aKbService;
  clService=aClService;
  documentService=aDocService;
  annoService=aAnnoService;
  fsRegistry=aFsRegistry;
  conf.setNumPredictions(numPredictions);
}

Fixed version (ground truth):
public NamedEntityLinker(ClassifierConfiguration<Object> aConf,KnowledgeBaseService aKbService,ConceptLinkingService aClService,DocumentService aDocService,AnnotationSchemaService aAnnoService,FeatureSupportRegistry aFsRegistry,String aFeature){
  super(aConf);
  kbService=aKbService;
  clService=aClService;
  documentService=aDocService;
  annoService=aAnnoService;
  fsRegistry=aFsRegistry;
  conf.setNumPredictions(numPredictions);
  feature=aFeature;
}
Program: 63044
Project: 63044
Buggy source:
public NamedEntityLinkerClassificationTool(long recommenderId,String feature,AnnotationLayer aLayer,KnowledgeBaseService kbService,ConceptLinkingService clService,DocumentService docService,AnnotationSchemaService annoService,FeatureSupportRegistry fsRegistry){
  super(recommenderId,NamedEntityLinkerClassificationToolFactory.class.getName(),new NamedEntityTrainer(new ClassifierConfiguration<>(feature,recommenderId)),new NamedEntityLinker(new ClassifierConfiguration<>(feature,recommenderId),kbService,clService,docService,annoService,fsRegistry),new NerAnnotationObjectLoader(aLayer,NAMED_ENTITY_CLASSIFICATION_FEATURE),false);
}

Fixed version (ground truth):
public NamedEntityLinkerClassificationTool(long recommenderId,String feature,AnnotationLayer aLayer,KnowledgeBaseService kbService,ConceptLinkingService clService,DocumentService docService,AnnotationSchemaService annoService,FeatureSupportRegistry fsRegistry){
  super(recommenderId,NamedEntityLinkerClassificationToolFactory.class.getName(),new NamedEntityTrainer(new ClassifierConfiguration<>(feature,recommenderId)),new NamedEntityLinker(new ClassifierConfiguration<>(feature,recommenderId),kbService,clService,docService,annoService,fsRegistry,feature),new NerAnnotationObjectLoader(aLayer,NAMED_ENTITY_CLASSIFICATION_FEATURE),false);
}
Program: 63045
Project: 63045
Buggy source:
@Override public boolean accepts(AnnotationLayer aLayer,AnnotationFeature aFeature){
  if (aLayer == null || aFeature == null) {
    return false;
  }
  return (aLayer.isLockToTokenOffset() || aLayer.isMultipleTokens()) && !aLayer.isCrossSentence() && "String_Node_Str".equals(aLayer.getType())&& (CAS.TYPE_NAME_STRING.equals(aFeature.getType()) || aFeature.isVirtualFeature());
}

Fixed version (ground truth):
@Override public boolean accepts(AnnotationLayer aLayer,AnnotationFeature aFeature){
  if (aLayer == null || aFeature == null) {
    return false;
  }
  return (aLayer.isLockToTokenOffset() || aLayer.isMultipleTokens()) && !aLayer.isCrossSentence() && "String_Node_Str".equals(aLayer.getType())&& aFeature.getType().startsWith(PREFIX);
}
Program: 63046
Project: 63046
Buggy source:
private void jumpAndHighlightFromLearningHistory(AjaxRequestTarget aTarget,LearningRecord record) throws IOException {
  actionShowSelectedDocument(aTarget,record.getSourceDocument(),record.getOffsetCharacterBegin());
  JCas aJcas=this.getJCasProvider().get();
  if (record.getUserAction().equals(LearningRecordUserAction.REJECTED)) {
    highlightTextAndDisplayMessage(aTarget,record);
  }
 else   if (activeLearningRecommender.checkRecommendationExist(activeLearningService,record)) {
    highlightRecommendation(aTarget,record.getOffsetCharacterBegin(),record.getOffsetCharacterEnd(),record.getTokenText(),record.getAnnotation());
  }
 else   if (!isAnnotatedInCas(record,aJcas)) {
    highlightTextAndDisplayMessage(aTarget,record);
  }
}

Fixed version (ground truth):
private void jumpAndHighlightFromLearningHistory(AjaxRequestTarget aTarget,LearningRecord record) throws IOException {
  actionShowSelectedDocument(aTarget,record.getSourceDocument(),record.getOffsetCharacterBegin());
  JCas jCas=this.getJCasProvider().get();
  if (record.getUserAction().equals(LearningRecordUserAction.REJECTED)) {
    highlightTextAndDisplayMessage(aTarget,record);
  }
 else   if (activeLearningRecommender.checkRecommendationExist(activeLearningService,record)) {
    highlightRecommendation(aTarget,record.getOffsetCharacterBegin(),record.getOffsetCharacterEnd(),record.getTokenText(),record.getAnnotation());
  }
 else   if (!isAnnotatedInCas(record,jCas)) {
    highlightTextAndDisplayMessage(aTarget,record);
  }
}
Program: 63047
Project: 63047
Buggy source:
private void deleteAnnotationByHistory(AjaxRequestTarget aTarget,LearningRecord aRecord,JCas aJcas) throws IOException, AnnotationException {
  this.getModelObject().getSelection().selectSpan(highlightVID,aJcas,aRecord.getOffsetCharacterBegin(),aRecord.getOffsetCharacterEnd());
  getActionHandler().actionDelete(aTarget);
}

Fixed version (ground truth):
private void deleteAnnotationByHistory(AjaxRequestTarget aTarget,LearningRecord aRecord) throws IOException, AnnotationException {
  JCas jCas=this.getJCasProvider().get();
  this.getModelObject().getSelection().selectSpan(highlightVID,jCas,aRecord.getOffsetCharacterBegin(),aRecord.getOffsetCharacterEnd());
  getActionHandler().actionDelete(aTarget);
}
Program: 63048
Project: 63048
Buggy source:
private void actionRemoveHistoryItem(AjaxRequestTarget aTarget,LearningRecord aRecord) throws IOException, AnnotationException {
  aTarget.add(mainContainer);
  annotationPage.actionRefreshDocument(aTarget);
  learningRecordService.delete(aRecord);
  learningRecords.detach();
  if (aRecord.getUserAction().equals(LearningRecordUserAction.ACCEPTED)) {
    actionShowSelectedDocument(aTarget,aRecord.getSourceDocument(),aRecord.getOffsetCharacterBegin());
    JCas aJcas=casStorageService.readCas(aRecord.getSourceDocument(),aRecord.getUser());
    if (isAnnotatedInCas(aRecord,aJcas)) {
      confirmationDialog.setTitleModel(new StringResourceModel("String_Node_Str",this));
      confirmationDialog.setContentModel(new StringResourceModel("String_Node_Str",this,null));
      confirmationDialog.show(aTarget);
      confirmationDialog.setConfirmAction(t -> deleteAnnotationByHistory(t,aRecord,aJcas));
    }
  }
}

Fixed version (ground truth):
private void actionRemoveHistoryItem(AjaxRequestTarget aTarget,LearningRecord aRecord) throws IOException {
  aTarget.add(mainContainer);
  annotationPage.actionRefreshDocument(aTarget);
  learningRecordService.delete(aRecord);
  learningRecords.detach();
  if (aRecord.getUserAction().equals(LearningRecordUserAction.ACCEPTED)) {
    actionShowSelectedDocument(aTarget,aRecord.getSourceDocument(),aRecord.getOffsetCharacterBegin());
    AnnotationDocument annoDoc=documentService.createOrGetAnnotationDocument(aRecord.getSourceDocument(),userDao.get(aRecord.getUser()));
    JCas jCas=documentService.readAnnotationCas(annoDoc);
    if (isAnnotatedInCas(aRecord,jCas)) {
      confirmationDialog.setTitleModel(new StringResourceModel("String_Node_Str",this));
      confirmationDialog.setContentModel(new StringResourceModel("String_Node_Str",this,null));
      confirmationDialog.show(aTarget);
      confirmationDialog.setConfirmAction(t -> deleteAnnotationByHistory(t,aRecord));
    }
  }
}
Program: 63049
Project: 63049
Buggy source:
private boolean isNamedEntity(TokenObject token){
  return nerAnnotations.stream().map(AnnotationObject::getOffset).anyMatch(t -> t.equals(token.getOffset()));
}

Fixed version (ground truth):
private boolean isNamedEntity(TokenObject token){
  return nerAnnotations.stream().map(AnnotationObject::getTokenObject).anyMatch(t -> t.getOffset().equals(token.getOffset()) && t.getDocumentURI().equals(token.getDocumentURI()));
}
Program: 63050
Project: 63050
Buggy source:
private boolean isNamedEntity(TokenObject token){
  return nerAnnotations.stream().map(AnnotationObject::getOffset).anyMatch(t -> t.equals(token.getOffset()));
}

Fixed version (ground truth):
private boolean isNamedEntity(TokenObject token){
  return nerAnnotations.stream().map(AnnotationObject::getTokenObject).anyMatch(t -> t.getOffset().equals(token.getOffset()) && t.getDocumentURI().equals(token.getDocumentURI()));
}
Program: 63051
Project: 63051
Buggy source:
private boolean isNamedEntity(TokenObject token){
  return nerAnnotations.stream().map(AnnotationObject::getOffset).anyMatch(t -> t.equals(token.getOffset()));
}

Fixed version (ground truth):
private boolean isNamedEntity(TokenObject token){
  return nerAnnotations.stream().map(AnnotationObject::getTokenObject).anyMatch(t -> t.getOffset().equals(token.getOffset()) && t.getDocumentURI().equals(token.getDocumentURI()));
}
Program: 63053
Project: 63053
Buggy source:
public ConceptInstancePanel(String aId,IModel<KnowledgeBase> aKbModel,IModel<KBHandle> selectedConceptHandle,IModel<KBConcept> selectedConceptModel){
  super(aId,selectedConceptModel);
  setOutputMarkupId(true);
  kbModel=aKbModel;
  selectedInstanceHandle=Model.of();
  this.selectedConceptHandle=selectedConceptHandle;
  add(new ConceptInfoPanel("String_Node_Str",kbModel,selectedConceptHandle,selectedConceptModel));
  add(new InstanceListPanel("String_Node_Str",kbModel,selectedConceptHandle,selectedInstanceHandle));
  annotatedSearchPanel=new AnnotatedListIdentifiers("String_Node_Str",kbModel,selectedConceptHandle,selectedInstanceHandle);
  add(annotatedSearchPanel);
  instanceInfoPanel=new EmptyPanel(INSTANCE_INFO_MARKUP_ID).setVisibilityAllowed(false);
  add(instanceInfoPanel);
}

Fixed version (ground truth):
public ConceptInstancePanel(String aId,IModel<KnowledgeBase> aKbModel,IModel<KBHandle> selectedConceptHandle,IModel<KBConcept> selectedConceptModel){
  super(aId,selectedConceptModel);
  setOutputMarkupId(true);
  kbModel=aKbModel;
  selectedInstanceHandle=Model.of();
  this.selectedConceptHandle=selectedConceptHandle;
  add(new ConceptInfoPanel("String_Node_Str",kbModel,selectedConceptHandle,selectedConceptModel));
  add(new InstanceListPanel("String_Node_Str",kbModel,selectedConceptHandle,selectedInstanceHandle));
  if (selectedConceptHandle.getObject() != null) {
    annotatedSearchPanel=new AnnotatedListIdentifiers("String_Node_Str",kbModel,selectedConceptHandle,selectedInstanceHandle);
    add(annotatedSearchPanel);
  }
 else {
    annotatedSearchPanel=new EmptyPanel("String_Node_Str").setVisibilityAllowed(false);
    add(annotatedSearchPanel);
  }
  instanceInfoPanel=new EmptyPanel(INSTANCE_INFO_MARKUP_ID).setVisibilityAllowed(false);
  add(instanceInfoPanel);
}
Program: 63054
Project: 63054
Buggy source:
@OnEvent public void actionNewInstance(AjaxNewInstanceEvent event){
  selectedInstanceHandle.setObject(null);
  KBInstance instance=new KBInstance();
  URI type=selectedConceptHandle.getObject() != null ? URI.create(selectedConceptHandle.getObject().getIdentifier()) : null;
  instance.setType(type);
  Component replacement=new InstanceInfoPanel(INSTANCE_INFO_MARKUP_ID,kbModel,selectedInstanceHandle,Model.of(instance));
  Component replacementSearch=new AnnotatedListIdentifiers("String_Node_Str",kbModel,selectedConceptHandle,selectedInstanceHandle);
  annotatedSearchPanel=annotatedSearchPanel.replaceWith(replacementSearch);
  instanceInfoPanel=instanceInfoPanel.replaceWith(replacement);
  event.getTarget().add(this);
}

Fixed version (ground truth):
@OnEvent public void actionNewInstance(AjaxNewInstanceEvent event){
  selectedInstanceHandle.setObject(null);
  KBInstance instance=new KBInstance();
  URI type=selectedConceptHandle.getObject() != null ? URI.create(selectedConceptHandle.getObject().getIdentifier()) : null;
  instance.setType(type);
  Component replacement=new InstanceInfoPanel(INSTANCE_INFO_MARKUP_ID,kbModel,selectedInstanceHandle,Model.of(instance));
  instanceInfoPanel=instanceInfoPanel.replaceWith(replacement);
  event.getTarget().add(this);
}
Program: 63055
Project: 63055
Buggy source:
public MtasToken getMtasTokenKBFeature(){
}

Fixed version (ground truth):
/** 
 * Method Implementation to get MtasToken (To be done when subclass and class  semantics to be included
 * @return
 */
public MtasToken getMtasTokenKBFeature(){
  return null;
}
Program: 63056
Project: 63056
Buggy source:
/** 
 * Read identifier URI and return Optional<KBObject>
 * @param aProject
 * @param aIdentifier
 * @return
 */
public Optional<KBObject> readKBIdentifier(Project aProject,String aIdentifier){
  for (  KnowledgeBase kb : kbService.getKnowledgeBases(aProject)) {
    try (RepositoryConnection conn=kbService.getConnection(kb)){
      ValueFactory vf=conn.getValueFactory();
      RepositoryResult<Statement> stmts=RdfUtils.getStatements(conn,vf.createIRI(aIdentifier),kb.getTypeIri(),kb.getClassIri(),true);
      if (stmts.hasNext()) {
        Statement conceptStmt=stmts.next();
        KBConcept kbConcept=KBConcept.read(conn,conceptStmt);
        return Optional.of(kbConcept);
      }
 else       if (!stmts.hasNext()) {
        Optional<KBInstance> kbInstance=kbService.readInstance(kb,aIdentifier);
        return kbInstance.flatMap((p) -> Optional.of(p));
      }
    }
 catch (    QueryEvaluationException e) {
      log.error("String_Node_Str",e);
      return Optional.empty();
    }
  }
  return Optional.empty();
}

Fixed version (ground truth):
/** 
 * Read identifier URI and return Optional<KBObject>
 * @param aProject
 * @param aIdentifier
 * @return
 */
public Optional<KBObject> readKBIdentifier(Project aProject,String aIdentifier){
  for (  KnowledgeBase kb : kbService.getKnowledgeBases(aProject)) {
    try (RepositoryConnection conn=kbService.getConnection(kb)){
      ValueFactory vf=conn.getValueFactory();
      RepositoryResult<Statement> stmts=RdfUtils.getStatements(conn,vf.createIRI(aIdentifier),kb.getTypeIri(),kb.getClassIri(),true);
      if (stmts.hasNext()) {
        Statement conceptStmt=stmts.next();
        KBConcept kbConcept=KBConcept.read(conn,conceptStmt);
        if (kbConcept != null) {
          return Optional.of(kbConcept);
        }
      }
 else       if (!stmts.hasNext()) {
        Optional<KBInstance> kbInstance=kbService.readInstance(kb,aIdentifier);
        if (kbInstance.isPresent()) {
          return kbInstance.flatMap((p) -> Optional.of(p));
        }
      }
    }
 catch (    QueryEvaluationException e) {
      log.error("String_Node_Str",e);
      return Optional.empty();
    }
  }
  return Optional.empty();
}
Program: 63057
Project: 63057
Buggy source:
/** 
 * Takes in IRI for identifier and returns teh label String Eg: InputParameter :- http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#RoseDAnjou Returned :- "KBConcept"+MtasToken.DELIMITER+RoseDAnjou
 * @param iri
 * @return
 */
public String getUILabel(String aIRI){
  StringBuilder labelStr=new StringBuilder();
  Optional<KBObject> kbObject=kbUtil.readKBIdentifier(project,aIRI);
  if (kbObject.isPresent()) {
    labelStr.append(kbObject.get().getClass().getSimpleName() + MtasToken.DELIMITER + kbObject.get().getUiLabel());
  }
 else {
    return labelStr.toString();
  }
  return labelStr.toString();
}

Fixed version (ground truth):
/** 
 * Takes in IRI for identifier and returns teh label String Eg: InputParameter :- http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#RoseDAnjou Returned :- "KBConcept"+MtasToken.DELIMITER+RoseDAnjou
 * @param iri
 * @return
 */
public String getUILabel(String aIRI){
  StringBuilder labelStr=new StringBuilder();
  System.out.println();
  Optional<KBObject> kbObject=kbUtil.readKBIdentifier(project,aIRI);
  if (kbObject.isPresent()) {
    labelStr.append(kbObject.get().getClass().getSimpleName() + MtasToken.DELIMITER + kbObject.get().getUiLabel());
  }
 else {
    return labelStr.toString();
  }
  return labelStr.toString();
}
Program: 63065
Project: 63065
Buggy source:
@Override protected void actionDelete(AjaxRequestTarget aTarget){
  kbService.deleteConcept(kbModel.getObject(),kbObjectModel.getObject());
  kbObjectModel.setObject(null);
  send(getPage(),Broadcast.BREADTH,new AjaxConceptSelectionEvent(aTarget,null));
}

Fixed version (ground truth):
@Override protected void actionDelete(AjaxRequestTarget aTarget){
  kbService.deleteConcept(kbModel.getObject(),kbObjectModel.getObject());
  kbObjectModel.setObject(null);
  send(getPage(),Broadcast.BREADTH,new AjaxConceptSelectionEvent(aTarget,null,true));
}
Program: 63066
Project: 63066
Buggy source:
/** 
 * If the user disabled "show all" but a concept from an implicit namespace was selected, the concept selection is cancelled. In any other case this component is merely updated via AJAX.
 * @param aTarget
 */
private void actionPreferenceChanged(AjaxRequestTarget aTarget){
  if (!preferences.getObject().showAllConcepts && selectedConcept.getObject() != null && RdfUtils.isFromImplicitNamespace(selectedConcept.getObject())) {
    send(getPage(),Broadcast.BREADTH,new AjaxConceptSelectionEvent(aTarget,null));
  }
 else {
    aTarget.add(this);
  }
}

Fixed version (ground truth):
/** 
 * If the user disabled "show all" but a concept from an implicit namespace was selected, the concept selection is cancelled. In any other case this component is merely updated via AJAX.
 * @param aTarget
 */
private void actionPreferenceChanged(AjaxRequestTarget aTarget){
  if (!preferences.getObject().showAllConcepts && selectedConcept.getObject() != null && RdfUtils.isFromImplicitNamespace(selectedConcept.getObject())) {
    send(getPage(),Broadcast.BREADTH,new AjaxConceptSelectionEvent(aTarget,null,true));
  }
 else {
    aTarget.add(this);
  }
}
Program: 63067
Project: 63067
Buggy source:
/** 
 * If the user disabled "show all" but a concept from an implicit namespace was selected, the concept selection is cancelled. In any other case this component is merely updated via AJAX.
 */
private void actionPreferenceChanged(AjaxRequestTarget aTarget){
  if (!preferences.getObject().showAllConcepts && selectedConcept.getObject() != null && RdfUtils.isFromImplicitNamespace(selectedConcept.getObject())) {
    send(getPage(),Broadcast.BREADTH,new AjaxConceptSelectionEvent(aTarget,null));
  }
 else {
    aTarget.add(this);
  }
}

Fixed version (ground truth):
/** 
 * If the user disabled "show all" but a concept from an implicit namespace was selected, the concept selection is cancelled. In any other case this component is merely updated via AJAX.
 */
private void actionPreferenceChanged(AjaxRequestTarget aTarget){
  if (!preferences.getObject().showAllConcepts && selectedConcept.getObject() != null && RdfUtils.isFromImplicitNamespace(selectedConcept.getObject())) {
    send(getPage(),Broadcast.BREADTH,new AjaxConceptSelectionEvent(aTarget,null,true));
  }
 else {
    aTarget.add(this);
  }
}
Program: 63068
Project: 63068
Buggy source:
@OnEvent public void actionPropertySelectionChanged(AjaxPropertySelectionEvent event){
  selectedConceptHandle.setObject(null);
  selectedPropertyHandle.setObject(event.getSelection());
  Component replacementPanel;
  if (selectedPropertyHandle.getObject() == null) {
    replacementPanel=new EmptyPanel(DETAILS_MARKUP_ID);
  }
 else {
    String identifier=selectedPropertyHandle.getObject().getIdentifier();
    try {
      replacementPanel=kbService.readProperty(kbModel.getObject(),identifier).<Component>map(selectedProperty -> {
        Model<KBProperty> model=Model.of(selectedProperty);
        return new PropertyPanel(DETAILS_MARKUP_ID,kbModel,selectedPropertyHandle,model);
      }
).orElse(new EmptyPanel(DETAILS_MARKUP_ID));
    }
 catch (    QueryEvaluationException e) {
      error("String_Node_Str" + e.getLocalizedMessage());
      LOG.error("String_Node_Str",e);
      replacementPanel=new EmptyPanel(DETAILS_MARKUP_ID);
    }
  }
  details=details.replaceWith(replacementPanel);
  event.getTarget().add(conceptTreePanel,propertyListPanel,detailContainer);
  event.getTarget().addChildren(getPage(),IFeedback.class);
}

Fixed version (ground truth):
@OnEvent public void actionPropertySelectionChanged(AjaxPropertySelectionEvent event){
  selectedConceptHandle.setObject(null);
  selectedPropertyHandle.setObject(event.getSelection());
  Component replacementPanel;
  if (selectedPropertyHandle.getObject() == null) {
    replacementPanel=new EmptyPanel(DETAILS_MARKUP_ID);
  }
 else {
    String identifier=selectedPropertyHandle.getObject().getIdentifier();
    try {
      replacementPanel=kbService.readProperty(kbModel.getObject(),identifier).<Component>map(selectedProperty -> {
        Model<KBProperty> model=Model.of(selectedProperty);
        return new PropertyPanel(DETAILS_MARKUP_ID,kbModel,selectedPropertyHandle,model);
      }
).orElse(new EmptyPanel(DETAILS_MARKUP_ID));
    }
 catch (    QueryEvaluationException e) {
      error("String_Node_Str" + e.getLocalizedMessage());
      LOG.error("String_Node_Str",e);
      replacementPanel=new EmptyPanel(DETAILS_MARKUP_ID);
    }
  }
  details=details.replaceWith(replacementPanel);
  if (event.isRedrawConceptandPropertyListPanels()) {
    event.getTarget().add(propertyListPanel,conceptTreePanel);
  }
  event.getTarget().add(detailContainer);
  event.getTarget().addChildren(getPage(),IFeedback.class);
}
Program: 63069
Project: 63069
Buggy source:
@OnEvent public void actionConceptSelectionChanged(AjaxConceptSelectionEvent event){
  selectedPropertyHandle.setObject(null);
  selectedConceptHandle.setObject(event.getSelection());
  Component replacementPanel;
  if (selectedConceptHandle.getObject() == null) {
    replacementPanel=new EmptyPanel(DETAILS_MARKUP_ID);
  }
 else {
    try {
      KBConcept selectedConcept=kbService.readConcept(kbModel.getObject(),selectedConceptHandle.getObject().getIdentifier()).get();
      replacementPanel=new ConceptInstancePanel(DETAILS_MARKUP_ID,kbModel,selectedConceptHandle,Model.of(selectedConcept));
    }
 catch (    QueryEvaluationException e) {
      error("String_Node_Str" + e.getLocalizedMessage());
      LOG.error("String_Node_Str",e);
      replacementPanel=new EmptyPanel(DETAILS_MARKUP_ID);
    }
  }
  details=details.replaceWith(replacementPanel);
  event.getTarget().add(conceptTreePanel,propertyListPanel,detailContainer);
  event.getTarget().addChildren(getPage(),IFeedback.class);
}

Fixed version (ground truth):
@OnEvent public void actionConceptSelectionChanged(AjaxConceptSelectionEvent event){
  selectedPropertyHandle.setObject(null);
  selectedConceptHandle.setObject(event.getSelection());
  Component replacementPanel;
  if (selectedConceptHandle.getObject() == null) {
    replacementPanel=new EmptyPanel(DETAILS_MARKUP_ID);
  }
 else {
    try {
      KBConcept selectedConcept=kbService.readConcept(kbModel.getObject(),selectedConceptHandle.getObject().getIdentifier()).get();
      replacementPanel=new ConceptInstancePanel(DETAILS_MARKUP_ID,kbModel,selectedConceptHandle,Model.of(selectedConcept));
    }
 catch (    QueryEvaluationException e) {
      error("String_Node_Str" + e.getLocalizedMessage());
      LOG.error("String_Node_Str",e);
      replacementPanel=new EmptyPanel(DETAILS_MARKUP_ID);
    }
  }
  details=details.replaceWith(replacementPanel);
  if (event.isRedrawConceptandPropertyListPanels()) {
    event.getTarget().add(conceptTreePanel,propertyListPanel);
  }
  event.getTarget().add(detailContainer);
  event.getTarget().addChildren(getPage(),IFeedback.class);
}
Program: 63070
Project: 63070
Buggy source:
/** 
 * If the user disabled "show all" but a property from an implicit namespace was selected, the property selection is cancelled. In any other case this component is merely updated via AJAX.
 * @param aTarget
 */
private void actionPreferenceChanged(AjaxRequestTarget aTarget){
  if (!preferences.getObject().showAllProperties && selectedProperty.getObject() != null && RdfUtils.isFromImplicitNamespace(selectedProperty.getObject())) {
    send(getPage(),Broadcast.BREADTH,new AjaxPropertySelectionEvent(aTarget,null));
  }
 else {
    aTarget.add(this);
  }
}

Fixed version (ground truth):
/** 
 * If the user disabled "show all" but a property from an implicit namespace was selected, the property selection is cancelled. In any other case this component is merely updated via AJAX.
 * @param aTarget
 */
private void actionPreferenceChanged(AjaxRequestTarget aTarget){
  if (!preferences.getObject().showAllProperties && selectedProperty.getObject() != null && RdfUtils.isFromImplicitNamespace(selectedProperty.getObject())) {
    send(getPage(),Broadcast.BREADTH,new AjaxPropertySelectionEvent(aTarget,null,true));
  }
 else {
    aTarget.add(this);
  }
}
Program: 63071
Project: 63071
Buggy source:
@Override protected void actionDelete(AjaxRequestTarget aTarget){
  kbService.deleteProperty(kbModel.getObject(),kbObjectModel.getObject());
  kbObjectModel.setObject(null);
  send(getPage(),Broadcast.BREADTH,new AjaxPropertySelectionEvent(aTarget,null));
}

Fixed version (ground truth):
@Override protected void actionDelete(AjaxRequestTarget aTarget){
  kbService.deleteProperty(kbModel.getObject(),kbObjectModel.getObject());
  kbObjectModel.setObject(null);
  send(getPage(),Broadcast.BREADTH,new AjaxPropertySelectionEvent(aTarget,null,true));
}
Program: 63072
Project: 63072
Buggy source:
public AjaxConceptSelectionEvent(AjaxRequestTarget aTarget,KBHandle newSelection){
  super(aTarget,newSelection);
}

Fixed version (ground truth):
public AjaxConceptSelectionEvent(AjaxRequestTarget aTarget,KBHandle newSelection,boolean aRedrawConceptandPropertyListPanels){
  super(aTarget,newSelection);
  redrawConceptandPropertyListPanels=aRedrawConceptandPropertyListPanels;
}
Program: 63073
Project: 63073
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: 63074
Project: 63074
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: 63075
Project: 63075
Buggy source:
@Override protected void actionDelete(AjaxRequestTarget aTarget){
  kbService.deleteConcept(kbModel.getObject(),kbObjectModel.getObject());
  kbObjectModel.setObject(null);
  send(getPage(),Broadcast.BREADTH,new AjaxConceptSelectionEvent(aTarget,null));
}

Fixed version (ground truth):
@Override protected void actionDelete(AjaxRequestTarget aTarget){
  kbService.deleteConcept(kbModel.getObject(),kbObjectModel.getObject());
  kbObjectModel.setObject(null);
  send(getPage(),Broadcast.BREADTH,new AjaxConceptSelectionEvent(aTarget,null,true));
}
Program: 63076
Project: 63076
Buggy source:
/** 
 * If the user disabled "show all" but a concept from an implicit namespace was selected, the concept selection is cancelled. In any other case this component is merely updated via AJAX.
 * @param aTarget
 */
private void actionPreferenceChanged(AjaxRequestTarget aTarget){
  if (!preferences.getObject().showAllConcepts && selectedConcept.getObject() != null && RdfUtils.isFromImplicitNamespace(selectedConcept.getObject())) {
    send(getPage(),Broadcast.BREADTH,new AjaxConceptSelectionEvent(aTarget,null));
  }
 else {
    aTarget.add(this);
  }
}

Fixed version (ground truth):
/** 
 * If the user disabled "show all" but a concept from an implicit namespace was selected, the concept selection is cancelled. In any other case this component is merely updated via AJAX.
 * @param aTarget
 */
private void actionPreferenceChanged(AjaxRequestTarget aTarget){
  if (!preferences.getObject().showAllConcepts && selectedConcept.getObject() != null && RdfUtils.isFromImplicitNamespace(selectedConcept.getObject())) {
    send(getPage(),Broadcast.BREADTH,new AjaxConceptSelectionEvent(aTarget,null,true));
  }
 else {
    aTarget.add(this);
  }
}
Program: 63077
Project: 63077
Buggy source:
/** 
 * If the user disabled "show all" but a concept from an implicit namespace was selected, the concept selection is cancelled. In any other case this component is merely updated via AJAX.
 */
private void actionPreferenceChanged(AjaxRequestTarget aTarget){
  if (!preferences.getObject().showAllConcepts && selectedConcept.getObject() != null && RdfUtils.isFromImplicitNamespace(selectedConcept.getObject())) {
    send(getPage(),Broadcast.BREADTH,new AjaxConceptSelectionEvent(aTarget,null));
  }
 else {
    aTarget.add(this);
  }
}

Fixed version (ground truth):
/** 
 * If the user disabled "show all" but a concept from an implicit namespace was selected, the concept selection is cancelled. In any other case this component is merely updated via AJAX.
 */
private void actionPreferenceChanged(AjaxRequestTarget aTarget){
  if (!preferences.getObject().showAllConcepts && selectedConcept.getObject() != null && RdfUtils.isFromImplicitNamespace(selectedConcept.getObject())) {
    send(getPage(),Broadcast.BREADTH,new AjaxConceptSelectionEvent(aTarget,null,true));
  }
 else {
    aTarget.add(this);
  }
}
Program: 63078
Project: 63078
Buggy source:
@OnEvent public void actionPropertySelectionChanged(AjaxPropertySelectionEvent event){
  selectedConceptHandle.setObject(null);
  selectedPropertyHandle.setObject(event.getSelection());
  Component replacementPanel;
  if (selectedPropertyHandle.getObject() == null) {
    replacementPanel=new EmptyPanel(DETAILS_MARKUP_ID);
  }
 else {
    String identifier=selectedPropertyHandle.getObject().getIdentifier();
    try {
      replacementPanel=kbService.readProperty(kbModel.getObject(),identifier).<Component>map(selectedProperty -> {
        Model<KBProperty> model=Model.of(selectedProperty);
        return new PropertyPanel(DETAILS_MARKUP_ID,kbModel,selectedPropertyHandle,model);
      }
).orElse(new EmptyPanel(DETAILS_MARKUP_ID));
    }
 catch (    QueryEvaluationException e) {
      error("String_Node_Str" + e.getLocalizedMessage());
      LOG.error("String_Node_Str",e);
      replacementPanel=new EmptyPanel(DETAILS_MARKUP_ID);
    }
  }
  details=details.replaceWith(replacementPanel);
  event.getTarget().add(conceptTreePanel,propertyListPanel,detailContainer);
  event.getTarget().addChildren(getPage(),IFeedback.class);
}

Fixed version (ground truth):
@OnEvent public void actionPropertySelectionChanged(AjaxPropertySelectionEvent event){
  selectedConceptHandle.setObject(null);
  selectedPropertyHandle.setObject(event.getSelection());
  Component replacementPanel;
  if (selectedPropertyHandle.getObject() == null) {
    replacementPanel=new EmptyPanel(DETAILS_MARKUP_ID);
  }
 else {
    String identifier=selectedPropertyHandle.getObject().getIdentifier();
    try {
      replacementPanel=kbService.readProperty(kbModel.getObject(),identifier).<Component>map(selectedProperty -> {
        Model<KBProperty> model=Model.of(selectedProperty);
        return new PropertyPanel(DETAILS_MARKUP_ID,kbModel,selectedPropertyHandle,model);
      }
).orElse(new EmptyPanel(DETAILS_MARKUP_ID));
    }
 catch (    QueryEvaluationException e) {
      error("String_Node_Str" + e.getLocalizedMessage());
      LOG.error("String_Node_Str",e);
      replacementPanel=new EmptyPanel(DETAILS_MARKUP_ID);
    }
  }
  details=details.replaceWith(replacementPanel);
  if (event.isRedrawConceptandPropertyListPanels()) {
    event.getTarget().add(propertyListPanel,conceptTreePanel);
  }
  event.getTarget().add(detailContainer);
  event.getTarget().addChildren(getPage(),IFeedback.class);
}
Program: 63079
Project: 63079
Buggy source:
@OnEvent public void actionConceptSelectionChanged(AjaxConceptSelectionEvent event){
  selectedPropertyHandle.setObject(null);
  selectedConceptHandle.setObject(event.getSelection());
  Component replacementPanel;
  if (selectedConceptHandle.getObject() == null) {
    replacementPanel=new EmptyPanel(DETAILS_MARKUP_ID);
  }
 else {
    try {
      KBConcept selectedConcept=kbService.readConcept(kbModel.getObject(),selectedConceptHandle.getObject().getIdentifier()).get();
      replacementPanel=new ConceptInstancePanel(DETAILS_MARKUP_ID,kbModel,selectedConceptHandle,Model.of(selectedConcept));
    }
 catch (    QueryEvaluationException e) {
      error("String_Node_Str" + e.getLocalizedMessage());
      LOG.error("String_Node_Str",e);
      replacementPanel=new EmptyPanel(DETAILS_MARKUP_ID);
    }
  }
  details=details.replaceWith(replacementPanel);
  event.getTarget().add(conceptTreePanel,propertyListPanel,detailContainer);
  event.getTarget().addChildren(getPage(),IFeedback.class);
}

Fixed version (ground truth):
@OnEvent public void actionConceptSelectionChanged(AjaxConceptSelectionEvent event){
  selectedPropertyHandle.setObject(null);
  selectedConceptHandle.setObject(event.getSelection());
  Component replacementPanel;
  if (selectedConceptHandle.getObject() == null) {
    replacementPanel=new EmptyPanel(DETAILS_MARKUP_ID);
  }
 else {
    try {
      KBConcept selectedConcept=kbService.readConcept(kbModel.getObject(),selectedConceptHandle.getObject().getIdentifier()).get();
      replacementPanel=new ConceptInstancePanel(DETAILS_MARKUP_ID,kbModel,selectedConceptHandle,Model.of(selectedConcept));
    }
 catch (    QueryEvaluationException e) {
      error("String_Node_Str" + e.getLocalizedMessage());
      LOG.error("String_Node_Str",e);
      replacementPanel=new EmptyPanel(DETAILS_MARKUP_ID);
    }
  }
  details=details.replaceWith(replacementPanel);
  if (event.isRedrawConceptandPropertyListPanels()) {
    event.getTarget().add(conceptTreePanel,propertyListPanel);
  }
  event.getTarget().add(detailContainer);
  event.getTarget().addChildren(getPage(),IFeedback.class);
}
Program: 63080
Project: 63080
Buggy source:
/** 
 * If the user disabled "show all" but a property from an implicit namespace was selected, the property selection is cancelled. In any other case this component is merely updated via AJAX.
 * @param aTarget
 */
private void actionPreferenceChanged(AjaxRequestTarget aTarget){
  if (!preferences.getObject().showAllProperties && selectedProperty.getObject() != null && RdfUtils.isFromImplicitNamespace(selectedProperty.getObject())) {
    send(getPage(),Broadcast.BREADTH,new AjaxPropertySelectionEvent(aTarget,null));
  }
 else {
    aTarget.add(this);
  }
}

Fixed version (ground truth):
/** 
 * If the user disabled "show all" but a property from an implicit namespace was selected, the property selection is cancelled. In any other case this component is merely updated via AJAX.
 * @param aTarget
 */
private void actionPreferenceChanged(AjaxRequestTarget aTarget){
  if (!preferences.getObject().showAllProperties && selectedProperty.getObject() != null && RdfUtils.isFromImplicitNamespace(selectedProperty.getObject())) {
    send(getPage(),Broadcast.BREADTH,new AjaxPropertySelectionEvent(aTarget,null,true));
  }
 else {
    aTarget.add(this);
  }
}
Program: 63081
Project: 63081
Buggy source:
@Override protected void actionDelete(AjaxRequestTarget aTarget){
  kbService.deleteProperty(kbModel.getObject(),kbObjectModel.getObject());
  kbObjectModel.setObject(null);
  send(getPage(),Broadcast.BREADTH,new AjaxPropertySelectionEvent(aTarget,null));
}

Fixed version (ground truth):
@Override protected void actionDelete(AjaxRequestTarget aTarget){
  kbService.deleteProperty(kbModel.getObject(),kbObjectModel.getObject());
  kbObjectModel.setObject(null);
  send(getPage(),Broadcast.BREADTH,new AjaxPropertySelectionEvent(aTarget,null,true));
}
Program: 63082
Project: 63082
Buggy source:
public AjaxConceptSelectionEvent(AjaxRequestTarget aTarget,KBHandle newSelection){
  super(aTarget,newSelection);
}

Fixed version (ground truth):
public AjaxConceptSelectionEvent(AjaxRequestTarget aTarget,KBHandle newSelection,boolean aRedrawConceptandPropertyListPanels){
  super(aTarget,newSelection);
  redrawConceptandPropertyListPanels=aRedrawConceptandPropertyListPanels;
}