nus-yam/ex-repair huggingface dataset:
Program: 58687
Project: 58687
Buggy source:
/** 
 * Collects the data to initialize a new connected client and sends it to the client
 * @param outputStream {@link OutputStream} of the socket for sending to client 
 */
private void sendServerInitializationData(OutputStream outputStream){
  ApplicationInitData initData=new ApplicationInitData();
  AUseCase useCase=(AUseCase)GeneralManager.get().getUseCase();
  initData.setUseCase((AUseCase)GeneralManager.get().getUseCase());
  initData.setSetFileContent(SetUtils.loadSetFile(useCase.getLoadDataParameters()));
  HashMap<EVAType,VirtualArray> virtualArrayMap=new HashMap<EVAType,VirtualArray>();
  virtualArrayMap.put(EVAType.CONTENT,(VirtualArray)useCase.getVA(EVAType.CONTENT));
  virtualArrayMap.put(EVAType.CONTENT_CONTEXT,(VirtualArray)useCase.getVA(EVAType.CONTENT_CONTEXT));
  virtualArrayMap.put(EVAType.CONTENT_EMBEDDED_HM,(VirtualArray)useCase.getVA(EVAType.CONTENT_EMBEDDED_HM));
  virtualArrayMap.put(EVAType.STORAGE,(VirtualArray)useCase.getVA(EVAType.STORAGE));
  initData.setVirtualArrayMap(virtualArrayMap);
  NetworkUtils utils=networkManager.getNetworkUtils();
  utils.writeHandshake(initData,outputStream);
}

Fixed version (ground truth):
/** 
 * Collects the data to initialize a new connected client and sends it to the client
 * @param outputStream {@link OutputStream} of the socket for sending to client 
 */
private void sendServerInitializationData(OutputStream outputStream){
  ApplicationInitData initData=new ApplicationInitData();
  AUseCase useCase=(AUseCase)GeneralManager.get().getUseCase();
  ISet set=useCase.getSet();
  initData.setUseCase((AUseCase)GeneralManager.get().getUseCase());
  initData.setSetFileContent(SetUtils.loadSetFile(useCase.getLoadDataParameters()));
  initData.setGeneClusterTree(SetUtils.getGeneClusterXml(set));
  initData.setExperimentClusterTree(SetUtils.getExperimentClusterXml(set));
  HashMap<EVAType,VirtualArray> virtualArrayMap=new HashMap<EVAType,VirtualArray>();
  virtualArrayMap.put(EVAType.CONTENT,(VirtualArray)useCase.getVA(EVAType.CONTENT));
  virtualArrayMap.put(EVAType.CONTENT_CONTEXT,(VirtualArray)useCase.getVA(EVAType.CONTENT_CONTEXT));
  virtualArrayMap.put(EVAType.CONTENT_EMBEDDED_HM,(VirtualArray)useCase.getVA(EVAType.CONTENT_EMBEDDED_HM));
  virtualArrayMap.put(EVAType.STORAGE,(VirtualArray)useCase.getVA(EVAType.STORAGE));
  initData.setVirtualArrayMap(virtualArrayMap);
  NetworkUtils utils=networkManager.getNetworkUtils();
  utils.writeHandshake(initData,outputStream);
}
Program: 58689
Project: 58689
Buggy source:
public void handleArrowDownAltPressed(){
  if (iLastSampleLevel2 < iSamplesLevel2 - 1) {
    iLastSampleLevel2++;
    iFirstSampleLevel2++;
    setEmbeddedHeatMapData();
    setDisplayListDirty();
  }
}

Fixed version (ground truth):
public void handleArrowDownAltPressed(){
  if (iLastSampleLevel2 < iSamplesLevel2 - 1) {
    iLastSampleLevel2++;
    iFirstSampleLevel2++;
    setEmbeddedHeatMapData();
    setDisplayListDirty();
    glHeatMapView.upDownSelect(false);
  }
}
Program: 58691
Project: 58691
Buggy source:
/** 
 * Determine selected element in stage 1 (overview bar)
 * @param gl
 */
private void handleTexturePickingLevel1(GL gl){
  int iNumberSample=iNumberOfElements;
  float fOffsety;
  float fHeightSample=(viewFrustum.getHeight() - 0.4f) / iNumberSample;
  float[] fArPickingCoords=new float[3];
  if (pickingPointLevel1 != null) {
    fArPickingCoords=GLCoordinateUtils.convertWindowCoordinatesToWorldCoordinates(gl,pickingPointLevel1.x,pickingPointLevel1.y);
    fOffsety=viewFrustum.getHeight() - fArPickingCoords[1] + 0.4f;
    iPickedSampleLevel1=(int)Math.ceil(fOffsety / fHeightSample);
    pickingPointLevel1=null;
    if (iSamplesLevel2 % 2 == 0) {
      iFirstSampleLevel1=iPickedSampleLevel1 - (int)Math.floor(iSamplesLevel2 / 2) + 1;
      iLastSampleLevel1=iPickedSampleLevel1 + (int)Math.floor(iSamplesLevel2 / 2);
    }
 else {
      iFirstSampleLevel1=iPickedSampleLevel1 - (int)Math.ceil(iSamplesLevel2 / 2);
      iLastSampleLevel1=iPickedSampleLevel1 + (int)Math.floor(iSamplesLevel2 / 2);
    }
    if (iPickedSampleLevel1 < iSamplesLevel2 / 2) {
      iPickedSampleLevel1=(int)Math.floor(iSamplesLevel2 / 2);
      iFirstSampleLevel1=0;
      iLastSampleLevel1=iSamplesLevel2 - 1;
    }
 else     if (iPickedSampleLevel1 > iNumberSample - 1 - iSamplesLevel2 / 2) {
      iPickedSampleLevel1=(int)Math.ceil(iNumberSample - iSamplesLevel2 / 2);
      iLastSampleLevel1=iNumberSample - 1;
      iFirstSampleLevel1=iNumberSample - iSamplesLevel2;
    }
  }
  setDisplayListDirty();
  setEmbeddedHeatMapData();
}

Fixed version (ground truth):
/** 
 * Determine selected element in stage 1 (overview bar)
 * @param gl
 */
private void handleTexturePickingLevel1(GL gl){
  int iNumberSample=iNumberOfElements;
  float fOffsety;
  float fHeightSample=viewFrustum.getHeight() / iNumberSample;
  float[] fArPickingCoords=new float[3];
  if (pickingPointLevel1 != null) {
    fArPickingCoords=GLCoordinateUtils.convertWindowCoordinatesToWorldCoordinates(gl,pickingPointLevel1.x,pickingPointLevel1.y);
    fOffsety=viewFrustum.getHeight() - fArPickingCoords[1] + 0.4f;
    iPickedSampleLevel1=(int)Math.ceil(fOffsety / fHeightSample);
    pickingPointLevel1=null;
    if (iSamplesLevel2 % 2 == 0) {
      iFirstSampleLevel1=iPickedSampleLevel1 - (int)Math.floor(iSamplesLevel2 / 2) + 1;
      iLastSampleLevel1=iPickedSampleLevel1 + (int)Math.floor(iSamplesLevel2 / 2);
    }
 else {
      iFirstSampleLevel1=iPickedSampleLevel1 - (int)Math.ceil(iSamplesLevel2 / 2);
      iLastSampleLevel1=iPickedSampleLevel1 + (int)Math.floor(iSamplesLevel2 / 2);
    }
    if (iPickedSampleLevel1 < iSamplesLevel2 / 2) {
      iPickedSampleLevel1=(int)Math.floor(iSamplesLevel2 / 2);
      iFirstSampleLevel1=0;
      iLastSampleLevel1=iSamplesLevel2 - 1;
    }
 else     if (iPickedSampleLevel1 > iNumberSample - 1 - iSamplesLevel2 / 2) {
      iPickedSampleLevel1=(int)Math.ceil(iNumberSample - iSamplesLevel2 / 2);
      iLastSampleLevel1=iNumberSample - 1;
      iFirstSampleLevel1=iNumberSample - iSamplesLevel2;
    }
  }
  setDisplayListDirty();
  setEmbeddedHeatMapData();
}
Program: 58692
Project: 58692
Buggy source:
public void handleArrowUpCtrlPressed(){
  if (iFirstSampleLevel1 > 0) {
    iFirstSampleLevel1--;
    iLastSampleLevel1--;
    setDisplayListDirty();
  }
}

Fixed version (ground truth):
public void handleArrowUpCtrlPressed(){
  if (iFirstSampleLevel1 > 0) {
    iFirstSampleLevel1--;
    iLastSampleLevel1--;
    setDisplayListDirty();
    glHeatMapView.upDownSelect(true);
  }
}
Program: 58693
Project: 58693
Buggy source:
public void handleArrowDownCtrlPressed(){
  if (iLastSampleLevel1 < iNumberOfElements - 1) {
    iFirstSampleLevel1++;
    iLastSampleLevel1++;
    setDisplayListDirty();
  }
}

Fixed version (ground truth):
public void handleArrowDownCtrlPressed(){
  if (iLastSampleLevel1 < iNumberOfElements - 1) {
    iFirstSampleLevel1++;
    iLastSampleLevel1++;
    setDisplayListDirty();
    glHeatMapView.upDownSelect(false);
  }
}
Program: 58694
Project: 58694
Buggy source:
public void handleArrowUpAltPressed(){
  if (iFirstSampleLevel2 > 0) {
    iFirstSampleLevel2--;
    iLastSampleLevel2--;
    setEmbeddedHeatMapData();
    setDisplayListDirty();
  }
}

Fixed version (ground truth):
public void handleArrowUpAltPressed(){
  if (iFirstSampleLevel2 > 0) {
    iFirstSampleLevel2--;
    iLastSampleLevel2--;
    setEmbeddedHeatMapData();
    setDisplayListDirty();
    glHeatMapView.upDownSelect(true);
  }
}
Program: 58697
Project: 58697
Buggy source:
@Override public float getMeasure(float[] vector1,float[] vector2){
  float correlation=0;
  float sum_sq_x=0;
  float sum_sq_y=0;
  float sum_coproduct=0;
  float mean_x=ClusterHelper.arithmeticMean(vector1);
  float mean_y=ClusterHelper.arithmeticMean(vector2);
  if (vector1.length != vector2.length) {
    System.out.println("String_Node_Str");
    return 0;
  }
  for (int i=0; i < vector1.length; i++) {
    float delta_x=0, delta_y=0;
    if (Float.isNaN(vector1[i]) == false)     delta_x=vector1[i] - mean_x;
    if (Float.isNaN(vector2[i]) == false)     delta_y=vector2[i] - mean_y;
    sum_sq_x+=delta_x * delta_x;
    sum_sq_y+=delta_y * delta_y;
    sum_coproduct+=delta_x * delta_y;
  }
  float pop_sd_x=(float)Math.sqrt(sum_sq_x / vector1.length);
  float pop_sd_y=(float)Math.sqrt(sum_sq_y / vector1.length);
  float cov_x_y=sum_coproduct / vector1.length;
  correlation=cov_x_y / (pop_sd_x * pop_sd_y);
  return correlation;
}

Fixed version (ground truth):
@Override public float getMeasure(float[] vector1,float[] vector2){
  float correlation=0;
  float sum_sq_x=0;
  float sum_sq_y=0;
  float sum_coproduct=0;
  float mean_x=ClusterHelper.arithmeticMean(vector1);
  float mean_y=ClusterHelper.arithmeticMean(vector2);
  if (vector1.length != vector2.length) {
    System.out.println("String_Node_Str");
    return 0;
  }
  for (int i=0; i < vector1.length; i++) {
    float delta_x=0, delta_y=0;
    if (Float.isNaN(vector1[i]) == false)     delta_x=vector1[i] - mean_x;
    if (Float.isNaN(vector2[i]) == false)     delta_y=vector2[i] - mean_y;
    sum_sq_x+=delta_x * delta_x;
    sum_sq_y+=delta_y * delta_y;
    sum_coproduct+=delta_x * delta_y;
  }
  float pop_sd_x=(float)Math.sqrt(sum_sq_x / vector1.length);
  float pop_sd_y=(float)Math.sqrt(sum_sq_y / vector1.length);
  float cov_x_y=sum_coproduct / vector1.length;
  correlation=cov_x_y / (pop_sd_x * pop_sd_y);
  return Math.abs(correlation);
}
Program: 58699
Project: 58699
Buggy source:
@Override public IVirtualArray getSortedVA(ISet set,ClusterState clusterState,int iProgressBarOffsetValue,int iProgressBarMultiplier){
  IVirtualArray virtualArray=null;
  eDistanceMeasure=clusterState.getDistanceMeasure();
  this.iProgressBarMultiplier=iProgressBarMultiplier;
  this.iProgressBarOffsetValue=iProgressBarOffsetValue;
  this.iVAIdContent=clusterState.getContentVaId();
  this.iVAIdStorage=clusterState.getStorageVaId();
  int iReturnValue=0;
  iReturnValue=determineSimilarities(set,clusterState.getClustererType());
  if (iReturnValue == -1) {
    GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(100,true));
    return null;
  }
 else   if (iReturnValue == -2) {
    GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(100,true));
    return null;
  }
  this.set=set;
  virtualArray=pmlcluster(clusterState.getClustererType());
  return virtualArray;
}

Fixed version (ground truth):
@Override public IVirtualArray getSortedVA(ISet set,ClusterState clusterState,int iProgressBarOffsetValue,int iProgressBarMultiplier){
  IVirtualArray virtualArray=null;
  eDistanceMeasure=clusterState.getDistanceMeasure();
  this.iProgressBarMultiplier=iProgressBarMultiplier;
  this.iProgressBarOffsetValue=iProgressBarOffsetValue;
  this.iVAIdContent=clusterState.getContentVaId();
  this.iVAIdStorage=clusterState.getStorageVaId();
  int iReturnValue=0;
  iReturnValue=determineSimilarities(set,clusterState.getClustererType());
  if (iReturnValue == -1) {
    GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(100,true));
    return null;
  }
 else   if (iReturnValue == -2) {
    GeneralManager.get().getEventPublisher().triggerEvent(new ClusterProgressEvent(100,true));
    return null;
  }
  this.set=set;
  if (clusterState.isUseMaximumLinkage())   virtualArray=pmlcluster(clusterState.getClustererType());
 else   virtualArray=palcluster(clusterState.getClustererType());
  return virtualArray;
}
Program: 58700
Project: 58700
Buggy source:
/** 
 * Function responsible for initialization of hierarchy levels. Depending on the amount of samples in the data set 2 or 3 levels are used.
 */
private void initHierarchy(){
  if (set == null)   return;
  iNumberOfElements=contentVA.size();
  if (iNumberOfElements < MIN_SAMPLES_SKIP_LEVEL_2) {
    bSkipLevel1=true;
    bSkipLevel2=true;
    iSamplesPerHeatmap=iNumberOfElements;
    iAlNumberSamples.clear();
    iAlNumberSamples.add(iNumberOfElements);
  }
 else   if (iNumberOfElements < MIN_SAMPLES_SKIP_LEVEL_1) {
    bSkipLevel1=true;
    bSkipLevel2=false;
    iSamplesPerTexture=iNumberOfElements;
    iSamplesLevel2=iNumberOfElements;
    iSamplesPerHeatmap=(int)Math.floor(iSamplesPerTexture / 3);
  }
 else {
    bSkipLevel1=false;
    bSkipLevel2=false;
    iSamplesPerTexture=(int)Math.floor(iNumberOfElements / 5);
    if (iSamplesPerTexture > MAX_SAMPLES_PER_TEXTURE)     iSamplesPerTexture=MAX_SAMPLES_PER_TEXTURE;
    iSamplesLevel2=200;
    iSamplesPerHeatmap=(int)Math.floor(iSamplesLevel2 / 3);
  }
  if (iSamplesPerHeatmap > MAX_SAMPLES_PER_HEATMAP)   iSamplesPerHeatmap=MAX_SAMPLES_PER_HEATMAP;
  if (iSamplesPerHeatmap < MIN_SAMPLES_PER_HEATMAP)   iSamplesPerHeatmap=MIN_SAMPLES_PER_HEATMAP;
}

Fixed version (ground truth):
/** 
 * Function responsible for initialization of hierarchy levels. Depending on the amount of samples in the data set 2 or 3 levels are used.
 */
private void initHierarchy(){
  if (set == null)   return;
  iNumberOfElements=contentVA.size();
  if (iNumberOfElements < MIN_SAMPLES_SKIP_LEVEL_2) {
    bSkipLevel1=true;
    bSkipLevel2=true;
    iSamplesPerHeatmap=iNumberOfElements;
    iAlNumberSamples.clear();
    iAlNumberSamples.add(iNumberOfElements);
  }
 else   if (iNumberOfElements < MIN_SAMPLES_SKIP_LEVEL_1) {
    bSkipLevel1=true;
    bSkipLevel2=false;
    iSamplesPerTexture=iNumberOfElements;
    iSamplesLevel2=iNumberOfElements;
    iSamplesPerHeatmap=(int)Math.floor(iSamplesPerTexture / 3);
  }
 else {
    bSkipLevel1=false;
    bSkipLevel2=false;
    iSamplesPerTexture=(int)Math.floor(iNumberOfElements / 5);
    if (iSamplesPerTexture > MAX_SAMPLES_PER_TEXTURE)     iSamplesPerTexture=MAX_SAMPLES_PER_TEXTURE;
    if (iSamplesPerTexture < MIN_SAMPLES_PER_TEXTURE && iNumberOfElements > MIN_SAMPLES_PER_TEXTURE)     iSamplesPerTexture=MIN_SAMPLES_PER_TEXTURE;
    iSamplesLevel2=200;
    iSamplesPerHeatmap=(int)Math.floor(iSamplesLevel2 / 3);
  }
  if (iSamplesPerHeatmap > MAX_SAMPLES_PER_HEATMAP)   iSamplesPerHeatmap=MAX_SAMPLES_PER_HEATMAP;
  if (iSamplesPerHeatmap < MIN_SAMPLES_PER_HEATMAP)   iSamplesPerHeatmap=MIN_SAMPLES_PER_HEATMAP;
}
Program: 58706
Project: 58706
Buggy source:
private void createTreeClusteringTab(TabFolder tabFolder){
  treeClusteringTab=new TabItem(tabFolder,SWT.NONE);
  treeClusteringTab.setText("String_Node_Str");
  Composite composite=new Composite(tabFolder,SWT.NONE);
  treeClusteringTab.setControl(composite);
  composite.setLayout(new GridLayout(1,false));
  final Combo clusterTypeCombo=new Combo(composite,SWT.DROP_DOWN);
  clusterTypeCombo.setItems(sArTypeOptions);
  clusterTypeCombo.select(0);
  clusterType=sArTypeOptions[0];
  clusterTypeCombo.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      clusterType=clusterTypeCombo.getText();
    }
  }
);
  final Combo distMeasureCombo=new Combo(composite,SWT.DROP_DOWN);
  distMeasureCombo.setItems(sArDistOptions);
  distMeasureCombo.setEnabled(true);
  distMeasureCombo.select(0);
  distmeasure=sArDistOptions[0];
  distMeasureCombo.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      distmeasure=distMeasureCombo.getText();
    }
  }
);
}

Fixed version (ground truth):
private void createTreeClusteringTab(TabFolder tabFolder){
  treeClusteringTab=new TabItem(tabFolder,SWT.NONE);
  treeClusteringTab.setText("String_Node_Str");
  Composite composite=new Composite(tabFolder,SWT.NONE);
  treeClusteringTab.setControl(composite);
  composite.setLayout(new GridLayout(1,false));
  Composite clusterComposite=new Composite(composite,SWT.NONE);
  clusterComposite.setLayout(new RowLayout());
  final Combo clusterTypeCombo=new Combo(clusterComposite,SWT.DROP_DOWN);
  clusterTypeCombo.setItems(sArTypeOptions);
  clusterTypeCombo.select(0);
  clusterType=sArTypeOptions[0];
  clusterTypeCombo.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      clusterType=clusterTypeCombo.getText();
    }
  }
);
  final Combo treeClustererCombo=new Combo(clusterComposite,SWT.DROP_DOWN);
  treeClustererCombo.setItems(sArTreeClusterer);
  treeClustererCombo.select(0);
  bUseMaximumLinkage=true;
  treeClustererCombo.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      if (treeClustererCombo.getText() == sArTreeClusterer[0])       bUseMaximumLinkage=true;
 else       bUseMaximumLinkage=false;
    }
  }
);
  final Combo distMeasureCombo=new Combo(composite,SWT.DROP_DOWN);
  distMeasureCombo.setItems(sArDistOptions);
  distMeasureCombo.setEnabled(true);
  distMeasureCombo.select(0);
  distmeasure=sArDistOptions[0];
  distMeasureCombo.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      distmeasure=distMeasureCombo.getText();
    }
  }
);
}
Program: 58707
Project: 58707
Buggy source:
public void execute(boolean cancelPressed){
  if (cancelPressed) {
    clusterState=null;
    return;
  }
  if (clusterType.equals(sArTypeOptions[0]))   clusterState.setClustererType(EClustererType.GENE_CLUSTERING);
 else   if (clusterType.equals(sArTypeOptions[1]))   clusterState.setClustererType(EClustererType.EXPERIMENTS_CLUSTERING);
 else   if (clusterType.equals(sArTypeOptions[2]))   clusterState.setClustererType(EClustererType.BI_CLUSTERING);
  if (distmeasure.equals(sArDistOptions[0]))   clusterState.setDistanceMeasure(EDistanceMeasure.EUCLIDEAN_DISTANCE);
 else   if (distmeasure.equals(sArDistOptions[1]))   clusterState.setDistanceMeasure(EDistanceMeasure.PEARSON_CORRELATION);
 else   if (distmeasure.equals(sArDistOptionsWeka[1]))   clusterState.setDistanceMeasure(EDistanceMeasure.MANHATTAHN_DISTANCE);
  clusterState.setAffinityPropClusterFactorGenes(fclusterFactorGenes);
  clusterState.setAffinityPropClusterFactorExperiments(fclusterFactorExperiments);
  clusterState.setKMeansClusterCntGenes(iClusterCntGenes);
  clusterState.setKMeansClusterCntExperiments(iClusterCntExperiments);
  ClusteringProgressBar progressBar=new ClusteringProgressBar(clusterState.getClustererAlgo(),clusterState.getClustererType());
  progressBar.run();
}

Fixed version (ground truth):
public void execute(boolean cancelPressed){
  if (cancelPressed) {
    clusterState=null;
    return;
  }
  if (clusterType.equals(sArTypeOptions[0]))   clusterState.setClustererType(EClustererType.GENE_CLUSTERING);
 else   if (clusterType.equals(sArTypeOptions[1]))   clusterState.setClustererType(EClustererType.EXPERIMENTS_CLUSTERING);
 else   if (clusterType.equals(sArTypeOptions[2]))   clusterState.setClustererType(EClustererType.BI_CLUSTERING);
  if (distmeasure.equals(sArDistOptions[0]))   clusterState.setDistanceMeasure(EDistanceMeasure.EUCLIDEAN_DISTANCE);
 else   if (distmeasure.equals(sArDistOptions[1]))   clusterState.setDistanceMeasure(EDistanceMeasure.PEARSON_CORRELATION);
 else   if (distmeasure.equals(sArDistOptionsWeka[1]))   clusterState.setDistanceMeasure(EDistanceMeasure.MANHATTAHN_DISTANCE);
  clusterState.setAffinityPropClusterFactorGenes(fclusterFactorGenes);
  clusterState.setAffinityPropClusterFactorExperiments(fclusterFactorExperiments);
  clusterState.setKMeansClusterCntGenes(iClusterCntGenes);
  clusterState.setKMeansClusterCntExperiments(iClusterCntExperiments);
  clusterState.setUseMaximumLinkage(bUseMaximumLinkage);
  ClusteringProgressBar progressBar=new ClusteringProgressBar(clusterState.getClustererAlgo(),clusterState.getClustererType());
  progressBar.run();
}
Program: 58709
Project: 58709
Buggy source:
/** 
 * Constructor.
 * @param glCanvas
 * @param sLabel
 * @param viewFrustum
 */
public GLHyperbolic(GLCaleydoCanvas glCanvas,final String sLabel,final IViewFrustum viewFrustum){
  super(glCanvas,sLabel,viewFrustum,true);
  viewType=EManagedObjectType.GL_HYPERBOLIC;
  colorMappingManager=ColorMappingManager.get();
  renderStyle=new HyperbolicRenderStyle(viewFrustum);
  ArrayList<ESelectionType> alSelectionTypes=new ArrayList<ESelectionType>();
  alSelectionTypes.add(ESelectionType.NORMAL);
  alSelectionTypes.add(ESelectionType.MOUSE_OVER);
  alSelectionTypes.add(ESelectionType.SELECTION);
  tree=new Tree<ADrawAbleNode>();
  ADrawAbleNode test=new TestNode("String_Node_Str",1);
  tree.setRootNode(test);
  layouter=new LinearTreeLayouter(viewFrustum);
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param glCanvas
 * @param sLabel
 * @param viewFrustum
 */
public GLHyperbolic(GLCaleydoCanvas glCanvas,final String sLabel,final IViewFrustum viewFrustum){
  super(glCanvas,sLabel,viewFrustum,true);
  viewType=EManagedObjectType.GL_HYPERBOLIC;
  colorMappingManager=ColorMappingManager.get();
  renderStyle=new HyperbolicRenderStyle(viewFrustum);
  ArrayList<ESelectionType> alSelectionTypes=new ArrayList<ESelectionType>();
  alSelectionTypes.add(ESelectionType.NORMAL);
  alSelectionTypes.add(ESelectionType.MOUSE_OVER);
  alSelectionTypes.add(ESelectionType.SELECTION);
  tree=new Tree<ADrawAbleNode>();
  ADrawAbleNode test=new TestNode("String_Node_Str",0);
  tree.setRootNode(test);
  for (int i=1; i <= 21; ++i) {
    ADrawAbleNode test2=new TestNode("String_Node_Str",i);
    tree.addChild(test,test2);
    test=test2;
  }
  layouter=new LinearTreeLayouter(viewFrustum);
}
Program: 58710
Project: 58710
Buggy source:
public int getDepth(){
  if (isDepthFlagDirty()) {
    resetDepthFlag();
    return determineDepth(rootNode);
  }
  return iDepth;
}

Fixed version (ground truth):
public int getDepth(){
  if (isDepthFlagDirty()) {
    resetDepthFlag();
    iDepth=determineDepth(rootNode);
  }
  return iDepth;
}
Program: 58711
Project: 58711
Buggy source:
private int determineDepth(NodeType node){
  NodeInfo info=mNodeMap.get(node);
  if (hasChildren(node)) {
    int tmpDepth=info.getLayer();
    for (    NodeType currentNode : getChildren(node)) {
      int iChildDepth=determineDepth(currentNode);
      if (tmpDepth <= iChildDepth)       tmpDepth=iChildDepth;
    }
    iDepth=tmpDepth;
  }
  return info.getLayer();
}

Fixed version (ground truth):
private int determineDepth(NodeType node){
  NodeInfo info=mNodeMap.get(node);
  if (hasChildren(node)) {
    int tmpDepth=0;
    for (    NodeType currentNode : getChildren(node)) {
      int iChildDepth=determineDepth(currentNode);
      if (tmpDepth <= iChildDepth)       tmpDepth=iChildDepth;
    }
    return tmpDepth;
  }
 else   return info.getLayer();
}
Program: 58712
Project: 58712
Buggy source:
@Override public void renderTreeLayout(GL gl,Tree<ADrawAbleNode> tree){
  updateSizeInfo();
  if (tree == null)   return;
  int deph=30;
  int iNumNodesInLayer=1;
  IDrawAbleNode rootNode=tree.getRoot();
  float f=0;
  for (int i=0; i <= deph; i++)   f=f + (float)Math.pow((double)HyperbolicRenderStyle.LIN_TREE_X_SCALING_PER_LAYER,i);
  float fLayerSpacing=fViewSpaceYAbs / f;
  float fYOff=fViewSpaceY[1] - fLayerSpacing;
  for (int i=1; i <= deph; ++i) {
    float fYCoord=fYOff + fLayerSpacing / 2f;
    float fNodeSpacing=fViewSpaceXAbs / (i + 1);
    for (int j=1; j <= i; j++) {
      float fXCoord=fViewSpaceX[0] + j * fNodeSpacing;
      float fZCoord=0;
      rootNode.drawAtPostion(gl,fXCoord,fYCoord,fZCoord,fLayerSpacing * 0.8f,fNodeSpacing,EDrawAbleNodeDetailLevel.VeryHigh);
    }
    fLayerSpacing=fLayerSpacing * (float)Math.pow((double)HyperbolicRenderStyle.LIN_TREE_X_SCALING_PER_LAYER,i);
    fYOff=fYOff - fLayerSpacing;
  }
  gl.glEnd();
  gl.glFlush();
  return;
}

Fixed version (ground truth):
@Override public void renderTreeLayout(GL gl,Tree<ADrawAbleNode> tree){
  updateSizeInfo();
  if (tree == null)   return;
  int deph=tree.getDepth();
  IDrawAbleNode rootNode=tree.getRoot();
  float f=0;
  for (int i=0; i < deph; i++)   f=f + (float)Math.pow((double)HyperbolicRenderStyle.LIN_TREE_Y_SCALING_PER_LAYER,i);
  float fLayerSpacing=fViewSpaceYAbs / f;
  float fYOff=fViewSpaceY[1] - fLayerSpacing;
  for (int i=1; i <= deph; ++i) {
    float fYCoord=fYOff + fLayerSpacing / 2f;
    float fNodeSpacing=fViewSpaceXAbs / (i + 1);
    for (int j=1; j <= i; j++) {
      float fXCoord=fViewSpaceX[0] + j * fNodeSpacing;
      float fZCoord=0;
      rootNode.drawAtPostion(gl,fXCoord,fYCoord,fZCoord,fLayerSpacing * 0.8f,fNodeSpacing,EDrawAbleNodeDetailLevel.Low);
    }
    fLayerSpacing=fLayerSpacing * HyperbolicRenderStyle.LIN_TREE_Y_SCALING_PER_LAYER;
    fYOff=fYOff - fLayerSpacing;
  }
  gl.glEnd();
  gl.glFlush();
  return;
}
Program: 58714
Project: 58714
Buggy source:
private ArrayList<Integer> getAl(ArrayList<Integer> alExamples,ArrayList<Integer> count,ArrayList<Integer> idxExamples,int[] idx,EClustererType eClustererType){
  ArrayList<Integer> indexes=new ArrayList<Integer>();
  IVirtualArray contentVA=set.getVA(iVAIdContent);
  IVirtualArray storageVA=set.getVA(iVAIdStorage);
  int counter=0;
  int idxCnt=0;
  if (eClustererType == EClustererType.GENE_CLUSTERING) {
    for (    Integer example : alExamples) {
      for (      Integer icontent : contentVA) {
        if (idx[contentVA.indexOf(icontent)] == example) {
          indexes.add(icontent);
          count.set(counter,count.get(counter) + 1);
        }
        if (example == contentVA.indexOf(icontent)) {
          idxExamples.add(idxCnt);
          idxCnt=0;
        }
        idxCnt++;
      }
      counter++;
    }
  }
 else {
    for (    Integer example : alExamples) {
      for (      Integer icontent : storageVA) {
        if (idx[storageVA.indexOf(icontent)] == example) {
          indexes.add(icontent);
          count.set(counter,count.get(counter) + 1);
        }
        if (example == storageVA.indexOf(icontent)) {
          idxExamples.add(idxCnt);
          idxCnt=0;
        }
        idxCnt++;
      }
      counter++;
    }
  }
  return indexes;
}

Fixed version (ground truth):
private ArrayList<Integer> getAl(ArrayList<Integer> alExamples,ArrayList<Integer> count,ArrayList<Integer> idxExamples,int[] idx,EClustererType eClustererType){
  ArrayList<Integer> indexes=new ArrayList<Integer>();
  IVirtualArray contentVA=set.getVA(iVAIdContent);
  IVirtualArray storageVA=set.getVA(iVAIdStorage);
  int counter=0;
  int idxCnt=0;
  if (eClustererType == EClustererType.GENE_CLUSTERING) {
    for (    Integer example : alExamples) {
      for (      Integer icontent : contentVA) {
        if (idx[contentVA.get(icontent)] == example) {
          indexes.add(icontent);
          count.set(counter,count.get(counter) + 1);
        }
        if (example == contentVA.get(icontent)) {
          idxExamples.add(contentVA.get(example));
          idxCnt=0;
        }
        idxCnt++;
      }
      counter++;
    }
  }
 else {
    for (    Integer example : alExamples) {
      for (      Integer icontent : storageVA) {
        if (idx[storageVA.get(icontent)] == example) {
          indexes.add(icontent);
          count.set(counter,count.get(counter) + 1);
        }
        if (example == storageVA.get(icontent)) {
          idxExamples.add(storageVA.get(example));
          idxCnt=0;
        }
        idxCnt++;
      }
      counter++;
    }
  }
  return indexes;
}
Program: 58718
Project: 58718
Buggy source:
@Override public ECommandType getCreationCommandType(){
  return ECommandType.CMD_ID;
}

Fixed version (ground truth):
@Override public ECommandType getCreationCommandType(){
  return ECommandType.CREATE_GL_TEXTURE_HEAT_MAP_3D;
}
Program: 58719
Project: 58719
Buggy source:
/** 
 * The handling of the picking. This has to be called when an element of the type  {@link EPickingType#CONTEXT_MENU_SELECTION} is picked.
 * @param ePickingMode the mode of the picking, eg. mouse-over or clicked. Only mouse-over and clicked are handled.
 * @param iExternalID the id which has to match one of the ids specified in  {@link #display}
 */
public void handleEvents(EPickingMode ePickingMode,int iExternalID){
switch (ePickingMode) {
case MOUSE_OVER:
    mouseOverElement=iExternalID;
  isDisplayListDirty=true;
break;
case CLICKED:
hashUniqueIDToContextMenuItem.get(iExternalID).triggerEvent();
isDisplayListDirty=true;
flush();
break;
}
}

Fixed version (ground truth):
/** 
 * The handling of the picking. This has to be called when an element of the type  {@link EPickingType#CONTEXT_MENU_SELECTION} is picked.
 * @param ePickingMode the mode of the picking, eg. mouse-over or clicked. Only mouse-over and clicked are handled.
 * @param iExternalID the id which has to match one of the ids specified in  {@link #display}
 */
public void handleEvents(EPickingMode ePickingMode,int iExternalID){
  if (iExternalID == Integer.MAX_VALUE)   return;
switch (ePickingMode) {
case MOUSE_OVER:
    mouseOverElement=iExternalID;
  isDisplayListDirty=true;
break;
case CLICKED:
hashUniqueIDToContextMenuItem.get(iExternalID).triggerEvent();
isDisplayListDirty=true;
flush();
break;
}
}
Program: 58720
Project: 58720
Buggy source:
public ISelectionDelta getSelectionDelta(){
  return selectionDelta;
}

Fixed version (ground truth):
public SelectionDelta getSelectionDelta(){
  return selectionDelta;
}
Program: 58721
Project: 58721
Buggy source:
public void setSelectionDelta(ISelectionDelta selectionDelta){
  this.selectionDelta=selectionDelta;
}

Fixed version (ground truth):
public void setSelectionDelta(SelectionDelta selectionDelta){
  this.selectionDelta=selectionDelta;
}
Program: 58723
Project: 58723
Buggy source:
private void createContentSelection(ESelectionType selectionType,int contentID){
  if (contentSelectionManager.checkStatus(selectionType,contentID))   return;
  connectedElementRepresentationManager.clear(EIDType.EXPRESSION_INDEX);
  contentSelectionManager.clearSelection(selectionType);
  SelectionCommand command=new SelectionCommand(ESelectionCommandType.CLEAR,selectionType);
  sendSelectionCommandEvent(EIDType.EXPRESSION_INDEX,command);
  Integer iMappingID=generalManager.getIDManager().createID(EManagedObjectType.CONNECTION);
  contentSelectionManager.addToType(selectionType,contentID);
  contentSelectionManager.addConnectionID(iMappingID,contentID);
  if (eFieldDataType == EIDType.EXPRESSION_INDEX) {
    ISelectionDelta selectionDelta=contentSelectionManager.getDelta();
    handleConnectedElementRep(selectionDelta);
    SelectionUpdateEvent event=new SelectionUpdateEvent();
    event.setSender(this);
    event.setSelectionDelta(selectionDelta);
    event.setInfo(getShortInfo());
    eventPublisher.triggerEvent(event);
  }
  setDisplayListDirty();
}

Fixed version (ground truth):
private void createContentSelection(ESelectionType selectionType,int contentID){
  if (contentSelectionManager.checkStatus(selectionType,contentID))   return;
  connectedElementRepresentationManager.clear(EIDType.EXPRESSION_INDEX);
  contentSelectionManager.clearSelection(selectionType);
  SelectionCommand command=new SelectionCommand(ESelectionCommandType.CLEAR,selectionType);
  sendSelectionCommandEvent(EIDType.EXPRESSION_INDEX,command);
  Integer iMappingID=generalManager.getIDManager().createID(EManagedObjectType.CONNECTION);
  contentSelectionManager.addToType(selectionType,contentID);
  contentSelectionManager.addConnectionID(iMappingID,contentID);
  if (eFieldDataType == EIDType.EXPRESSION_INDEX) {
    SelectionDelta selectionDelta=contentSelectionManager.getDelta();
    handleConnectedElementRep(selectionDelta);
    SelectionUpdateEvent event=new SelectionUpdateEvent();
    event.setSender(this);
    event.setSelectionDelta(selectionDelta);
    event.setInfo(getShortInfo());
    eventPublisher.triggerEvent(event);
  }
  setDisplayListDirty();
}
Program: 58724
Project: 58724
Buggy source:
private void createStorageSelection(ESelectionType selectionType,int storageID){
  if (storageSelectionManager.checkStatus(selectionType,storageID)) {
    return;
  }
  storageSelectionManager.clearSelection(selectionType);
  storageSelectionManager.addToType(selectionType,storageID);
  if (eStorageDataType == EIDType.EXPERIMENT_INDEX) {
    ISelectionDelta selectionDelta=storageSelectionManager.getDelta();
    SelectionUpdateEvent event=new SelectionUpdateEvent();
    event.setSender(this);
    event.setSelectionDelta(selectionDelta);
    eventPublisher.triggerEvent(event);
  }
  setDisplayListDirty();
}

Fixed version (ground truth):
private void createStorageSelection(ESelectionType selectionType,int storageID){
  if (storageSelectionManager.checkStatus(selectionType,storageID)) {
    return;
  }
  storageSelectionManager.clearSelection(selectionType);
  storageSelectionManager.addToType(selectionType,storageID);
  if (eStorageDataType == EIDType.EXPERIMENT_INDEX) {
    SelectionDelta selectionDelta=storageSelectionManager.getDelta();
    SelectionUpdateEvent event=new SelectionUpdateEvent();
    event.setSender(this);
    event.setSelectionDelta(selectionDelta);
    eventPublisher.triggerEvent(event);
  }
  setDisplayListDirty();
}
Program: 58725
Project: 58725
Buggy source:
/** 
 * Renders the toolbar with the related content to the given views
 * @param viewIDs list of viewIDs to render a toolbar for
 */
public void renderToolBar(List<Integer> viewIDs){
  ToolBarContentFactory contentFactory=ToolBarContentFactory.get();
  boolean isIgnored=contentFactory.isIgnored(viewIDs);
  if (!isIgnored) {
    List<AToolBarContent> toolBarContents=contentFactory.getToolBarContent(viewIDs);
    IToolBarRenderer renderer=toolBarView.getToolBarRenderer();
    Runnable job=renderer.createRenderJob(toolBarView,toolBarContents);
    Display display=toolBarView.getParentComposite().getDisplay();
    display.asyncExec(job);
  }
}

Fixed version (ground truth):
/** 
 * Renders the toolbar with the related content to the given views
 * @param viewIDs list of viewIDs to render a toolbar for
 */
public void renderToolBar(List<Integer> viewIDs){
  ToolBarContentFactory contentFactory=ToolBarContentFactory.get();
  boolean isIgnored=contentFactory.isIgnored(viewIDs);
  if (!isIgnored) {
    if (currentToolBarContents != null) {
      for (      AToolBarContent toolBarContent : currentToolBarContents) {
        toolBarContent.dispose();
      }
      currentToolBarContents=null;
    }
    currentToolBarContents=contentFactory.getToolBarContent(viewIDs);
    IToolBarRenderer renderer=toolBarView.getToolBarRenderer();
    Runnable job=renderer.createRenderJob(toolBarView,currentToolBarContents);
    Display display=toolBarView.getParentComposite().getDisplay();
    display.asyncExec(job);
  }
}
Program: 58726
Project: 58726
Buggy source:
/** 
 * Creates and returns icons for bucket related toolbar box
 * @return bucket related toolbar box
 */
private ToolBarContainer createBucketContainer(){
  RemoteRenderingToolBarMediator mediator=new RemoteRenderingToolBarMediator();
  SerializedRemoteRenderingView serializedView=(SerializedRemoteRenderingView)getTargetViewData();
  ActionToolBarContainer container=new ActionToolBarContainer();
  container.setImagePath(BUCKET_IMAGE_PATH);
  container.setTitle(BUCKET_VIEW_TITLE);
  List<IToolBarItem> actionList=new ArrayList<IToolBarItem>();
  container.setToolBarItems(actionList);
  IToolBarItem closeOrResetContainedViews=new CloseOrResetContainedViews(mediator);
  actionList.add(closeOrResetContainedViews);
  ToggleConnectionLinesAction toggleConnectionLinesAction=new ToggleConnectionLinesAction(mediator);
  toggleConnectionLinesAction.setConnectionLinesEnabled(serializedView.isConnectionLinesEnabled());
  actionList.add(toggleConnectionLinesAction);
  NavigationModeAction navigationModeAction=new NavigationModeAction(mediator);
  actionList.add(navigationModeAction);
  ToggleZoomAction toggleZoomAction=new ToggleZoomAction(mediator);
  actionList.add(toggleZoomAction);
  return container;
}

Fixed version (ground truth):
/** 
 * Creates and returns icons for bucket related toolbar box
 * @return bucket related toolbar box
 */
private ToolBarContainer createBucketContainer(){
  mediator=new RemoteRenderingToolBarMediator();
  mediator.setToolBarContent(this);
  SerializedRemoteRenderingView serializedView=(SerializedRemoteRenderingView)getTargetViewData();
  ActionToolBarContainer container=new ActionToolBarContainer();
  container.setImagePath(BUCKET_IMAGE_PATH);
  container.setTitle(BUCKET_VIEW_TITLE);
  List<IToolBarItem> actionList=new ArrayList<IToolBarItem>();
  container.setToolBarItems(actionList);
  IToolBarItem closeOrResetContainedViews=new CloseOrResetContainedViews(mediator);
  actionList.add(closeOrResetContainedViews);
  toggleConnectionLinesAction=new ToggleConnectionLinesAction(mediator);
  toggleConnectionLinesAction.setConnectionLinesEnabled(serializedView.isConnectionLinesEnabled());
  actionList.add(toggleConnectionLinesAction);
  NavigationModeAction navigationModeAction=new NavigationModeAction(mediator);
  actionList.add(navigationModeAction);
  ToggleZoomAction toggleZoomAction=new ToggleZoomAction(mediator);
  actionList.add(toggleZoomAction);
  return container;
}
Program: 58727
Project: 58727
Buggy source:
public RemoteRenderingToolBarMediator(){
  eventPublisher=GeneralManager.get().getEventPublisher();
}

Fixed version (ground truth):
public RemoteRenderingToolBarMediator(){
  System.out.println("String_Node_Str");
  eventPublisher=GeneralManager.get().getEventPublisher();
  registerEventListeners();
}
Program: 58728
Project: 58728
Buggy source:
@Override public void handleVirtualArrayUpdate(IVirtualArrayDelta selectionDelta,String info){
  Integer vaID=mapVAIDs.get(selectionDelta.getVAType());
  IVirtualArray va=set.getVA(vaID);
  va.setDelta(selectionDelta);
}

Fixed version (ground truth):
@Override public void handleVirtualArrayUpdate(IVirtualArrayDelta vaDelta,String info){
  Integer vaID=mapVAIDs.get(vaDelta.getVAType());
  IVirtualArray va=set.getVA(vaID);
  va.setDelta(vaDelta);
}
Program: 58729
Project: 58729
Buggy source:
/** 
 * Build mapping between polyline/axis and storage/content for virtual arrays and selection managers
 */
private void initContentVariables(){
  if (bRenderStorageHorizontally) {
    axisVA=contentVA;
    axisVAType=contentVAType;
    polylineVA=storageVA;
    polylineVAType=storageVAType;
    polylineSelectionManager=storageSelectionManager;
    axisSelectionManager=contentSelectionManager;
  }
 else {
    polylineVA=contentVA;
    polylineVAType=contentVAType;
    axisVA=storageVA;
    axisVAType=storageVAType;
    polylineSelectionManager=contentSelectionManager;
    axisSelectionManager=storageSelectionManager;
  }
}

Fixed version (ground truth):
/** 
 * Build mapping between polyline/axis and storage/content for virtual arrays and selection managers
 */
private void initContentVariables(){
  if (bRenderStorageHorizontally) {
    eAxisDataType=EIDType.EXPRESSION_INDEX;
    ePolylineDataType=EIDType.EXPERIMENT_INDEX;
    axisVA=contentVA;
    axisVAType=contentVAType;
    polylineVA=storageVA;
    polylineVAType=storageVAType;
    polylineSelectionManager=storageSelectionManager;
    axisSelectionManager=contentSelectionManager;
  }
 else {
    eAxisDataType=EIDType.EXPERIMENT_INDEX;
    ePolylineDataType=EIDType.EXPRESSION_INDEX;
    polylineVA=contentVA;
    polylineVAType=contentVAType;
    axisVA=storageVA;
    axisVAType=storageVAType;
    polylineSelectionManager=contentSelectionManager;
    axisSelectionManager=storageSelectionManager;
  }
}
Program: 58731
Project: 58731
Buggy source:
@Override public void changeOrientation(boolean defaultOrientation){
  renderStorageAsPolyline(defaultOrientation);
}

Fixed version (ground truth):
/** 
 * Changes the role of axes and polylines. 
 * @param defaultOrientation the default orientation is for content to be polylines and for storages to be the axes
 */
@Override public void changeOrientation(boolean defaultOrientation){
  if (defaultOrientation != this.bRenderStorageHorizontally) {
    if (defaultOrientation && contentVA.size() > 100) {
      getParentGLCanvas().getParentComposite().getDisplay().asyncExec(new Runnable(){
        @Override public void run(){
          MessageDialog.openError(getParentGLCanvas().getParentComposite().getShell(),"String_Node_Str","String_Node_Str");
          return;
        }
      }
);
      return;
    }
  }
  this.bRenderStorageHorizontally=defaultOrientation;
  connectedElementRepresentationManager.clear(EIDType.EXPRESSION_INDEX);
  initContentVariables();
  resetAxisSpacing();
  initGates();
  setDisplayListDirty();
}
Program: 58732
Project: 58732
Buggy source:
private void resetAllTreeSelections(){
  resetAllTreeSelectionsRec(tree.getRoot());
}

Fixed version (ground truth):
private void resetAllTreeSelections(){
  if (tree != null)   resetAllTreeSelectionsRec(tree.getRoot());
}
Program: 58733
Project: 58733
Buggy source:
/** 
 * Render marker in OverviewBar for visualization of the currently (in stage 2) rendered part
 * @param gl
 */
private void renderMarkerOverviewBar(final GL gl){
  float fHeight=viewFrustum.getHeight();
  float fFieldWith=0.1f;
  Vec3f startpoint1, endpoint1, startpoint2, endpoint2;
  float fHeightElem=fHeight / contentVA.size();
  int iStartElem=0;
  int iLastElem=0;
  boolean colorToggle=true;
  gl.glLineWidth(2f);
  for (int currentGroup=0; currentGroup < iNrSelBar; currentGroup++) {
    iStartElem=iLastElem;
    iLastElem+=iAlNumberSamples.get(currentGroup);
    if (colorToggle)     gl.glColor4f(0f,0f,0f,1f);
 else     gl.glColor4f(1f,1f,1f,1f);
    colorToggle=(colorToggle == true) ? false : true;
    if (currentGroup == iSelectorBar - 1) {
      startpoint1=new Vec3f(fFieldWith,fHeight - fHeightElem * iStartElem,0);
      endpoint1=new Vec3f(GAP_LEVEL1_2,fHeight,0);
      startpoint2=new Vec3f(fFieldWith,fHeight - fHeightElem * iLastElem,0);
      endpoint2=new Vec3f(GAP_LEVEL1_2,0,0);
      renderSelectedDomain(gl,startpoint1,endpoint1,startpoint2,endpoint2);
      gl.glColor4fv(MOUSE_OVER_COLOR,0);
    }
    gl.glBegin(GL.GL_LINE_LOOP);
    gl.glVertex3f(0,fHeight - fHeightElem * iStartElem,0);
    gl.glVertex3f(fFieldWith,fHeight - fHeightElem * iStartElem,0);
    gl.glVertex3f(fFieldWith,(fHeight - fHeightElem * iLastElem) + 0.01f,0);
    gl.glVertex3f(0,(fHeight - fHeightElem * iLastElem) + 0.01f,0);
    gl.glEnd();
  }
  gl.glColor4f(1f,1f,1f,1f);
}

Fixed version (ground truth):
/** 
 * Render marker in OverviewBar for visualization of the currently (in stage 2) rendered part
 * @param gl
 */
private void renderMarkerOverviewBar(final GL gl){
  float fHeight=viewFrustum.getHeight();
  float fFieldWith=0.1f;
  Vec3f startpoint1, endpoint1, startpoint2, endpoint2;
  float fHeightElem=fHeight / iNumberOfElements;
  int iStartElem=0;
  int iLastElem=0;
  boolean colorToggle=true;
  gl.glLineWidth(2f);
  for (int currentGroup=0; currentGroup < iNrSelBar; currentGroup++) {
    iStartElem=iLastElem;
    iLastElem+=iAlNumberSamples.get(currentGroup);
    if (colorToggle)     gl.glColor4f(0f,0f,0f,1f);
 else     gl.glColor4f(1f,1f,1f,1f);
    colorToggle=(colorToggle == true) ? false : true;
    if (currentGroup == iSelectorBar - 1) {
      startpoint1=new Vec3f(fFieldWith,fHeight - fHeightElem * iStartElem,0);
      endpoint1=new Vec3f(GAP_LEVEL1_2,fHeight,0);
      startpoint2=new Vec3f(fFieldWith,fHeight - fHeightElem * iLastElem,0);
      endpoint2=new Vec3f(GAP_LEVEL1_2,0,0);
      renderSelectedDomain(gl,startpoint1,endpoint1,startpoint2,endpoint2);
      gl.glColor4fv(MOUSE_OVER_COLOR,0);
    }
    gl.glBegin(GL.GL_LINE_LOOP);
    gl.glVertex3f(0,fHeight - fHeightElem * iStartElem,0);
    gl.glVertex3f(fFieldWith,fHeight - fHeightElem * iStartElem,0);
    gl.glVertex3f(fFieldWith,(fHeight - fHeightElem * iLastElem) + 0.01f,0);
    gl.glVertex3f(0,(fHeight - fHeightElem * iLastElem) + 0.01f,0);
    gl.glEnd();
  }
  gl.glColor4f(1f,1f,1f,1f);
}
Program: 58734
Project: 58734
Buggy source:
/** 
 * Render the first stage of the hierarchy (OverviewBar)
 * @param gl
 */
private void renderOverviewBar(GL gl){
  float fHeight;
  float fWidth;
  float fyOffset=0.0f;
  fHeight=viewFrustum.getHeight();
  fWidth=0.1f;
  float fHeightElem=fHeight / contentVA.size();
  float fStep=0;
  gl.glColor4f(1f,1f,0f,1f);
  for (int i=0; i < iNrSelBar; i++) {
    fStep=fHeightElem * iAlNumberSamples.get(iNrSelBar - i - 1);
    AlTextures.get(iNrSelBar - i - 1).enable();
    AlTextures.get(iNrSelBar - i - 1).bind();
    gl.glTexParameteri(GL.GL_TEXTURE_2D,GL.GL_TEXTURE_WRAP_S,GL.GL_CLAMP);
    gl.glTexParameteri(GL.GL_TEXTURE_2D,GL.GL_TEXTURE_WRAP_T,GL.GL_CLAMP);
    gl.glTexParameteri(GL.GL_TEXTURE_2D,GL.GL_TEXTURE_MAG_FILTER,GL.GL_NEAREST);
    gl.glTexParameteri(GL.GL_TEXTURE_2D,GL.GL_TEXTURE_MIN_FILTER,GL.GL_NEAREST);
    TextureCoords texCoords=AlTextures.get(iNrSelBar - i - 1).getImageTexCoords();
    gl.glPushName(pickingManager.getPickingID(iUniqueID,EPickingType.HIER_HEAT_MAP_TEXTURE_SELECTION,iNrSelBar - i));
    gl.glBegin(GL.GL_QUADS);
    gl.glTexCoord2d(texCoords.left(),texCoords.top());
    gl.glVertex3f(0,fyOffset,0);
    gl.glTexCoord2d(texCoords.left(),texCoords.bottom());
    gl.glVertex3f(0,fyOffset + fStep,0);
    gl.glTexCoord2d(texCoords.right(),texCoords.bottom());
    gl.glVertex3f(fWidth,fyOffset + fStep,0);
    gl.glTexCoord2d(texCoords.right(),texCoords.top());
    gl.glVertex3f(fWidth,fyOffset,0);
    gl.glEnd();
    gl.glPopName();
    fyOffset+=fStep;
    AlTextures.get(iNrSelBar - i - 1).disable();
  }
}

Fixed version (ground truth):
/** 
 * Render the first stage of the hierarchy (OverviewBar)
 * @param gl
 */
private void renderOverviewBar(GL gl){
  float fHeight;
  float fWidth;
  float fyOffset=0.0f;
  fHeight=viewFrustum.getHeight();
  fWidth=0.1f;
  float fHeightElem=fHeight / iNumberOfElements;
  float fStep=0;
  gl.glColor4f(1f,1f,0f,1f);
  for (int i=0; i < iNrSelBar; i++) {
    fStep=fHeightElem * iAlNumberSamples.get(iNrSelBar - i - 1);
    AlTextures.get(iNrSelBar - i - 1).enable();
    AlTextures.get(iNrSelBar - i - 1).bind();
    gl.glTexParameteri(GL.GL_TEXTURE_2D,GL.GL_TEXTURE_WRAP_S,GL.GL_CLAMP);
    gl.glTexParameteri(GL.GL_TEXTURE_2D,GL.GL_TEXTURE_WRAP_T,GL.GL_CLAMP);
    gl.glTexParameteri(GL.GL_TEXTURE_2D,GL.GL_TEXTURE_MAG_FILTER,GL.GL_NEAREST);
    gl.glTexParameteri(GL.GL_TEXTURE_2D,GL.GL_TEXTURE_MIN_FILTER,GL.GL_NEAREST);
    TextureCoords texCoords=AlTextures.get(iNrSelBar - i - 1).getImageTexCoords();
    gl.glPushName(pickingManager.getPickingID(iUniqueID,EPickingType.HIER_HEAT_MAP_TEXTURE_SELECTION,iNrSelBar - i));
    gl.glBegin(GL.GL_QUADS);
    gl.glTexCoord2d(texCoords.left(),texCoords.top());
    gl.glVertex3f(0,fyOffset,0);
    gl.glTexCoord2d(texCoords.left(),texCoords.bottom());
    gl.glVertex3f(0,fyOffset + fStep,0);
    gl.glTexCoord2d(texCoords.right(),texCoords.bottom());
    gl.glVertex3f(fWidth,fyOffset + fStep,0);
    gl.glTexCoord2d(texCoords.right(),texCoords.top());
    gl.glVertex3f(fWidth,fyOffset,0);
    gl.glEnd();
    gl.glPopName();
    fyOffset+=fStep;
    AlTextures.get(iNrSelBar - i - 1).disable();
  }
}
Program: 58735
Project: 58735
Buggy source:
private void render(GL gl){
  layouter.setGL(gl);
  layouter.drawLayout();
}

Fixed version (ground truth):
private void render(GL gl){
  layouter.drawLayout(gl);
}
Program: 58736
Project: 58736
Buggy source:
@Override public final ArrayList<Vec3f> drawAtPostion(GL gl,float fXCoord,float fYCoord,float fZCoord,float fHeight,float fWidth,EDrawAbleNodeDetailLevel eDetailLevel){
  this.fXCoord=fXCoord;
  this.fYCoord=fYCoord;
  this.fZCoord=fZCoord;
  this.fHeight=fHeight;
  this.fWidth=fWidth;
  this.gl=gl;
  return mRepresantations.get(eDetailLevel).drawObjectAtPosition(gl,fXCoord,fYCoord,fZCoord,fHeight,fWidth);
}

Fixed version (ground truth):
@Override public final ArrayList<Vec3f> drawAtPostion(GL gl,float fXCoord,float fYCoord,float fZCoord,float fHeight,float fWidth,EDrawAbleNodeDetailLevel eDetailLevel){
  this.fXCoord=fXCoord;
  this.fYCoord=fYCoord;
  this.fZCoord=fZCoord;
  this.fHeight=fHeight;
  this.fWidth=fWidth;
  return mRepresantations.get(eDetailLevel).drawObjectAtPosition(gl,fXCoord,fYCoord,fZCoord,fHeight,fWidth);
}
Program: 58737
Project: 58737
Buggy source:
public static ADrawAbleObject getDrawAbleObject(String str){
  if (str == "String_Node_Str")   return new DrawAbleObjectSquare();
  return null;
}

Fixed version (ground truth):
public static ADrawAbleObject getDrawAbleObject(String str){
  if (str == "String_Node_Str")   return new DrawAbleObjectFallback();
 else   if (str == "String_Node_Str")   return new DrawAbleObjectSquare();
  return null;
}
Program: 58738
Project: 58738
Buggy source:
public TestNode(String nodeName,int iComparableValue){
  super(nodeName,iComparableValue);
}

Fixed version (ground truth):
public TestNode(String nodeName,int iComparableValue){
  super(nodeName,iComparableValue);
  this.mRepresantations.put(EDrawAbleNodeDetailLevel.VeryHigh,DrawAbleObjectsFactory.getDrawAbleObject("String_Node_Str"));
  this.mRepresantations.put(EDrawAbleNodeDetailLevel.High,DrawAbleObjectsFactory.getDrawAbleObject("String_Node_Str"));
}