Program: 190553
Project: 190553
Buggy source:
public void renderPotato(PotatoImpl potato){
  this.potato=potato;
  loadConfig();
  triangleBuffer=new ArrayList<float[]>();
  disksBuffer=new ArrayList<float[]>();
  for (  Node node : potato.getContent()) {
    createCircle(node.x(),node.y(),RAYON);
    for (int cote=0; cote < 4; cote++) {
      double origine_i, origine_j, step_i, step_j, sens_i, sens_j;
      int g_tailleGrille=NB_SUBDIVISIONS;
      if (cote == 0) {
        origine_i=node.x() - RAYON * Math.sqrt(2.0) / 2.0;
        origine_j=node.y();
        step_i=-INTER;
        step_j=INTER;
        sens_i=1;
        sens_j=1;
      }
 else       if (cote == 1) {
        origine_i=node.x() - RAYON * Math.sqrt(2.0) / 2.0;
        origine_j=node.y() - RAYON * Math.sqrt(2.0) / 2.0;
        step_i=-INTER;
        step_j=-INTER;
        sens_i=1;
        sens_j=1;
      }
 else       if (cote == 2) {
        origine_i=node.x() - RAYON * Math.sqrt(2.0) / 2.0;
        origine_j=node.y() - RAYON * Math.sqrt(2.0) / 2.0;
        step_i=-INTER;
        step_j=-INTER;
        sens_i=1;
        sens_j=1;
      }
 else {
        origine_i=node.x() + RAYON * Math.sqrt(2.0) / 2.0;
        origine_j=node.y() - RAYON * Math.sqrt(2.0) / 2.0;
        step_i=INTER;
        step_j=-INTER;
        sens_i=1;
        sens_j=1;
      }
      boolean finCote=false;
      while (!finCote) {
        finCote=true;
        boolean bl=false, br=false, tr=false, tl=false;
        double fbl, fbr, ftr, ftl;
        float p1x, p1y, p2x, p2y, p3x, p3y, p4x, p4y;
        int actifs;
        for (int k=0; k < g_tailleGrille; k++) {
          int i=0, j=0;
          if (cote == 0 || cote == 1) {
            i=k;
          }
 else {
            j=k;
          }
          double LEFT=left(i,origine_i);
          double BOTTOM=bottom(j,origine_j);
          double RIGHT=right(i + sens_i,origine_i);
          double TOP=top(j + sens_j,origine_j);
          fbl=calculBlob(LEFT,BOTTOM,node);
          if (fbl >= INFLUENCE) {
            bl=true;
          }
 else {
            bl=false;
          }
          fbr=calculBlob(RIGHT,BOTTOM,node);
          if (fbr >= INFLUENCE) {
            br=true;
          }
 else {
            br=false;
          }
          ftr=calculBlob(RIGHT,TOP,node);
          if (ftr >= INFLUENCE) {
            tr=true;
          }
 else {
            tr=false;
          }
          ftl=calculBlob(LEFT,TOP,node);
          if (ftl >= INFLUENCE) {
            tl=true;
          }
 else {
            tl=false;
          }
          if (!bl && !br && !tr&& !tl) {
            continue;
          }
 else           if ((!bl || (bl && fbl == -1)) && (!br || (br && fbr == -1)) && (!tr || (tr && ftr == -1))&& (!tl || (tl && ftl == -1))) {
            continue;
          }
          finCote=false;
          actifs=(bl ? 1 : 0) + (br ? 1 : 0) + (tr ? 1 : 0)+ (tl ? 1 : 0);
          if (actifs == 0) {
            continue;
          }
          float LEFTf=(float)LEFT;
          float TOPf=(float)TOP;
          float RIGHTf=(float)RIGHT;
          float BOTTOMf=(float)BOTTOM;
          p1x=LEFTf;
          p1y=(float)(j * INTER + INTER * inter_lin(fbl,ftl) + origine_j);
          p2x=(float)(i * INTER + INTER * inter_lin(fbl,fbr) + origine_i);
          p2y=BOTTOMf;
          p3x=RIGHTf;
          p3y=(float)(j * INTER + INTER * inter_lin(fbr,ftr) + origine_j);
          p4x=(float)(i * INTER + INTER * inter_lin(ftl,ftr) + origine_i);
          p4y=TOPf;
          if (actifs == 4) {
            createSquare(LEFTf,BOTTOMf,RIGHTf,BOTTOMf,RIGHTf,TOPf,LEFTf,TOPf);
          }
 else           if (actifs == 3) {
            if (!bl) {
              createTriangle(p1x,p1y,p2x,p2y,RIGHTf,BOTTOMf);
              createTriangle(p1x,p1y,RIGHTf,BOTTOMf,RIGHTf,TOPf);
              createTriangle(p1x,p1y,RIGHTf,TOPf,LEFTf,TOPf);
            }
 else             if (!br) {
              createTriangle(LEFTf,BOTTOMf,p2x,p2y,p3x,p3y);
              createTriangle(LEFTf,BOTTOMf,p3x,p3y,RIGHTf,TOPf);
              createTriangle(LEFTf,BOTTOMf,RIGHTf,TOPf,LEFTf,TOPf);
            }
 else             if (!tr) {
              createTriangle(p3x,p3y,p4x,p4y,LEFTf,TOPf);
              createTriangle(p3x,p3y,LEFTf,TOPf,LEFTf,BOTTOMf);
              createTriangle(p3x,p3y,LEFTf,BOTTOMf,RIGHTf,BOTTOMf);
            }
 else             if (!tl) {
              createTriangle(p4x,p4y,p1x,p1y,LEFTf,BOTTOMf);
              createTriangle(p4x,p4y,LEFTf,BOTTOMf,RIGHTf,BOTTOMf);
              createTriangle(p4x,p4y,RIGHTf,BOTTOMf,RIGHTf,TOPf);
            }
          }
 else           if (actifs == 2) {
            if (bl == tl) {
              if (bl) {
                createSquare(p2x,p2y,p4x,p4y,LEFTf,TOPf,LEFTf,BOTTOMf);
              }
 else {
                createSquare(p2x,p2y,RIGHTf,BOTTOMf,RIGHTf,TOPf,p4x,p4y);
              }
            }
 else             if (bl == br) {
              if (bl) {
                createSquare(LEFTf,BOTTOMf,RIGHTf,BOTTOMf,p3x,p3y,p1x,p1y);
              }
 else {
                createSquare(p3x,p3y,RIGHTf,TOPf,LEFTf,TOPf,p1x,p1y);
              }
            }
 else {
              if (bl == tr && !bl) {
                createTriangle(p1x,p1y,p2x,p2y,RIGHTf,BOTTOMf);
                createTriangle(p1x,p1y,RIGHTf,BOTTOMf,p3x,p3y);
                createTriangle(p1x,p1y,p3x,p3y,p4x,p4y);
                createTriangle(p1x,p1y,p4x,p4y,LEFTf,TOPf);
              }
 else {
                createTriangle(LEFTf,BOTTOMf,p2x,p2y,p3x,p3y);
                createTriangle(LEFTf,BOTTOMf,p3x,p3y,RIGHTf,TOPf);
                createTriangle(LEFTf,BOTTOMf,RIGHTf,TOPf,p4x,p4y);
                createTriangle(LEFTf,BOTTOMf,p4x,p4y,p1x,p1y);
              }
            }
          }
 else           if (actifs == 1) {
            if (bl) {
              createTriangle(p1x,p1y,LEFTf,BOTTOMf,p2x,p2y);
            }
 else             if (br) {
              createTriangle(p2x,p2y,RIGHTf,BOTTOMf,p3x,p3y);
            }
 else             if (tr) {
              createTriangle(p3x,p3y,RIGHTf,TOPf,p4x,p4y);
            }
 else             if (tl) {
              createTriangle(p4x,p4y,LEFTf,TOPf,p1x,p1y);
            }
          }
        }
        origine_i+=step_i;
        origine_j+=step_j;
        g_tailleGrille+=2;
      }
    }
  }
  PotatoDisplay display=new PotatoDisplay(triangleBuffer,disksBuffer);
  potato.setDisplay(display);
}

Fixed version (ground truth):
public void renderPotato(PotatoImpl potato){
  this.potato=potato;
  triangleBuffer=new ArrayList<float[]>();
  disksBuffer=new ArrayList<float[]>();
  for (  Node node : potato.getContent()) {
    loadConfig(node);
    createCircle(node.x(),node.y(),RAYON);
    for (int cote=0; cote < 4; cote++) {
      double origine_i, origine_j, step_i, step_j, sens_i, sens_j;
      int g_tailleGrille=NB_SUBDIVISIONS;
      if (cote == 0) {
        origine_i=node.x() - RAYON * Math.sqrt(2.0) / 2.0;
        origine_j=node.y();
        step_i=-INTER;
        step_j=INTER;
        sens_i=1;
        sens_j=1;
      }
 else       if (cote == 1) {
        origine_i=node.x() - RAYON * Math.sqrt(2.0) / 2.0;
        origine_j=node.y() - RAYON * Math.sqrt(2.0) / 2.0;
        step_i=-INTER;
        step_j=-INTER;
        sens_i=1;
        sens_j=1;
      }
 else       if (cote == 2) {
        origine_i=node.x() - RAYON * Math.sqrt(2.0) / 2.0;
        origine_j=node.y() - RAYON * Math.sqrt(2.0) / 2.0;
        step_i=-INTER;
        step_j=-INTER;
        sens_i=1;
        sens_j=1;
      }
 else {
        origine_i=node.x() + RAYON * Math.sqrt(2.0) / 2.0;
        origine_j=node.y() - RAYON * Math.sqrt(2.0) / 2.0;
        step_i=INTER;
        step_j=-INTER;
        sens_i=1;
        sens_j=1;
      }
      boolean finCote=false;
      while (!finCote) {
        finCote=true;
        boolean bl=false, br=false, tr=false, tl=false;
        double fbl, fbr, ftr, ftl;
        float p1x, p1y, p2x, p2y, p3x, p3y, p4x, p4y;
        int actifs;
        for (int k=0; k < g_tailleGrille; k++) {
          int i=0, j=0;
          if (cote == 0 || cote == 1) {
            i=k;
          }
 else {
            j=k;
          }
          double LEFT=left(i,origine_i);
          double BOTTOM=bottom(j,origine_j);
          double RIGHT=right(i + sens_i,origine_i);
          double TOP=top(j + sens_j,origine_j);
          fbl=calculBlob(LEFT,BOTTOM,node);
          if (fbl >= INFLUENCE) {
            bl=true;
          }
 else {
            bl=false;
          }
          fbr=calculBlob(RIGHT,BOTTOM,node);
          if (fbr >= INFLUENCE) {
            br=true;
          }
 else {
            br=false;
          }
          ftr=calculBlob(RIGHT,TOP,node);
          if (ftr >= INFLUENCE) {
            tr=true;
          }
 else {
            tr=false;
          }
          ftl=calculBlob(LEFT,TOP,node);
          if (ftl >= INFLUENCE) {
            tl=true;
          }
 else {
            tl=false;
          }
          if (!bl && !br && !tr&& !tl) {
            continue;
          }
 else           if ((!bl || (bl && fbl == -1)) && (!br || (br && fbr == -1)) && (!tr || (tr && ftr == -1))&& (!tl || (tl && ftl == -1))) {
            continue;
          }
          finCote=false;
          actifs=(bl ? 1 : 0) + (br ? 1 : 0) + (tr ? 1 : 0)+ (tl ? 1 : 0);
          if (actifs == 0) {
            continue;
          }
          float LEFTf=(float)LEFT;
          float TOPf=(float)TOP;
          float RIGHTf=(float)RIGHT;
          float BOTTOMf=(float)BOTTOM;
          p1x=LEFTf;
          p1y=(float)(j * INTER + INTER * inter_lin(fbl,ftl) + origine_j);
          p2x=(float)(i * INTER + INTER * inter_lin(fbl,fbr) + origine_i);
          p2y=BOTTOMf;
          p3x=RIGHTf;
          p3y=(float)(j * INTER + INTER * inter_lin(fbr,ftr) + origine_j);
          p4x=(float)(i * INTER + INTER * inter_lin(ftl,ftr) + origine_i);
          p4y=TOPf;
          if (actifs == 4) {
            createSquare(LEFTf,BOTTOMf,RIGHTf,BOTTOMf,RIGHTf,TOPf,LEFTf,TOPf);
          }
 else           if (actifs == 3) {
            if (!bl) {
              createTriangle(p1x,p1y,p2x,p2y,RIGHTf,BOTTOMf);
              createTriangle(p1x,p1y,RIGHTf,BOTTOMf,RIGHTf,TOPf);
              createTriangle(p1x,p1y,RIGHTf,TOPf,LEFTf,TOPf);
            }
 else             if (!br) {
              createTriangle(LEFTf,BOTTOMf,p2x,p2y,p3x,p3y);
              createTriangle(LEFTf,BOTTOMf,p3x,p3y,RIGHTf,TOPf);
              createTriangle(LEFTf,BOTTOMf,RIGHTf,TOPf,LEFTf,TOPf);
            }
 else             if (!tr) {
              createTriangle(p3x,p3y,p4x,p4y,LEFTf,TOPf);
              createTriangle(p3x,p3y,LEFTf,TOPf,LEFTf,BOTTOMf);
              createTriangle(p3x,p3y,LEFTf,BOTTOMf,RIGHTf,BOTTOMf);
            }
 else             if (!tl) {
              createTriangle(p4x,p4y,p1x,p1y,LEFTf,BOTTOMf);
              createTriangle(p4x,p4y,LEFTf,BOTTOMf,RIGHTf,BOTTOMf);
              createTriangle(p4x,p4y,RIGHTf,BOTTOMf,RIGHTf,TOPf);
            }
          }
 else           if (actifs == 2) {
            if (bl == tl) {
              if (bl) {
                createSquare(p2x,p2y,p4x,p4y,LEFTf,TOPf,LEFTf,BOTTOMf);
              }
 else {
                createSquare(p2x,p2y,RIGHTf,BOTTOMf,RIGHTf,TOPf,p4x,p4y);
              }
            }
 else             if (bl == br) {
              if (bl) {
                createSquare(LEFTf,BOTTOMf,RIGHTf,BOTTOMf,p3x,p3y,p1x,p1y);
              }
 else {
                createSquare(p3x,p3y,RIGHTf,TOPf,LEFTf,TOPf,p1x,p1y);
              }
            }
 else {
              if (bl == tr && !bl) {
                createTriangle(p1x,p1y,p2x,p2y,RIGHTf,BOTTOMf);
                createTriangle(p1x,p1y,RIGHTf,BOTTOMf,p3x,p3y);
                createTriangle(p1x,p1y,p3x,p3y,p4x,p4y);
                createTriangle(p1x,p1y,p4x,p4y,LEFTf,TOPf);
              }
 else {
                createTriangle(LEFTf,BOTTOMf,p2x,p2y,p3x,p3y);
                createTriangle(LEFTf,BOTTOMf,p3x,p3y,RIGHTf,TOPf);
                createTriangle(LEFTf,BOTTOMf,RIGHTf,TOPf,p4x,p4y);
                createTriangle(LEFTf,BOTTOMf,p4x,p4y,p1x,p1y);
              }
            }
          }
 else           if (actifs == 1) {
            if (bl) {
              createTriangle(p1x,p1y,LEFTf,BOTTOMf,p2x,p2y);
            }
 else             if (br) {
              createTriangle(p2x,p2y,RIGHTf,BOTTOMf,p3x,p3y);
            }
 else             if (tr) {
              createTriangle(p3x,p3y,RIGHTf,TOPf,p4x,p4y);
            }
 else             if (tl) {
              createTriangle(p4x,p4y,LEFTf,TOPf,p1x,p1y);
            }
          }
        }
        origine_i+=step_i;
        origine_j+=step_j;
        g_tailleGrille+=2;
      }
    }
  }
  PotatoDisplay display=new PotatoDisplay(triangleBuffer,disksBuffer);
  potato.setDisplay(display);
  System.out.println("String_Node_Str" + potato.getNode().getIndex());
}