nus-yam/ex-repair huggingface dataset:
Program: 57709
Project: 57709
Buggy source:
/** 
 * Constructor.
 * @param glCanvas
 * @param viewLabel
 * @param viewFrustum
 */
public GLLinearizedPathway(GLCanvas glCanvas,Composite parentComposite,ViewFrustum viewFrustum){
  super(glCanvas,parentComposite,viewFrustum);
  viewType=GLLinearizedPathway.VIEW_TYPE;
  viewLabel="String_Node_Str";
  List<IDataDomain> dataDomains=DataDomainManager.get().getDataDomainsByType("String_Node_Str");
  for (  IDataDomain dataDomain : dataDomains) {
    geneticDataDomains.add((GeneticDataDomain)dataDomain);
  }
  mappedDataRenderer=new MappedDataRenderer(this);
  geneSelectionManager=new EventBasedSelectionManager(this,IDType.getIDType("String_Node_Str"));
  geneSelectionManager.registerEventListeners();
  metaboliteSelectionManager=new EventBasedSelectionManager(this,IDType.getIDType("String_Node_Str"));
  metaboliteSelectionManager.registerEventListeners();
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param glCanvas
 * @param viewLabel
 * @param viewFrustum
 */
public GLLinearizedPathway(GLCanvas glCanvas,Composite parentComposite,ViewFrustum viewFrustum){
  super(glCanvas,parentComposite,viewFrustum);
  viewType=GLLinearizedPathway.VIEW_TYPE;
  viewLabel="String_Node_Str";
  mappedDataRenderer=new MappedDataRenderer(this);
  geneSelectionManager=new EventBasedSelectionManager(this,IDType.getIDType("String_Node_Str"));
  geneSelectionManager.registerEventListeners();
  metaboliteSelectionManager=new EventBasedSelectionManager(this,IDType.getIDType("String_Node_Str"));
  metaboliteSelectionManager.registerEventListeners();
}
Program: 57714
Project: 57714
Buggy source:
private Average getExpressionAverage(PathwayVertexRep vertexRep){
  int davidID=pathwayItemManager.getDavidIdByPathwayVertex((PathwayVertex)vertexRep.getPathwayVertices().get(0));
  if (davidID == -1 || davidID == 0)   return null;
 else {
    Set<Integer> selectedSamples=glPathwayView.getSampleSelectionManager().getElements(SelectionType.SELECTION);
    List<Integer> selectedSamplesArray=new ArrayList<Integer>();
    selectedSamplesArray.addAll(selectedSamples);
    VirtualArray<?,?,?> selectedSamplesVA;
    if (!geneticDataDomain.isGeneRecord())     selectedSamplesVA=new RecordVirtualArray(glPathwayView.getSampleSelectionManager().getIDType(),selectedSamplesArray);
 else     selectedSamplesVA=new DimensionVirtualArray(glPathwayView.getSampleSelectionManager().getIDType(),selectedSamplesArray);
    Set<Integer> expressionIndices=idMappingManager.<Integer,Integer>getIDAsSet(glPathwayView.getPathwayDataDomain().getDavidIDType(),glPathwayView.getGeneSelectionManager().getIDType(),davidID);
    if (expressionIndices == null)     return null;
    for (    Integer expressionIndex : expressionIndices) {
      Average average=ContainerStatistics.calculateAverage(selectedSamplesVA,geneticDataDomain.getTable(),expressionIndex);
      return average;
    }
  }
  return null;
}

Fixed version (ground truth):
private Average getExpressionAverage(PathwayVertexRep vertexRep){
  int davidID=pathwayItemManager.getDavidIdByPathwayVertex((PathwayVertex)vertexRep.getPathwayVertices().get(0));
  if (davidID == -1 || davidID == 0)   return null;
 else {
    Set<Integer> selectedSamples=glPathwayView.getSampleSelectionManager().getElements(SelectionType.SELECTION);
    List<Integer> selectedSamplesArray=new ArrayList<Integer>();
    selectedSamplesArray.addAll(selectedSamples);
    if (selectedSamplesArray.size() == 0) {
      if (!geneticDataDomain.isGeneRecord())       selectedSamplesArray.addAll(glPathwayView.getDataContainer().getRecordPerspective().getVirtualArray().getIDs());
 else       selectedSamplesArray.addAll(glPathwayView.getDataContainer().getDimensionPerspective().getVirtualArray().getIDs());
    }
    VirtualArray<?,?,?> selectedSamplesVA;
    if (!geneticDataDomain.isGeneRecord())     selectedSamplesVA=new RecordVirtualArray(glPathwayView.getSampleSelectionManager().getIDType(),selectedSamplesArray);
 else     selectedSamplesVA=new DimensionVirtualArray(glPathwayView.getSampleSelectionManager().getIDType(),selectedSamplesArray);
    Set<Integer> expressionIndices=idMappingManager.<Integer,Integer>getIDAsSet(glPathwayView.getPathwayDataDomain().getDavidIDType(),glPathwayView.getGeneSelectionManager().getIDType(),davidID);
    if (expressionIndices == null)     return null;
    for (    Integer expressionIndex : expressionIndices) {
      Average average=ContainerStatistics.calculateAverage(selectedSamplesVA,geneticDataDomain.getTable(),expressionIndex);
      return average;
    }
  }
  return null;
}
Program: 57718
Project: 57718
Buggy source:
@Override public void clicked(Pick pick){
  if (allPaths == null || allPaths.size() <= pick.getObjectID())   return;
  selectedPath=allPaths.get(selectedPathID);
  setDisplayListDirty();
  triggerPathUpdate();
}

Fixed version (ground truth):
@Override public void clicked(Pick pick){
  if (allPaths == null || allPaths.size() <= pick.getObjectID())   return;
  if (allPaths.size() <= selectedPathID)   selectedPathID=0;
  selectedPath=allPaths.get(selectedPathID);
  setDisplayListDirty();
  triggerPathUpdate();
}
Program: 57720
Project: 57720
Buggy source:
/** 
 * Returns the IDType for the typeName specified, or null if no such type is registered 
 */
public static IDType getIDType(String typeName){
  IDType requestedType=registeredTypes.get(typeName);
  if (requestedType == null)   throw new IllegalStateException("String_Node_Str" + typeName + "String_Node_Str");
  return requestedType;
}

Fixed version (ground truth):
/** 
 * Returns the IDType for the typeName specified, or null if no such type is registered
 */
public static IDType getIDType(String typeName){
  IDType requestedType=registeredTypes.get(typeName);
  if (requestedType == null)   throw new IllegalStateException("String_Node_Str" + typeName + "String_Node_Str");
  return requestedType;
}
Program: 57721
Project: 57721
Buggy source:
/** 
 * Register a new IDType. Checks whether whether the columnType is legal. If the typeName is already registered, a check is conducted whether the registered and the new one match, and if they do, the previously registered type is returned. Else an exception is thrown.
 * @param typeName see  {@link #typeName}
 * @param idCategory see  {@link #idCategory}
 * @param columnType see  {@link #columnType}
 * @return the created ID Type
 */
public static IDType registerType(String typeName,IDCategory idCategory,EColumnType columnType){
  if (!(columnType == EColumnType.STRING || columnType == EColumnType.INT))   throw new IllegalStateException("String_Node_Str" + columnType);
  IDType idType=registeredTypes.get(typeName);
  if (idType != null) {
    if (!idType.getIDCategory().equals(idCategory) || !idType.getColumnType().equals(columnType))     throw new IllegalStateException("String_Node_Str" + typeName + "String_Node_Str"+ idType+ "String_Node_Str"+ idCategory+ "String_Node_Str"+ columnType);
  }
 else {
    idType=new IDType(typeName,idCategory,columnType);
    registeredTypes.put(typeName,idType);
    Logger.log(new Status(Status.INFO,"String_Node_Str","String_Node_Str" + typeName));
  }
  return idType;
}

Fixed version (ground truth):
/** 
 * Register a new IDType. Checks whether whether the columnType is legal. If the typeName is already registered, a check is conducted whether the registered and the new one match, and if they do, the previously registered type is returned. Else an exception is thrown.
 * @param typeName see  {@link #typeName}
 * @param idCategory see  {@link #idCategory}
 * @param columnType see  {@link #columnType}
 * @return the created ID Type
 */
public static IDType registerType(String typeName,IDCategory idCategory,EColumnType columnType){
  if (!(columnType == EColumnType.STRING || columnType == EColumnType.INT))   throw new IllegalStateException("String_Node_Str" + columnType);
  IDType idType=registeredTypes.get(typeName);
  if (idType != null) {
    if (!idType.getIDCategory().equals(idCategory) || !idType.getColumnType().equals(columnType))     throw new IllegalStateException("String_Node_Str" + typeName + "String_Node_Str"+ idCategory+ "String_Node_Str"+ columnType+ "String_Node_Str"+ "String_Node_Str"+ idType+ "String_Node_Str"+ idType.getIDCategory()+ "String_Node_Str"+ idType.getColumnType());
  }
 else {
    idType=new IDType(typeName,idCategory,columnType);
    registeredTypes.put(typeName,idType);
    Logger.log(new Status(Status.INFO,"String_Node_Str","String_Node_Str" + typeName));
  }
  return idType;
}
Program: 57723
Project: 57723
Buggy source:
@Override public Object start(IApplicationContext context) throws Exception {
  String[] runConfigParameters=(String[])context.getArguments().get("String_Node_Str");
  String outputCaleydoProjectFilePath="String_Node_Str";
  if (runConfigParameters == null || runConfigParameters.length != 2) {
    dataSetDescriptionFilePath=System.getProperty("String_Node_Str") + System.getProperty("String_Node_Str") + "String_Node_Str";
    outputCaleydoProjectFilePath=System.getProperty("String_Node_Str") + System.getProperty("String_Node_Str") + "String_Node_Str"+ (new SimpleDateFormat("String_Node_Str").format(new Date()))+ "String_Node_Str";
  }
 else {
    outputCaleydoProjectFilePath=runConfigParameters[0];
    dataSetDescriptionFilePath=runConfigParameters[1];
  }
  GeneralManager.get().init();
  GeneralManager.get().getBasicInfo().setOrganism(Organism.MUS_MUSCULUS);
  createJAXBContext();
  DataSetDescriptionCollection dataSetMetInfoCollection=deserialzeDataSetMetaInfo();
  for (  DataSetDescription dataTypeSet : dataSetMetInfoCollection.getDataSetDescriptionCollection())   loadSources(dataTypeSet);
  new ProjectSaver().save(outputCaleydoProjectFilePath,true);
  return IApplication.EXIT_OK;
}

Fixed version (ground truth):
@Override public Object start(IApplicationContext context) throws Exception {
  String[] runConfigParameters=(String[])context.getArguments().get("String_Node_Str");
  String outputCaleydoProjectFilePath="String_Node_Str";
  if (runConfigParameters == null || runConfigParameters.length != 2) {
    dataSetDescriptionFilePath=System.getProperty("String_Node_Str") + System.getProperty("String_Node_Str") + "String_Node_Str";
    outputCaleydoProjectFilePath=System.getProperty("String_Node_Str") + System.getProperty("String_Node_Str") + "String_Node_Str"+ (new SimpleDateFormat("String_Node_Str").format(new Date()))+ "String_Node_Str";
  }
 else {
    outputCaleydoProjectFilePath=runConfigParameters[0];
    dataSetDescriptionFilePath=runConfigParameters[1];
  }
  GeneralManager.get().init();
  createJAXBContext();
  DataSetDescriptionCollection dataSetMetInfoCollection=deserialzeDataSetMetaInfo();
  for (  DataSetDescription dataTypeSet : dataSetMetInfoCollection.getDataSetDescriptionCollection())   loadSources(dataTypeSet);
  new ProjectSaver().save(outputCaleydoProjectFilePath,true);
  return IApplication.EXIT_OK;
}
Program: 57724
Project: 57724
Buggy source:
private void loadSources(DataSetDescription dataSetDescription) throws FileNotFoundException, IOException {
  ATableBasedDataDomain dataDomain=loadData(dataSetDescription);
  loadGroupings(dataDomain,dataSetDescription);
  createSampleOfGenes(dataDomain,runClusteringOnDimensions(dataDomain,true,5).getDimensionResult());
  runClusteringOnDimensions(dataDomain,true,6);
  runClusteringOnRecords(dataDomain,true,6);
}

Fixed version (ground truth):
private void loadSources(DataSetDescription dataSetDescription) throws FileNotFoundException, IOException {
  ATableBasedDataDomain dataDomain=loadData(dataSetDescription);
  loadGroupings(dataDomain,dataSetDescription);
}
Program: 57725
Project: 57725
Buggy source:
private void overlayBubbleSets(GL2 gl){
  if (allPaths == null)   return;
  updateBubbleSetsTexture(gl);
  isBubbleTextureDirty=false;
  float textureWidth=PathwayRenderStyle.SCALING_FACTOR_X * pathway.getWidth();
  float textureHeight=PathwayRenderStyle.SCALING_FACTOR_Y * pathway.getHeight();
  Texture tex=texRenderer.getTexture();
  gl.glEnable(GL2.GL_BLEND);
  gl.glBlendFunc(GL2.GL_ONE,GL2.GL_ONE_MINUS_SRC_ALPHA);
  tex.enable();
  tex.bind();
  gl.glBegin(GL2.GL_QUADS);
  gl.glTexCoord2f(0,1);
  gl.glVertex3f(0.0f,0.0f,0.0f);
  gl.glTexCoord2f(1,1);
  gl.glVertex3f(textureWidth,0.0f,0.0f);
  gl.glTexCoord2f(1,0);
  gl.glVertex3f(textureWidth,textureHeight,0.0f);
  gl.glTexCoord2f(0,0);
  gl.glVertex3f(0.0f,textureHeight,0.0f);
  gl.glEnd();
  tex.disable();
}

Fixed version (ground truth):
private void overlayBubbleSets(GL2 gl){
  if (allPaths == null)   return;
  texRenderer.setColor(1.0f,1.0f,1.0f,0.75f);
  if (isBubbleTextureDirty) {
    updateBubbleSetsTexture(gl);
    isBubbleTextureDirty=false;
  }
  bubbleSetsTexture=texRenderer.getTexture();
  float textureWidth=PathwayRenderStyle.SCALING_FACTOR_X * pathway.getWidth();
  float textureHeight=PathwayRenderStyle.SCALING_FACTOR_Y * pathway.getHeight();
  gl.glEnable(GL2.GL_BLEND);
  gl.glBlendFunc(GL2.GL_ONE,GL2.GL_ONE_MINUS_SRC_ALPHA);
  bubbleSetsTexture.enable();
  bubbleSetsTexture.bind();
  gl.glBegin(GL2.GL_QUADS);
  gl.glTexCoord2f(0,1);
  gl.glVertex3f(0.0f,0.0f,0.0f);
  gl.glTexCoord2f(1,1);
  gl.glVertex3f(textureWidth,0.0f,0.0f);
  gl.glTexCoord2f(1,0);
  gl.glVertex3f(textureWidth,textureHeight,0.0f);
  gl.glTexCoord2f(0,0);
  gl.glVertex3f(0.0f,textureHeight,0.0f);
  gl.glEnd();
  bubbleSetsTexture.disable();
}
Program: 57727
Project: 57727
Buggy source:
@Override public void initLocal(final GL2 gl){
  init(gl);
  texRenderer=new TextureRenderer(1280,768,true);
  texRenderer.setColor(1.0f,1.0f,1.0f,0.75f);
}

Fixed version (ground truth):
@Override public void initLocal(final GL2 gl){
  init(gl);
  texRenderer=new TextureRenderer(1280,768,true);
}
Program: 57728
Project: 57728
Buggy source:
@Override public void destroyHandler(){
  super.destroyHandler();
  hashKgmlEntryIdToVertexRep.clear();
  hashKgmlNameToVertexRep.clear();
  hashKgmlReactionNameToVertexRep.clear();
}

Fixed version (ground truth):
@Override public void destroyHandler(){
  super.destroyHandler();
  hashKgmlEntryIdToVertexRep.clear();
  hashKgmlReactionNameToVertexRep.clear();
}
Program: 57730
Project: 57730
Buggy source:
/** 
 * Reacts on the elements of the reaction product tag. An example reaction product tag looks like this: <product name="cpd:C02291"/>
 */
protected void handleReactionProductTag(){
  String reactionProductName="String_Node_Str";
  for (int attributeIndex=0; attributeIndex < attributes.getLength(); attributeIndex++) {
    attributeName=attributes.getLocalName(attributeIndex);
    if ("String_Node_Str".equals(attributeName)) {
      attributeName=attributes.getQName(attributeIndex);
    }
    if (attributeName.equals("String_Node_Str")) {
      reactionProductName=attributes.getValue(attributeIndex);
    }
  }
  PathwayVertexRep sourceVertexRep=hashKgmlReactionNameToVertexRep.get(currentReactionName);
  PathwayVertexRep targetVertexRep=hashKgmlNameToVertexRep.get(reactionProductName);
  if (currentPathway.getEdge(sourceVertexRep,targetVertexRep) != null && sourceVertexRep.getType().equals(EPathwayVertexType.group))   return;
  PathwayReactionEdgeRep pathwayReactionEdgeRep=new PathwayReactionEdgeRep(currentReactionType);
  try {
    currentPathway.addEdge(sourceVertexRep,targetVertexRep,pathwayReactionEdgeRep);
    if (currentReactionType == EPathwayReactionEdgeType.reversible) {
      pathwayReactionEdgeRep=new PathwayReactionEdgeRep(currentReactionType);
      currentPathway.addEdge(targetVertexRep,sourceVertexRep,pathwayReactionEdgeRep);
    }
  }
 catch (  Exception e) {
  }
}

Fixed version (ground truth):
/** 
 * Reacts on the elements of the reaction product tag. An example reaction product tag looks like this: <product name="cpd:C02291"/>
 */
protected void handleReactionProductTag(){
  Integer reactionProductID=-1;
  for (int attributeIndex=0; attributeIndex < attributes.getLength(); attributeIndex++) {
    attributeName=attributes.getLocalName(attributeIndex);
    if ("String_Node_Str".equals(attributeName)) {
      attributeName=attributes.getQName(attributeIndex);
    }
    if (attributeName.equals("String_Node_Str")) {
      reactionProductID=Integer.valueOf(attributes.getValue(attributeIndex));
    }
  }
  PathwayVertexRep sourceVertexRep=hashKgmlReactionNameToVertexRep.get(currentReactionName);
  PathwayVertexRep targetVertexRep=hashKgmlEntryIdToVertexRep.get(reactionProductID);
  if (currentPathway.getEdge(sourceVertexRep,targetVertexRep) != null && sourceVertexRep.getType().equals(EPathwayVertexType.group))   return;
  PathwayReactionEdgeRep pathwayReactionEdgeRep=new PathwayReactionEdgeRep(currentReactionType);
  try {
    currentPathway.addEdge(sourceVertexRep,targetVertexRep,pathwayReactionEdgeRep);
    if (currentReactionType == EPathwayReactionEdgeType.reversible) {
      pathwayReactionEdgeRep=new PathwayReactionEdgeRep(currentReactionType);
      currentPathway.addEdge(targetVertexRep,sourceVertexRep,pathwayReactionEdgeRep);
    }
  }
 catch (  Exception e) {
  }
}
Program: 57731
Project: 57731
Buggy source:
/** 
 * Reacts on the elements of the reaction substrate tag. An example reaction substrate tag looks like this: <substrate name="cpd:C01118"/>
 */
protected void handleReactionSubstrateTag(){
  String reactionSubstrateName="String_Node_Str";
  for (int attributeIndex=0; attributeIndex < attributes.getLength(); attributeIndex++) {
    attributeName=attributes.getLocalName(attributeIndex);
    if ("String_Node_Str".equals(attributeName)) {
      attributeName=attributes.getQName(attributeIndex);
    }
    if (attributeName.equals("String_Node_Str")) {
      reactionSubstrateName=attributes.getValue(attributeIndex);
    }
  }
  PathwayVertexRep sourceVertexRep=hashKgmlNameToVertexRep.get(reactionSubstrateName);
  PathwayVertexRep targetVertexRep=hashKgmlReactionNameToVertexRep.get(currentReactionName);
  if (currentPathway.getEdge(sourceVertexRep,targetVertexRep) != null && targetVertexRep.getType().equals(EPathwayVertexType.group))   return;
  PathwayReactionEdgeRep pathwayReactionEdgeRep=new PathwayReactionEdgeRep(currentReactionType);
  try {
    currentPathway.addEdge(sourceVertexRep,targetVertexRep,pathwayReactionEdgeRep);
    if (currentReactionType == EPathwayReactionEdgeType.reversible) {
      pathwayReactionEdgeRep=new PathwayReactionEdgeRep(currentReactionType);
      currentPathway.addEdge(targetVertexRep,sourceVertexRep,pathwayReactionEdgeRep);
    }
  }
 catch (  Exception e) {
  }
}

Fixed version (ground truth):
/** 
 * Reacts on the elements of the reaction substrate tag. An example reaction substrate tag looks like this: <substrate name="cpd:C01118"/>
 */
protected void handleReactionSubstrateTag(){
  Integer reactionSubstrateID=-1;
  for (int attributeIndex=0; attributeIndex < attributes.getLength(); attributeIndex++) {
    attributeName=attributes.getLocalName(attributeIndex);
    if ("String_Node_Str".equals(attributeName)) {
      attributeName=attributes.getQName(attributeIndex);
    }
    if (attributeName.equals("String_Node_Str")) {
      reactionSubstrateID=Integer.valueOf(attributes.getValue(attributeIndex));
    }
  }
  PathwayVertexRep sourceVertexRep=hashKgmlEntryIdToVertexRep.get(reactionSubstrateID);
  PathwayVertexRep targetVertexRep=hashKgmlReactionNameToVertexRep.get(currentReactionName);
  if (currentPathway.getEdge(sourceVertexRep,targetVertexRep) != null && targetVertexRep.getType().equals(EPathwayVertexType.group))   return;
  PathwayReactionEdgeRep pathwayReactionEdgeRep=new PathwayReactionEdgeRep(currentReactionType);
  try {
    currentPathway.addEdge(sourceVertexRep,targetVertexRep,pathwayReactionEdgeRep);
    if (currentReactionType == EPathwayReactionEdgeType.reversible) {
      pathwayReactionEdgeRep=new PathwayReactionEdgeRep(currentReactionType);
      currentPathway.addEdge(targetVertexRep,sourceVertexRep,pathwayReactionEdgeRep);
    }
  }
 catch (  Exception e) {
  }
}
Program: 57733
Project: 57733
Buggy source:
@Override public void render(GL2 gl){
  pushNames(gl);
  gl.glColor4fv(color,0);
  gl.glBegin(GL2.GL_QUADS);
  gl.glVertex3f(0,0,0);
  gl.glVertex3f(x,0,0);
  gl.glVertex3f(x,y,0);
  gl.glVertex3f(0,y,0);
  gl.glEnd();
  gl.glPushAttrib(GL2.GL_LINE_BIT);
  gl.glLineWidth(borderWidth);
  gl.glColor4fv(borderColor,0);
  gl.glBegin(GL2.GL_LINES);
  gl.glVertex3f(0,0,0);
  gl.glVertex3f(x,0,0);
  gl.glVertex3f(0,0,0);
  gl.glVertex3f(0,y,0);
  gl.glVertex3f(0,y,0);
  gl.glVertex3f(x,y,0);
  gl.glVertex3f(x,0,0);
  gl.glVertex3f(x,y,0);
  gl.glEnd();
  gl.glPopAttrib();
  popNames(gl);
}

Fixed version (ground truth):
@Override public void render(GL2 gl){
  pushNames(gl);
  gl.glColor4fv(colorProvider == null ? color : colorProvider.getColor(),0);
  gl.glBegin(GL2.GL_QUADS);
  gl.glVertex3f(0,0,0);
  gl.glVertex3f(x,0,0);
  gl.glVertex3f(x,y,0);
  gl.glVertex3f(0,y,0);
  gl.glEnd();
  gl.glPushAttrib(GL2.GL_LINE_BIT);
  gl.glLineWidth(borderWidth);
  gl.glColor4fv(borderColor,0);
  gl.glBegin(GL2.GL_LINES);
  gl.glVertex3f(0,0,0);
  gl.glVertex3f(x,0,0);
  gl.glVertex3f(0,0,0);
  gl.glVertex3f(0,y,0);
  gl.glVertex3f(0,y,0);
  gl.glVertex3f(x,y,0);
  gl.glVertex3f(x,0,0);
  gl.glVertex3f(x,y,0);
  gl.glEnd();
  gl.glPopAttrib();
  popNames(gl);
}
Program: 57734
Project: 57734
Buggy source:
/** 
 * Constructor.
 * @param color Color of the rendered rectangle. The array must have a length of 4 specifying the RGBA values of the color.
 * @param borderColor Color of the rendered rectangle's border. The array must have a length of 4 specifying the RGBA values of the color.
 * @param borderWidth Width of the rendered rectangle's border.
 */
public ColorRenderer(float[] color,float[] borderColor,int borderWidth){
  this.color=color;
  this.borderColor=borderColor;
  this.borderWidth=borderWidth;
  drawBorder=true;
}

Fixed version (ground truth):
public ColorRenderer(IColorProvider colorProvider){
  this.colorProvider=colorProvider;
}
Program: 57735
Project: 57735
Buggy source:
@Override public void unregisterEventListeners(){
  super.unregisterEventListeners();
  if (linearizePathwayPathEventListener != null) {
    eventPublisher.removeListener(linearizePathwayPathEventListener);
    linearizePathwayPathEventListener=null;
  }
  if (addDataContainersListener != null) {
    eventPublisher.removeListener(addDataContainersListener);
    addDataContainersListener=null;
  }
  if (removeLinearizedNodeEventListener != null) {
    eventPublisher.removeListener(removeLinearizedNodeEventListener);
    removeLinearizedNodeEventListener=null;
  }
}

Fixed version (ground truth):
@Override public void unregisterEventListeners(){
  super.unregisterEventListeners();
  if (linearizePathwayPathEventListener != null) {
    eventPublisher.removeListener(linearizePathwayPathEventListener);
    linearizePathwayPathEventListener=null;
  }
  if (addDataContainersListener != null) {
    eventPublisher.removeListener(addDataContainersListener);
    addDataContainersListener=null;
  }
  if (removeLinearizedNodeEventListener != null) {
    eventPublisher.removeListener(removeLinearizedNodeEventListener);
    removeLinearizedNodeEventListener=null;
  }
  geneSelectionManager.unregisterEventListeners();
}
Program: 57737
Project: 57737
Buggy source:
/** 
 * Constructor.
 * @param glCanvas
 * @param viewLabel
 * @param viewFrustum
 */
public GLLinearizedPathway(GLCanvas glCanvas,Composite parentComposite,ViewFrustum viewFrustum){
  super(glCanvas,parentComposite,viewFrustum);
  viewType=GLLinearizedPathway.VIEW_TYPE;
  viewLabel="String_Node_Str";
  List<IDataDomain> dataDomains=DataDomainManager.get().getDataDomainsByType("String_Node_Str");
  for (  IDataDomain dataDomain : dataDomains) {
    geneticDataDomains.add((GeneticDataDomain)dataDomain);
  }
  mappedDataRenderer=new MappedDataRenderer(this);
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param glCanvas
 * @param viewLabel
 * @param viewFrustum
 */
public GLLinearizedPathway(GLCanvas glCanvas,Composite parentComposite,ViewFrustum viewFrustum){
  super(glCanvas,parentComposite,viewFrustum);
  viewType=GLLinearizedPathway.VIEW_TYPE;
  viewLabel="String_Node_Str";
  List<IDataDomain> dataDomains=DataDomainManager.get().getDataDomainsByType("String_Node_Str");
  for (  IDataDomain dataDomain : dataDomains) {
    geneticDataDomains.add((GeneticDataDomain)dataDomain);
  }
  mappedDataRenderer=new MappedDataRenderer(this);
  geneSelectionManager=new EventBasedSelectionManager(this,IDType.getIDType("String_Node_Str"));
  geneSelectionManager.registerEventListeners();
}
Program: 57740
Project: 57740
Buggy source:
@Override public void mouseOut(Pick pick){
  sampleGroupSelectionManager.removeFromType(SelectionType.MOUSE_OVER,pick.getObjectID());
  parentView.setDisplayListDirty();
}

Fixed version (ground truth):
@Override public void mouseOut(Pick pick){
  sampleGroupSelectionManager.removeFromType(SelectionType.MOUSE_OVER,pick.getObjectID());
  sampleSelectionManager.triggerSelectionUpdateEvent();
  parentView.setDisplayListDirty();
}
Program: 57743
Project: 57743
Buggy source:
public void handleOpenVendingMachineEvent(IDataDomain dataDomain){
  ATableBasedDataDomain tableBasedDataDomain=(ATableBasedDataDomain)dataDomain;
  DataContainer dataContainer=tableBasedDataDomain.getDataContainer(tableBasedDataDomain.getTable().getDefaultRecordPerspective().getID(),tableBasedDataDomain.getTable().getDefaultDimensionPerspective().getID());
  List<DataContainer> dataContainerWrapper=new ArrayList<DataContainer>();
  dataContainerWrapper.add(dataContainer);
  addDimensionGroups(dataContainerWrapper,null);
  visBricks.addDimensionGroups(dataContainerWrapper,null);
  vendingMachine.setDataContainer(dataContainer);
}

Fixed version (ground truth):
public void handleOpenVendingMachineEvent(IDataDomain dataDomain){
  ATableBasedDataDomain tableBasedDataDomain=(ATableBasedDataDomain)dataDomain;
  DataContainer dataContainer=tableBasedDataDomain.getDataContainer(tableBasedDataDomain.getTable().getDefaultRecordPerspective().getID(),tableBasedDataDomain.getTable().getDefaultDimensionPerspective().getID());
  List<DataContainer> dataContainerWrapper=new ArrayList<DataContainer>();
  dataContainerWrapper.add(dataContainer);
  addDimensionGroups(dataContainerWrapper,null);
  visBricks.addDataContainers(dataContainerWrapper,null);
  vendingMachine.setDataContainer(dataContainer);
}
Program: 57744
Project: 57744
Buggy source:
public void addDimensionGroups(List<DataContainer> dataContainers,IBrickConfigurer dataConfigurer){
  visBricks.addDimensionGroups(dataContainers,dataConfigurer);
  for (  DimensionGroup dimGroup : visBricks.getDimensionGroupManager().getDimensionGroups()) {
    if (dataContainers.get(0) == dimGroup.getDataContainer()) {
      detailDimensionGroup=dimGroup;
      detailDimensionGroup.showDetailedBrick(vendingMachine,false);
      break;
    }
  }
  layoutManager.updateLayout();
}

Fixed version (ground truth):
public void addDimensionGroups(List<DataContainer> dataContainers,IBrickConfigurer dataConfigurer){
  visBricks.addDataContainers(dataContainers,dataConfigurer);
  for (  DimensionGroup dimGroup : visBricks.getDimensionGroupManager().getDimensionGroups()) {
    if (dataContainers.get(0) == dimGroup.getDataContainer()) {
      detailDimensionGroup=dimGroup;
      detailDimensionGroup.showDetailedBrick(vendingMachine,false);
      break;
    }
  }
  layoutManager.updateLayout();
}
Program: 57745
Project: 57745
Buggy source:
private boolean isComplexNode(List<PathwayVertexRep> vertexReps){
  for (  PathwayVertexRep vertexRep : vertexReps) {
    for (    PathwayVertexRep vRep : vertexReps) {
      if (vertexRep != vRep) {
        Set<DefaultEdge> edges1=pathway.edgesOf(vertexRep);
        Set<DefaultEdge> edges2=pathway.edgesOf(vRep);
        List<PathwayVertexRep> edgeSources1=new ArrayList<PathwayVertexRep>();
        List<PathwayVertexRep> edgeTargets1=new ArrayList<PathwayVertexRep>();
        for (        DefaultEdge edge : edges1) {
          PathwayVertexRep target=pathway.getEdgeTarget(edge);
          if (target == vertexRep) {
            edgeSources1.add(pathway.getEdgeSource(edge));
          }
 else {
            edgeTargets1.add(target);
          }
        }
        List<PathwayVertexRep> edgeSources2=new ArrayList<PathwayVertexRep>();
        List<PathwayVertexRep> edgeTargets2=new ArrayList<PathwayVertexRep>();
        for (        DefaultEdge edge : edges2) {
          PathwayVertexRep target=pathway.getEdgeTarget(edge);
          if (target == vertexRep) {
            edgeSources2.add(pathway.getEdgeSource(edge));
          }
 else {
            edgeTargets2.add(target);
          }
        }
        if ((edgeSources1.size() != edgeSources2.size()) || (edgeTargets1.size() != edgeTargets2.size()) || !(edgeTargets1.containsAll(edgeTargets2))|| !(edgeSources1.containsAll(edgeSources2))) {
          return false;
        }
      }
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Determines whether the specified list of   {@link PathwayVertexRep}s represents one complex node.
 * @param vertexReps
 * @return
 */
private boolean isComplexNode(List<PathwayVertexRep> vertexReps){
  for (  PathwayVertexRep vertexRep : vertexReps) {
    for (    PathwayVertexRep vRep : vertexReps) {
      if (vertexRep != vRep) {
        List<PathwayVertexRep> edgeSources1=new ArrayList<PathwayVertexRep>();
        List<PathwayVertexRep> edgeTargets1=new ArrayList<PathwayVertexRep>();
        List<PathwayVertexRep> edgeSources2=new ArrayList<PathwayVertexRep>();
        List<PathwayVertexRep> edgeTargets2=new ArrayList<PathwayVertexRep>();
        getEdgeEnds(edgeSources1,edgeTargets1,vertexRep);
        getEdgeEnds(edgeSources2,edgeTargets2,vRep);
        if ((edgeSources1.size() != edgeSources2.size()) || (edgeTargets1.size() != edgeTargets2.size()) || !(edgeTargets1.containsAll(edgeTargets2))|| !(edgeSources1.containsAll(edgeSources2))) {
          return false;
        }
      }
    }
  }
  return true;
}
Program: 57746
Project: 57746
Buggy source:
private List<ComplexNode> createComplexBranchNodes(List<PathwayVertexRep> vertexReps){
  List<ComplexNode> complexNodes=new ArrayList<ComplexNode>();
  for (  PathwayVertexRep vertexRep : vertexReps) {
    ComplexNode complexNode=null;
    for (    PathwayVertexRep vRep : vertexReps) {
      if (vertexRep != vRep) {
        Set<DefaultEdge> edges1=pathway.edgesOf(vertexRep);
        Set<DefaultEdge> edges2=pathway.edgesOf(vRep);
        if ((edges1.containsAll(edges2)) && (edges1.size() == edges2.size())) {
          if (complexNode == null) {
            complexNode=new ComplexNode(pixelGLConverter,textRenderer,this,lastNodeId++);
            complexNode.addVertexRep(vertexRep);
            complexNodes.add(complexNode);
          }
          complexNode.addVertexRep(vRep);
        }
      }
    }
  }
  return complexNodes;
}

Fixed version (ground truth):
/** 
 * Determines the   {@link ComplexNode}s for the specified  {@link PathwayVertexRep}s.
 * @param vertexReps
 * @return
 */
private List<ComplexNode> createComplexBranchNodes(List<PathwayVertexRep> vertexReps){
  List<PathwayVertexRep> vertexRepsLeft=new ArrayList<PathwayVertexRep>(vertexReps);
  List<ComplexNode> complexNodes=new ArrayList<ComplexNode>();
  while (vertexRepsLeft.size() > 0) {
    PathwayVertexRep vertexRep=vertexRepsLeft.get(0);
    ComplexNode complexNode=null;
    for (    PathwayVertexRep vRep : vertexRepsLeft) {
      if (vertexRep != vRep) {
        List<PathwayVertexRep> edgeSources1=new ArrayList<PathwayVertexRep>();
        List<PathwayVertexRep> edgeTargets1=new ArrayList<PathwayVertexRep>();
        List<PathwayVertexRep> edgeSources2=new ArrayList<PathwayVertexRep>();
        List<PathwayVertexRep> edgeTargets2=new ArrayList<PathwayVertexRep>();
        getEdgeEnds(edgeSources1,edgeTargets1,vertexRep);
        getEdgeEnds(edgeSources2,edgeTargets2,vRep);
        if ((edgeSources1.size() == edgeSources2.size()) && (edgeTargets1.size() == edgeTargets2.size()) && (edgeTargets1.containsAll(edgeTargets2))&& (edgeSources1.containsAll(edgeSources2))) {
          if (complexNode == null) {
            complexNode=new ComplexNode(pixelGLConverter,textRenderer,this,lastNodeId++);
            complexNode.addVertexRep(vertexRep);
            complexNodes.add(complexNode);
          }
          complexNode.addVertexRep(vRep);
        }
      }
    }
    if (complexNode == null)     break;
    for (    PathwayVertexRep vRep : complexNode.getVertexReps()) {
      vertexRepsLeft.remove(vRep);
    }
  }
  return complexNodes;
}
Program: 57747
Project: 57747
Buggy source:
public PathwayRelationEdgeRep(final String relationType){
  this.relationType=EPathwayRelationEdgeType.valueOf(relationType);
}

Fixed version (ground truth):
public PathwayRelationEdgeRep(final EPathwayRelationEdgeType relationType){
  this.relationType=relationType;
}
Program: 57748
Project: 57748
Buggy source:
private void renderPathway(final GL2 gl,final PathwayGraph pathway){
  gl.glPushMatrix();
  gl.glTranslatef(vecTranslation.x(),vecTranslation.y(),vecTranslation.z());
  gl.glScalef(vecScaling.x(),vecScaling.y(),vecScaling.z());
  if (bEnablePathwayTexture) {
    float fPathwayTransparency=1.0f;
    hashGLcontext2TextureManager.get(gl).renderPathway(gl,this,pathway,fPathwayTransparency,false);
  }
  float tmp=PathwayRenderStyle.SCALING_FACTOR_Y * pathway.getHeight();
  gl.glTranslatef(0,tmp,0);
  gLPathwayContentCreator.renderPathway(gl,pathway,false);
  renderSelectedPath(gl);
  gl.glTranslatef(0,-tmp,0);
  gl.glScalef(1 / vecScaling.x(),1 / vecScaling.y(),1 / vecScaling.z());
  gl.glTranslatef(-vecTranslation.x(),-vecTranslation.y(),-vecTranslation.z());
  gl.glPopMatrix();
}

Fixed version (ground truth):
private void renderPathway(final GL2 gl,final PathwayGraph pathway){
  gl.glPushMatrix();
  gl.glTranslatef(vecTranslation.x(),vecTranslation.y(),vecTranslation.z());
  gl.glScalef(vecScaling.x(),vecScaling.y(),vecScaling.z());
  if (enablePathwayTexture) {
    float fPathwayTransparency=1.0f;
    hashGLcontext2TextureManager.get(gl).renderPathway(gl,this,pathway,fPathwayTransparency,false);
  }
  float tmp=PathwayRenderStyle.SCALING_FACTOR_Y * pathway.getHeight();
  gl.glTranslatef(0,tmp,0);
  gLPathwayContentCreator.renderPathway(gl,pathway,false);
  renderSelectedPath(gl);
  gl.glTranslatef(0,-tmp,0);
  gl.glScalef(1 / vecScaling.x(),1 / vecScaling.y(),1 / vecScaling.z());
  gl.glTranslatef(-vecTranslation.x(),-vecTranslation.y(),-vecTranslation.z());
  gl.glPopMatrix();
}
Program: 57749
Project: 57749
Buggy source:
public void enablePathwayTextures(final boolean bEnablePathwayTexture){
  gLPathwayContentCreator.enableEdgeRendering(!bEnablePathwayTexture);
  setDisplayListDirty();
  this.bEnablePathwayTexture=bEnablePathwayTexture;
}

Fixed version (ground truth):
public void enablePathwayTextures(final boolean bEnablePathwayTexture){
  gLPathwayContentCreator.enableEdgeRendering(!bEnablePathwayTexture);
  setDisplayListDirty();
  this.enablePathwayTexture=bEnablePathwayTexture;
}
Program: 57750
Project: 57750
Buggy source:
protected void initPathwayData(final GL2 gl){
  gLPathwayContentCreator.init(gl,geneSelectionManager);
  if (!hashGLcontext2TextureManager.containsKey(gl)) {
    hashGLcontext2TextureManager.put(gl,new GLPathwayTextureManager());
  }
  calculatePathwayScaling(gl,pathway);
  pathwayManager.setPathwayVisibilityState(pathway,true);
}

Fixed version (ground truth):
protected void initPathwayData(final GL2 gl){
  isPathwayDataDirty=false;
  geneSelectionManager.clearSelections();
  selectedPath=null;
  gLPathwayContentCreator.init(gl,geneSelectionManager);
  if (!hashGLcontext2TextureManager.containsKey(gl)) {
    hashGLcontext2TextureManager.put(gl,new GLPathwayTextureManager());
  }
  calculatePathwayScaling(gl,pathway);
  pathwayManager.setPathwayVisibilityState(pathway,true);
}
Program: 57751
Project: 57751
Buggy source:
@Override public void displayLocal(final GL2 gl){
  if (pathway == null || !pathwayManager.hasItem(pathway.getID()))   return;
  initPathwayData(gl);
  pickingManager.handlePicking(this,gl);
  if (isDisplayListDirty) {
    rebuildPathwayDisplayList(gl,displayListIndex);
    isDisplayListDirty=false;
  }
  display(gl);
}

Fixed version (ground truth):
@Override public void displayLocal(final GL2 gl){
  if (pathway == null || !pathwayManager.hasItem(pathway.getID()))   return;
  if (isPathwayDataDirty)   initPathwayData(gl);
  pickingManager.handlePicking(this,gl);
  if (isDisplayListDirty) {
    rebuildPathwayDisplayList(gl,displayListIndex);
    isDisplayListDirty=false;
  }
  display(gl);
}
Program: 57752
Project: 57752
Buggy source:
/** 
 * Constructor.
 * @param color Color of the rendered rectangle. The array must have alength of 4 specifying the RGBA values of the color.
 * @param imagePath Path to the image that shall be used as texture.
 * @param textureManager
 */
public ViewNodeBackGroundRenderer(float[] color,String imagePath,TextureManager textureManager){
  this.color=color;
  this.imagePath=imagePath;
  this.textureManager=textureManager;
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param color Color of the rendered rectangle. The array must have a length of 4 specifying the RGBA values of the color.
 * @param imagePath Path to the image that shall be used as texture.
 * @param textureManager
 */
public ViewNodeBackGroundRenderer(float[] color,String imagePath,TextureManager textureManager){
  this.color=color;
  this.imagePath=imagePath;
  this.textureManager=textureManager;
}
Program: 57753
Project: 57753
Buggy source:
@Override public void render(GL2 gl){
  gl.glColor4fv(color,0);
  gl.glBegin(GL2.GL_QUADS);
  gl.glVertex3f(0,0,0);
  gl.glVertex3f(x,0,0);
  gl.glVertex3f(x,y,0);
  gl.glVertex3f(0,y,0);
  gl.glEnd();
  float textureSize=Math.min(x,y);
  float posX=x / 2.0f - textureSize / 2.0f;
  float posY=y / 2.0f - textureSize / 2.0f;
  Vec3f lowerLeftCorner=new Vec3f(posX,posY,0);
  Vec3f lowerRightCorner=new Vec3f(posX + textureSize,posY,0);
  Vec3f upperRightCorner=new Vec3f(posX + textureSize,posY + textureSize,0);
  Vec3f upperLeftCorner=new Vec3f(posX,posY + textureSize,0);
  textureManager.renderTexture(gl,imagePath,lowerLeftCorner,lowerRightCorner,upperRightCorner,upperLeftCorner,color[0],color[1],color[2],0.5f);
}

Fixed version (ground truth):
@Override public void render(GL2 gl){
  gl.glColor4fv(color,0);
  gl.glBegin(GL2.GL_QUADS);
  gl.glVertex3f(0,0,0);
  gl.glVertex3f(x,0,0);
  gl.glVertex3f(x,y,0);
  gl.glVertex3f(0,y,0);
  gl.glEnd();
  if (imagePath != null) {
    float textureSize=Math.min(x,y);
    float posX=x / 2.0f - textureSize / 2.0f;
    float posY=y / 2.0f - textureSize / 2.0f;
    Vec3f lowerLeftCorner=new Vec3f(posX,posY,0);
    Vec3f lowerRightCorner=new Vec3f(posX + textureSize,posY,0);
    Vec3f upperRightCorner=new Vec3f(posX + textureSize,posY + textureSize,0);
    Vec3f upperLeftCorner=new Vec3f(posX,posY + textureSize,0);
    textureManager.renderTexture(gl,imagePath,lowerLeftCorner,lowerRightCorner,upperRightCorner,upperLeftCorner,color[0],color[1],color[2],0.5f);
  }
}
Program: 57754
Project: 57754
Buggy source:
public ViewNode createViewNode(AGraphLayout graphLayout,GLDataViewIntegrator view,DragAndDropController dragAndDropController,int id,AGLView representedView){
  Class<? extends ViewNode> nodeClass=viewNodeClasses.get(representedView.getClass());
  if (nodeClass == null) {
    for (    Class<? extends AGLView> c : viewNodeClasses.keySet()) {
      if (c.isAssignableFrom(representedView.getClass())) {
        nodeClass=viewNodeClasses.get(c);
        break;
      }
    }
  }
  if (nodeClass != null) {
    try {
      ViewNode node=nodeClass.getConstructor(AGraphLayout.class,view.getClass(),dragAndDropController.getClass(),Integer.class,AGLView.class).newInstance(graphLayout,view,dragAndDropController,id,representedView);
      node.init();
      return node;
    }
 catch (    Exception e) {
      Logger.log(new Status(Status.ERROR,this.toString(),"String_Node_Str",e));
    }
  }
  return null;
}

Fixed version (ground truth):
public ViewNode createViewNode(AGraphLayout graphLayout,GLDataViewIntegrator view,DragAndDropController dragAndDropController,int id,AGLView representedView){
  Class<? extends ViewNode> nodeClass=viewNodeClasses.get(representedView.getClass());
  if (nodeClass == null) {
    for (    Class<? extends IDataContainerBasedView> c : viewNodeClasses.keySet()) {
      if (c.isAssignableFrom(representedView.getClass())) {
        nodeClass=viewNodeClasses.get(c);
        break;
      }
    }
  }
  if (nodeClass != null) {
    try {
      ViewNode node=nodeClass.getConstructor(AGraphLayout.class,view.getClass(),dragAndDropController.getClass(),Integer.class,AGLView.class).newInstance(graphLayout,view,dragAndDropController,id,representedView);
      node.init();
      return node;
    }
 catch (    Exception e) {
      Logger.log(new Status(Status.ERROR,this.toString(),"String_Node_Str",e));
    }
  }
  return null;
}
Program: 57755
Project: 57755
Buggy source:
public NodeCreator(){
  dataNodeClasses.put(ATableBasedDataDomain.class,TableBasedDataNode.class);
  dataNodeClasses.put(PathwayDataDomain.class,PathwayDataNode.class);
  viewNodeClasses.put(AGLView.class,ViewNode.class);
  viewNodeClasses.put(GLVisBricks.class,VisBricksNode.class);
}

Fixed version (ground truth):
public NodeCreator(){
  dataNodeClasses.put(ATableBasedDataDomain.class,TableBasedDataNode.class);
  dataNodeClasses.put(PathwayDataDomain.class,PathwayDataNode.class);
  viewNodeClasses.put(ISingleDataContainerBasedView.class,ViewNode.class);
  viewNodeClasses.put(IMultiDataContainerBasedView.class,MultiDataContainerViewNode.class);
}
Program: 57756
Project: 57756
Buggy source:
@Override public void addDefaultStartViews(){
  List<Pair<String,String>> startViewWithDataDomain=appInitData.getAppArgumentStartViewWithDataDomain();
  if (!startViewWithDataDomain.isEmpty())   return;
  startViewWithDataDomain.add(new Pair<String,String>("String_Node_Str","String_Node_Str"));
  if (appInitData.isLoadPathways()) {
    startViewWithDataDomain.add(new Pair<String,String>("String_Node_Str","String_Node_Str"));
  }
}

Fixed version (ground truth):
@Override public void addDefaultStartViews(){
  List<Pair<String,String>> startViewWithDataDomain=appInitData.getAppArgumentStartViewWithDataDomain();
  if (!startViewWithDataDomain.isEmpty())   return;
  startViewWithDataDomain.add(new Pair<String,String>("String_Node_Str","String_Node_Str"));
}
Program: 57757
Project: 57757
Buggy source:
protected String convertID(String sourceID,IDSpecification idSpecification){
  if (idSpecification.getReplacingExpression() != null) {
    sourceID=sourceID.replaceAll(idSpecification.getReplacingExpression(),idSpecification.getReplacementString());
  }
  if (idSpecification.getSubStringExpression() != null) {
    String[] splitID=sourceID.split(idSpecification.getSubStringExpression());
    for (    String result : splitID) {
      if (!result.isEmpty()) {
        sourceID=result;
        break;
      }
    }
  }
  return sourceID;
}

Fixed version (ground truth):
protected String convertID(String sourceID,IDSpecification idSpecification){
  if (idSpecification == null)   return sourceID;
  if (idSpecification.getReplacingExpression() != null) {
    sourceID=sourceID.replaceAll(idSpecification.getReplacingExpression(),idSpecification.getReplacementString());
  }
  if (idSpecification.getSubStringExpression() != null) {
    String[] splitID=sourceID.split(idSpecification.getSubStringExpression());
    for (    String result : splitID) {
      if (!result.isEmpty()) {
        sourceID=result;
        break;
      }
    }
  }
  return sourceID;
}
Program: 57758
Project: 57758
Buggy source:
private int determineNumberOfMappedValues(PathwayVertexRep vertexRep){
  List<PathwayVertex> vertices=vertexRep.getPathwayVertices();
  if (vertices == null)   return 0;
  Set<Integer> allIDs=new HashSet<Integer>();
  for (  PathwayVertex vertex : vertices) {
    int davidId=PathwayItemManager.get().getDavidIdByPathwayVertex(vertex);
    for (    GeneticDataDomain dataDomain : geneticDataDomains) {
      Set<Integer> ids=dataDomain.getGeneIDMappingManager().getIDAsSet(pathwayDataDomain.getDavidIDType(),dataDomain.getGeneIDType(),davidId);
      if (ids != null && !ids.isEmpty()) {
        allIDs.addAll(ids);
      }
    }
  }
  return allIDs.size();
}

Fixed version (ground truth):
private int determineNumberOfMappedValues(PathwayVertexRep vertexRep){
  List<PathwayVertex> vertices=vertexRep.getPathwayVertices();
  if (vertices == null)   return 0;
  Set<Integer> allIDs=new HashSet<Integer>();
  for (  PathwayVertex vertex : vertices) {
    int davidId=PathwayItemManager.get().getDavidIdByPathwayVertex(vertex);
    for (    GeneticDataDomain dataDomain : geneticDataDomains) {
      Set<Integer> ids=dataDomain.getGeneIDMappingManager().getIDAsSet(pathwayDataDomain.getDavidIDType(),dataDomain.getGeneIDType(),davidId);
      if (ids != null && !ids.isEmpty()) {
        allIDs.add(davidId);
      }
    }
  }
  return allIDs.size();
}
Program: 57760
Project: 57760
Buggy source:
/** 
 * Returns all pathways where a specific gene is contained at least once.
 * @param idType
 * @param id
 * @return a Set of PathwayGraphs or null if no such mapping exists
 */
public Set<PathwayGraph> getPathwayGraphsByGeneID(IDType idType,int id){
  Set<PathwayGraph> pathways=new HashSet<PathwayGraph>();
  PathwayVertex pathwayVertexGraphItem;
  if (idType == IDType.getIDType("String_Node_Str"))   pathwayVertexGraphItem=PathwayItemManager.get().getPathwayVertexGraphItemByDavidId(id);
 else   throw new IllegalStateException("String_Node_Str");
  if (pathwayVertexGraphItem == null)   return null;
  for (  PathwayVertexRep pathwayItemRep : pathwayVertexGraphItem.getPathwayVertexReps()) {
    PathwayGraph pathwayGraph=(PathwayGraph)pathwayItemRep.getPathways();
    pathways.add(pathwayGraph);
  }
  return pathways;
}

Fixed version (ground truth):
/** 
 * Returns all pathways where a specific gene is contained at least once.
 * @param idType
 * @param id
 * @return a Set of PathwayGraphs or null if no such mapping exists
 */
public Set<PathwayGraph> getPathwayGraphsByGeneID(IDType idType,int id){
  Set<PathwayGraph> pathways=new HashSet<PathwayGraph>();
  PathwayVertex pathwayVertexGraphItem;
  if (idType == IDType.getIDType("String_Node_Str"))   pathwayVertexGraphItem=PathwayItemManager.get().getPathwayVertexGraphItemByDavidId(id);
 else   throw new IllegalStateException("String_Node_Str");
  if (pathwayVertexGraphItem == null)   return null;
  for (  PathwayVertexRep pathwayItemRep : pathwayVertexGraphItem.getPathwayVertexReps()) {
    pathways.addAll(pathwayItemRep.getPathways());
  }
  return pathways;
}
Program: 57761
Project: 57761
Buggy source:
/** 
 * Returns a clone of the record selection manager. This is the preferred way to initialize SelectionManagers.
 * @return a clone of the record selection manager
 */
public RecordSelectionManager getRecordSelectionManager(){
  return (RecordSelectionManager)recordSelectionManager.clone();
}

Fixed version (ground truth):
/** 
 * Returns a clone of the record selection manager. This is the preferred way to initialize SelectionManagers.
 * @return a clone of the record selection manager
 */
public synchronized RecordSelectionManager getRecordSelectionManager(){
  return (RecordSelectionManager)recordSelectionManager.clone();
}
Program: 57762
Project: 57762
Buggy source:
/** 
 * Returns a clone of the dimension selection manager. This is the preferred way to initialize SelectionManagers.
 * @return a clone of the dimension selection manager
 */
public DimensionSelectionManager getDimensionSelectionManager(){
  return (DimensionSelectionManager)dimensionSelectionManager.clone();
}

Fixed version (ground truth):
/** 
 * Returns a clone of the dimension selection manager. This is the preferred way to initialize SelectionManagers.
 * @return a clone of the dimension selection manager
 */
public synchronized DimensionSelectionManager getDimensionSelectionManager(){
  return (DimensionSelectionManager)dimensionSelectionManager.clone();
}
Program: 57763
Project: 57763
Buggy source:
@Override public void handleClearSelections(){
  contentTree.removeAll();
  dimensionTree.removeAll();
  recordSelectionManager.clearSelections();
  dimensionSelectionManager.clearSelections();
}

Fixed version (ground truth):
@Override public void handleClearSelections(){
  if (!contentTree.isDisposed())   contentTree.removeAll();
  if (!dimensionTree.isDisposed())   dimensionTree.removeAll();
  recordSelectionManager.clearSelections();
  dimensionSelectionManager.clearSelections();
}