Program: 161784
Project: 161784
Buggy source:
@Override protected void toSVG(RRDiagramToSVG rrDiagramToSVG,int xOffset,int yOffset,SvgContent svgContent){
  LayoutInfo layoutInfo1=rrElement.getLayoutInfo();
  int width1=layoutInfo1.getWidth();
  int maxWidth=width1;
  int yOffset2=yOffset;
  LayoutInfo layoutInfo=getLayoutInfo();
  int connectorOffset=layoutInfo.getConnectorOffset();
  int y1=yOffset;
  int loopOffset=0;
  int loopWidth=0;
  if (loopElement != null) {
    LayoutInfo layoutInfo2=loopElement.getLayoutInfo();
    loopWidth=layoutInfo2.getWidth();
    maxWidth=Math.max(maxWidth,loopWidth);
    loopOffset=xOffset + 20 + (maxWidth - loopWidth) / 2;
    yOffset2+=5 + layoutInfo2.getHeight();
    y1+=layoutInfo2.getConnectorOffset();
  }
 else {
    yOffset2+=15;
    y1+=5;
  }
  int x1=xOffset + 10;
  int x2=xOffset + 20 + maxWidth+ 10+ cardinalitiesWidth;
  int y2=yOffset + connectorOffset;
  svgContent.addLineConnector(x1 - 10,y2,x1 + 10 + (maxWidth - width1) / 2,y2);
  int loopPathStartX=x1 + 5;
  svgContent.addPathConnector(x1 + 5,y2,"String_Node_Str",x1,y2 - 5);
  svgContent.addLineConnector(x1,y2 - 5,x1,y1 + 5);
  svgContent.addPathConnector(x1,y1 + 5,"String_Node_Str",x1 + 5,y1);
  if (loopElement != null) {
    svgContent.addLineConnector(x1 + 5,y1,loopOffset,y1);
    loopElement.toSVG(rrDiagramToSVG,loopOffset,yOffset,svgContent);
    loopPathStartX=loopOffset + loopWidth;
  }
  svgContent.addLineConnector(loopPathStartX,y1,x2 - 5,y1);
  svgContent.addPathConnector(x2 - 5,y1,"String_Node_Str",x2,y1 + 5);
  svgContent.addLineConnector(x2,y1 + 5,x2,y2 - 5);
  svgContent.addPathConnector(x2,y2 - 5,"String_Node_Str",x2 - 5,y2);
  if (cardinalitiesText != null) {
    String cssClass=RRDiagram.CSS_LOOP_CARDINALITIES_TEXT_CLASS;
    if (!svgContent.isStyleDefined(cssClass)) {
      Font loopFont=rrDiagramToSVG.getLoopFont();
      String loopTextColor=Utils.convertColorToHtml(rrDiagramToSVG.getLoopTextColor());
      cssClass=svgContent.setCSSClass(cssClass,"String_Node_Str" + loopTextColor + "String_Node_Str"+ Utils.convertFontToCss(loopFont));
    }
    svgContent.addElement("String_Node_Str" + cssClass + "String_Node_Str"+ (x2 - cardinalitiesWidth)+ "String_Node_Str"+ (y2 - fontYOffset - 5)+ "String_Node_Str"+ Utils.escapeXML(cardinalitiesText)+ "String_Node_Str");
  }
  rrElement.toSVG(rrDiagramToSVG,xOffset + 20 + (maxWidth - width1) / 2,yOffset2,svgContent);
  svgContent.addLineConnector(x2 - cardinalitiesWidth - 10- (maxWidth - width1) / 2,y2,xOffset + layoutInfo.getWidth(),y2);
}

Fixed version (ground truth):
@Override protected void toSVG(RRDiagramToSVG rrDiagramToSVG,int xOffset,int yOffset,SvgContent svgContent){
  LayoutInfo layoutInfo1=rrElement.getLayoutInfo();
  int width1=layoutInfo1.getWidth();
  int maxWidth=width1;
  int yOffset2=yOffset;
  LayoutInfo layoutInfo=getLayoutInfo();
  int connectorOffset=layoutInfo.getConnectorOffset();
  int y1=yOffset;
  int loopOffset=0;
  int loopWidth=0;
  if (loopElement != null) {
    LayoutInfo layoutInfo2=loopElement.getLayoutInfo();
    loopWidth=layoutInfo2.getWidth();
    maxWidth=Math.max(maxWidth,loopWidth);
    loopOffset=xOffset + 20 + (maxWidth - loopWidth) / 2;
    yOffset2+=5 + layoutInfo2.getHeight();
    y1+=layoutInfo2.getConnectorOffset();
  }
 else {
    yOffset2+=15;
    y1+=5;
  }
  int x1=xOffset + 10;
  int x2=xOffset + 20 + maxWidth+ 10+ cardinalitiesWidth;
  int y2=yOffset + connectorOffset;
  svgContent.addLineConnector(x1 - 10,y2,x1 + 10 + (maxWidth - width1) / 2,y2);
  int loopPathStartX=x1 + 5;
  svgContent.addPathConnector(x1 + 5,y2,"String_Node_Str",x1,y2 - 5);
  svgContent.addLineConnector(x1,y2 - 5,x1,y1 + 5);
  svgContent.addPathConnector(x1,y1 + 5,"String_Node_Str",x1 + 5,y1);
  if (loopElement != null) {
    svgContent.addLineConnector(x1 + 5,y1,loopOffset,y1);
    loopElement.toSVG(rrDiagramToSVG,loopOffset,yOffset,svgContent);
    loopPathStartX=loopOffset + loopWidth;
  }
  svgContent.addLineConnector(loopPathStartX,y1,x2 - 5,y1);
  svgContent.addPathConnector(x2 - 5,y1,"String_Node_Str",x2,y1 + 5);
  svgContent.addLineConnector(x2,y1 + 5,x2,y2 - 5);
  svgContent.addPathConnector(x2,y2 - 5,"String_Node_Str",x2 - 5,y2);
  if (cardinalitiesText != null) {
    String cssClass=svgContent.getDefinedCSSClass(RRDiagram.CSS_LOOP_CARDINALITIES_TEXT_CLASS);
    if (cssClass == null) {
      Font loopFont=rrDiagramToSVG.getLoopFont();
      String loopTextColor=Utils.convertColorToHtml(rrDiagramToSVG.getLoopTextColor());
      cssClass=svgContent.setCSSClass(RRDiagram.CSS_LOOP_CARDINALITIES_TEXT_CLASS,"String_Node_Str" + loopTextColor + "String_Node_Str"+ Utils.convertFontToCss(loopFont));
    }
    svgContent.addElement("String_Node_Str" + cssClass + "String_Node_Str"+ (x2 - cardinalitiesWidth)+ "String_Node_Str"+ (y2 - fontYOffset - 5)+ "String_Node_Str"+ Utils.escapeXML(cardinalitiesText)+ "String_Node_Str");
  }
  rrElement.toSVG(rrDiagramToSVG,xOffset + 20 + (maxWidth - width1) / 2,yOffset2,svgContent);
  svgContent.addLineConnector(x2 - cardinalitiesWidth - 10- (maxWidth - width1) / 2,y2,xOffset + layoutInfo.getWidth(),y2);
}