Program: 170221
Project: 170221
Buggy source:
void draw(Graphics2D g){
  if (!visible && this != driver.selBlock) {
    showZones(g);
    return;
  }
  if (this == driver.selBlock && !(this instanceof ProcessBlock)) {
    showArrowEndAreas(g);
    return;
  }
  calcDiagMaxAndMin(cx - width / 2,cx + width / 2,cy - height / 2,cy + height / 2);
  int tlx=cx - width / 2;
  int tly=cy - height / 2;
  g.setFont(driver.fontg);
  g.setColor(Color.BLACK);
  g.drawRoundRect(tlx,tly,width,height,6,6);
  if (this == driver.selBlock)   g.setColor(new Color(255,255,200));
 else   g.setColor(new Color(200,255,255));
  g.fillRoundRect(tlx + 1,tly + 1,width - 1,height - 1,6,6);
  if (multiplex) {
    int x, y;
    String s=mpxfactor;
    if (s == null)     s="String_Node_Str";
    int i=s.length() * driver.fontWidth + 10;
    x=tlx - i;
    y=cy - 20 / 2;
    g.setColor(Color.BLACK);
    g.drawRoundRect(x,y,i - 1,20,2,2);
    if (this == driver.selBlock)     g.setColor(new Color(255,255,200));
 else     g.setColor(new Color(200,255,255));
    g.fillRoundRect(x + 1,y + 1,i - 2,19,2,2);
    g.setColor(Color.BLACK);
    if (mpxfactor != null)     g.drawString(mpxfactor,x + 5,y + 15);
  }
  g.setColor(Color.BLACK);
  if (isSubnet)   g.drawRoundRect(tlx + 2,tly + 2,width - 4,height - 4,6,6);
  if (description != null) {
    centreDesc(g);
  }
  if (!visible && this == driver.selBlock)   g.drawLine(tlx,tly,cx + width / 2,cy + height / 2);
  int y=cy + height / 2 + driver.fontHeight + driver.fontHeight / 2;
  if (diagramFileName != null) {
    Font fontsave=g.getFont();
    g.setFont(driver.fontf);
    g.setColor(Color.GRAY);
    File gFile=new File(diagramFileName);
    String name=gFile.getName();
    int x=cx - name.length() * driver.fontWidth / 2;
    g.drawString(name,x,y);
    g.setFont(fontsave);
    y+=driver.fontHeight;
  }
  String name=null;
  if (diag.diagLang != null && diag.diagLang.label.equals("String_Node_Str")) {
    if (javaClass != null) {
      Font fontsave=g.getFont();
      g.setFont(driver.fontf);
      g.setColor(Color.BLUE);
      name=javaClass.getSimpleName() + "String_Node_Str";
      int x=cx - name.length() * driver.fontWidth / 2;
      g.drawString(name,x,y);
      g.setFont(fontsave);
      y+=driver.fontHeight;
    }
 else     if (fullClassName != null) {
      Font fontsave=g.getFont();
      g.setFont(driver.fontf);
      name="String_Node_Str";
      int x=cx - name.length() * driver.fontWidth / 2;
      g.drawString(name,x,y);
      g.setFont(fontsave);
      y+=driver.fontHeight;
      name=fullClassName;
      g.setColor(Color.RED);
      x=cx - name.length() * driver.fontWidth / 2;
      g.drawString(name,x,y);
      g.setFont(fontsave);
      g.setColor(Color.BLACK);
      y+=driver.fontHeight;
    }
  }
  if (codeFileName != null) {
    Font fontsave=g.getFont();
    g.setFont(driver.fontf);
    name=codeFileName;
    int i=name.lastIndexOf(File.separator);
    if (i == -1)     i=name.lastIndexOf("String_Node_Str");
    name=name.substring(i + 1);
    g.setColor(Color.BLACK);
    int x=cx - name.length() * driver.fontWidth / 2;
    g.drawString(name,x,y);
    g.setFont(fontsave);
    g.setColor(Color.BLACK);
  }
  if (hNeighbour != null) {
    g.setColor(Color.ORANGE);
    if (hNeighbour.cx < cx)     g.drawLine(hNeighbour.cx - hNeighbour.width / 2,hNeighbour.cy + hNeighbour.height / 2,cx + width / 2,hNeighbour.cy + hNeighbour.height / 2);
 else     g.drawLine(hNeighbour.cx + hNeighbour.width / 2,hNeighbour.cy + hNeighbour.height / 2,cx - width / 2,hNeighbour.cy + hNeighbour.height / 2);
    g.setColor(Color.BLACK);
  }
  if (vNeighbour != null) {
    g.setColor(Color.ORANGE);
    if (vNeighbour.cy < cy)     g.drawLine(vNeighbour.cx - vNeighbour.width / 2,vNeighbour.cy - vNeighbour.height / 2,vNeighbour.cx - vNeighbour.width / 2,cy + height / 2);
 else     g.drawLine(vNeighbour.cx - vNeighbour.width / 2,vNeighbour.cy + vNeighbour.height / 2,vNeighbour.cx - vNeighbour.width / 2,cy - height / 2);
    g.setColor(Color.BLACK);
  }
  if (driver.curDiag.arrowRoot != null) {
    if (driver.arrowEndForDragging == null || !driver.arrowEndForDragging.headMarked && !driver.arrowEndForDragging.tailMarked) {
{
        Color col=g.getColor();
        g.setColor(Color.BLUE);
        g.drawOval(driver.curDiag.arrowRoot.x - 5,driver.curDiag.arrowRoot.y - 5,10,10);
        g.setColor(col);
      }
    }
  }
}

Fixed version (ground truth):
void draw(Graphics2D g){
  if (!visible && this != driver.selBlock) {
    showZones(g);
    return;
  }
  if (this == driver.selBlock && !(this instanceof ProcessBlock)) {
    showArrowEndAreas(g);
    return;
  }
  calcDiagMaxAndMin(cx - width / 2,cx + width / 2,cy - height / 2,cy + height / 2);
  int tlx=cx - width / 2;
  int tly=cy - height / 2;
  g.setFont(driver.fontg);
  g.setColor(Color.BLACK);
  g.drawRoundRect(tlx,tly,width,height,6,6);
  if (this == driver.selBlock)   g.setColor(new Color(255,255,200));
 else   g.setColor(new Color(200,255,255));
  g.fillRoundRect(tlx + 1,tly + 1,width - 1,height - 1,6,6);
  if (multiplex) {
    int x, y;
    String s=mpxfactor;
    if (s == null)     s="String_Node_Str";
    int i=s.length() * driver.fontWidth + 10;
    x=tlx - i;
    y=cy - 20 / 2;
    g.setColor(Color.BLACK);
    g.drawRoundRect(x,y,i - 1,20,2,2);
    if (this == driver.selBlock)     g.setColor(new Color(255,255,200));
 else     g.setColor(new Color(200,255,255));
    g.fillRoundRect(x + 1,y + 1,i - 2,19,2,2);
    g.setColor(Color.BLACK);
    if (mpxfactor != null)     g.drawString(mpxfactor,x + 5,y + 15);
  }
  g.setColor(Color.BLACK);
  if (isSubnet)   g.drawRoundRect(tlx + 2,tly + 2,width - 4,height - 4,6,6);
  if (description != null) {
    centreDesc(g);
  }
  if (!visible && this == driver.selBlock)   g.drawLine(tlx,tly,cx + width / 2,cy + height / 2);
  int y=cy + height / 2 + driver.fontHeight + driver.fontHeight / 2;
  if (diagramFileName != null) {
    Font fontsave=g.getFont();
    g.setFont(driver.fontf);
    g.setColor(Color.GRAY);
    File gFile=new File(diagramFileName);
    String name=gFile.getName();
    int x=cx - name.length() * driver.fontWidth / 2;
    g.drawString(name,x,y);
    g.setFont(fontsave);
    y+=driver.fontHeight;
  }
  String name=null;
  if (diag.diagLang != null && diag.diagLang.label.equals("String_Node_Str")) {
    if (javaClass != null) {
      Font fontsave=g.getFont();
      g.setFont(driver.fontf);
      g.setColor(Color.BLUE);
      name=javaClass.getSimpleName() + "String_Node_Str";
      int x=cx - name.length() * driver.fontWidth / 2;
      g.drawString(name,x,y);
      g.setFont(fontsave);
      y+=driver.fontHeight;
    }
 else     if (fullClassName != null) {
      Font fontsave=g.getFont();
      g.setFont(driver.fontf);
      name="String_Node_Str";
      int x=cx - name.length() * driver.fontWidth / 2;
      g.drawString(name,x,y);
      g.setFont(fontsave);
      y+=driver.fontHeight;
      name=fullClassName;
      g.setColor(Color.RED);
      x=cx - name.length() * driver.fontWidth / 2;
      g.drawString(name,x,y);
      g.setFont(fontsave);
      g.setColor(Color.BLACK);
      y+=driver.fontHeight;
    }
  }
  if (codeFileName != null) {
    Font fontsave=g.getFont();
    g.setFont(driver.fontf);
    name=codeFileName;
    int i=name.lastIndexOf(File.separator);
    if (i == -1)     i=name.lastIndexOf("String_Node_Str");
    name=name.substring(i + 1);
    g.setColor(Color.BLACK);
    int x=cx - name.length() * driver.fontWidth / 2;
    g.drawString(name,x,y);
    g.setFont(fontsave);
    g.setColor(Color.BLACK);
  }
  if (hNeighbour != null) {
    g.setColor(Color.ORANGE);
    if (hNeighbour.cx < cx)     g.drawLine(hNeighbour.cx - hNeighbour.width / 2,hNeighbour.cy + hNeighbour.height / 2,cx + width / 2,hNeighbour.cy + hNeighbour.height / 2);
 else     g.drawLine(hNeighbour.cx + hNeighbour.width / 2,hNeighbour.cy + hNeighbour.height / 2,cx - width / 2,hNeighbour.cy + hNeighbour.height / 2);
    g.setColor(Color.BLACK);
  }
  if (vNeighbour != null) {
    g.setColor(Color.ORANGE);
    if (vNeighbour.cy < cy)     g.drawLine(vNeighbour.cx - vNeighbour.width / 2,vNeighbour.cy - vNeighbour.height / 2,vNeighbour.cx - vNeighbour.width / 2,cy + height / 2);
 else     g.drawLine(vNeighbour.cx - vNeighbour.width / 2,vNeighbour.cy + vNeighbour.height / 2,vNeighbour.cx - vNeighbour.width / 2,cy - height / 2);
    g.setColor(Color.BLACK);
  }
  if (driver.curDiag.arrowRoot != null) {
    if (driver.arrowEndForDragging == null || !driver.arrowEndForDragging.headMarked && !driver.arrowEndForDragging.tailMarked) {
{
        Color col=g.getColor();
        g.setColor(Color.BLUE);
        g.drawOval(driver.curDiag.arrowRoot.x - 4,driver.curDiag.arrowRoot.y - 4,8,8);
        g.setColor(col);
      }
    }
  }
}