Program: 6704
Project: 6704
Buggy source:
public Path2D getPathBW(int offsetFrom,int offsetTo,Line2D prevLine,Line2D nextLine,MapCoordinates coords){
  double tol=.0001;
  Path2D path=new Path2D.Double();
  Point2D fPoint=new Point2D.Double(x1(),y1()), tPoint=new Point2D.Double(x2(),y2());
  if (offsetFrom != 0 || offsetTo != 0)   applyOffsets(fPoint,tPoint,offsetFrom,offsetTo,coords);
  double x1=fPoint.getX(), y1=fPoint.getY();
  double x2=tPoint.getX(), y2=tPoint.getY();
  if (isStraight()) {
    Line2D thisLine=new Line2D.Double(x1,y1,x2,y2);
    double thisTheta=FPUtil.getTheta(thisLine);
    if (thisTheta >= Math.PI)     thisTheta-=Math.PI;
    if (prevLine != null) {
      double prevTheta=FPUtil.getTheta(prevLine);
      if (prevTheta >= Math.PI)       prevTheta-=Math.PI;
      if (Math.abs(prevTheta - thisTheta) >= tol) {
        Point2D isect=FPUtil.lineLineIntersection(prevLine,thisLine);
        if (isect != null) {
          x2=isect.getX();
          y2=isect.getY();
        }
      }
    }
    if (nextLine != null) {
      double nextTheta=FPUtil.getTheta(nextLine);
      if (nextTheta >= Math.PI)       nextTheta-=Math.PI;
      if (Math.abs(nextTheta - thisTheta) >= tol) {
        Point2D isect=FPUtil.lineLineIntersection(nextLine,thisLine);
        if (isect != null) {
          x1=isect.getX();
          y1=isect.getY();
        }
      }
    }
    path.moveTo(x2,y2);
    path.lineTo(x1,y1);
    path.transform(coords.getScaleTransform());
    path.transform(coords.getTranslateTransform());
    return path;
  }
  path.moveTo(x2,y2);
  if (offsetFrom == 0 && offsetTo == 0) {
    path.append(defaultArcBW_,true);
    path.lineTo(x1,y1);
  }
 else {
    Point2D.Double e=constructElbow(x1,y1,x2,y2);
    double l=radiusW_ / Math.tan(thetaR_ / 2);
    double rw=radiusW_;
    double shortest=Math.min(FPUtil.magnitude(x1,y1,e.x,e.y),FPUtil.magnitude(x2,y2,e.x,e.y));
    if (shortest < l) {
      l=shortest;
      rw=l * Math.tan(thetaR_ / 2);
    }
    Arc2D arc=constructArcBW(x1,y1,x2,y2,e,l,rw);
    path.append(arc,true);
    path.lineTo(x1,y1);
  }
  path.transform(coords.getScaleTransform());
  path.transform(coords.getTranslateTransform());
  return path;
}

Fixed version (ground truth):
public Path2D getPathBW(int offsetFrom,int offsetTo,Line2D prevLine,Line2D nextLine,MapCoordinates coords){
  double tol=.0001;
  Path2D path=new Path2D.Double();
  Point2D fPoint=new Point2D.Double(x1(),y1()), tPoint=new Point2D.Double(x2(),y2());
  if (offsetFrom != 0 || offsetTo != 0)   applyOffsets(fPoint,tPoint,offsetFrom,offsetTo,coords);
  double x1=fPoint.getX(), y1=fPoint.getY();
  double x2=tPoint.getX(), y2=tPoint.getY();
  if (isStraight()) {
    Line2D thisLine=new Line2D.Double(x1,y1,x2,y2);
    double thisTheta=FPUtil.getTheta(thisLine);
    if (thisTheta >= Math.PI)     thisTheta-=Math.PI;
    if (prevLine != null) {
      double prevTheta=FPUtil.getTheta(prevLine);
      if (prevTheta >= Math.PI)       prevTheta-=Math.PI;
      if (Math.abs(prevTheta - thisTheta) >= tol) {
        Point2D isect=FPUtil.lineLineIntersection(prevLine,thisLine);
        if (isect != null) {
          x2=isect.getX();
          y2=isect.getY();
        }
      }
    }
    if (nextLine != null) {
      double nextTheta=FPUtil.getTheta(nextLine);
      if (nextTheta >= Math.PI)       nextTheta-=Math.PI;
      if (Math.abs(nextTheta - thisTheta) >= tol) {
        Point2D isect=FPUtil.lineLineIntersection(nextLine,thisLine);
        if (isect != null) {
          x1=isect.getX();
          y1=isect.getY();
        }
      }
    }
    path.moveTo(x2,y2);
    path.lineTo(x1,y1);
    path.transform(coords.getScaleTransform());
    path.transform(coords.getTranslateTransform());
    return path;
  }
  path.moveTo(x2,y2);
  if (offsetFrom == 0 && offsetTo == 0) {
    path.append(defaultArcBW_,true);
    path.lineTo(x1,y1);
  }
 else {
    Point2D.Double e=constructElbow(x1,y1,x2,y2);
    double l=radiusW_ / Math.tan(thetaR_ / 2);
    double rw=radiusW_;
    double shortest=Math.min(FPUtil.magnitude(x1,y1,e.x,e.y),FPUtil.magnitude(x2,y2,e.x,e.y));
    if (shortest < l) {
      l=shortest;
      rw=l * Math.tan(thetaR_ / 2);
    }
    Arc2D arc=constructArcBW(x1,y1,x2,y2,e,l,rw);
    System.out.println("String_Node_Str" + arc.toString());
    path.append(arc,true);
    path.lineTo(x1,y1);
  }
  path.transform(coords.getScaleTransform());
  path.transform(coords.getTranslateTransform());
  return path;
}