Program: 6698
Project: 6698
Buggy source:
private void processAnchors(TSNetwork network){
  for (  AnchorPoint anchor : network.getAnchorPoints()) {
    Map<Integer,Set<Double>> offsets=new HashMap<Integer,Set<Double>>();
    for (    Map.Entry<Integer,Bundle> entry : anchor.getBundles().entrySet()) {
      Bundle bundle=entry.getValue();
      int theta=entry.getKey();
      for (      LineInfo li : bundle.lines_) {
        double offset=li.getOffset(anchor);
        int rotTheta=this.rotateTheta(theta,(li.corr_.fPoint() == anchor ? -90 : 90));
        if (!offsets.containsKey(rotTheta)) {
          offsets.put(rotTheta,new HashSet<Double>());
        }
        offsets.get(rotTheta).add(offset);
      }
    }
    Map<Integer,Double> meanOffsets=new HashMap<Integer,Double>();
    List<Line2D> lines=new ArrayList<Line2D>();
    for (    int rt : offsets.keySet()) {
      double maxOffset=0, minOffset=Double.MAX_VALUE;
      for (      double offset : offsets.get(rt)) {
        minOffset=Math.min(minOffset,offset);
        maxOffset=Math.max(maxOffset,offset);
      }
      double meanOffset=(minOffset + maxOffset) / 2;
      int oppTheta=this.oppositeTheta(rt);
      if (meanOffsets.containsKey(oppTheta) && meanOffsets.get(oppTheta) == meanOffset) {
      }
 else {
        meanOffsets.put(rt,meanOffset);
        double rtRad=Math.toRadians(rt);
        double x1=anchor.getX() + meanOffset * Math.cos(rtRad);
        double y1=anchor.getY() + meanOffset * Math.sin(rtRad);
        double x2=x1 + Math.cos(rtRad + Math.PI / 2);
        double y2=y1 + Math.sin(rtRad + Math.PI / 2);
        Line2D line=new Line2D.Double(x1,y1,x2,y2);
        lines.add(line);
      }
    }
    anchor.clearBundleOffsets();
    if (lines.size() == 1) {
      anchor.addBundleOffset(new Point2D.Double(lines.get(0).getP1().getX() - anchor.getX(),lines.get(0).getP1().getY() - anchor.getY()));
    }
 else {
      for (int a=0; a < lines.size(); a++) {
        for (int b=a + 1; b < lines.size(); b++) {
          Point2D isect=FPUtil.lineLineIntersection(lines.get(a),lines.get(b));
          if (isect != null) {
            Point2D.Double isectOffset=new Point2D.Double(isect.getX() - anchor.getX(),isect.getY() - anchor.getY());
            anchor.addBundleOffset(isectOffset);
          }
 else {
            anchor.addBundleOffset(new Point2D.Double(lines.get(a).getP1().getX() - anchor.getX(),lines.get(a).getP1().getY() - anchor.getY()));
            anchor.addBundleOffset(new Point2D.Double(lines.get(b).getP1().getX() - anchor.getX(),lines.get(b).getP1().getY() - anchor.getY()));
          }
        }
      }
    }
    anchor.computeOffsetCenter();
  }
}

Fixed version (ground truth):
private void processAnchors(TSNetwork network){
  for (  AnchorPoint anchor : network.getAnchorPoints()) {
    Map<Integer,Set<Double>> offsets=new HashMap<Integer,Set<Double>>();
    for (    Map.Entry<Integer,Bundle> entry : anchor.getBundles().entrySet()) {
      Bundle bundle=entry.getValue();
      int theta=entry.getKey();
      for (      LineInfo li : bundle.lines_) {
        double offset=li.getOffset(anchor);
        int rotTheta=this.rotateTheta(theta,-90);
        if (!offsets.containsKey(rotTheta)) {
          offsets.put(rotTheta,new HashSet<Double>());
        }
        offsets.get(rotTheta).add(offset);
      }
    }
    Map<Integer,Double> meanOffsets=new HashMap<Integer,Double>();
    List<Line2D> lines=new ArrayList<Line2D>();
    for (    int rt : offsets.keySet()) {
      double maxOffset=-Double.MAX_VALUE, minOffset=Double.MAX_VALUE;
      for (      double offset : offsets.get(rt)) {
        minOffset=Math.min(minOffset,offset);
        maxOffset=Math.max(maxOffset,offset);
      }
      double meanOffset=(minOffset + maxOffset) / 2;
      int oppTheta=this.oppositeTheta(rt);
      if (meanOffsets.containsKey(oppTheta) && -meanOffsets.get(oppTheta) == meanOffset) {
      }
 else {
        meanOffsets.put(rt,meanOffset);
        double rtRad=Math.toRadians(rt);
        double x1=anchor.getX() + meanOffset * Math.cos(rtRad);
        double y1=anchor.getY() + meanOffset * Math.sin(rtRad);
        double x2=x1 + Math.cos(rtRad + Math.PI / 2);
        double y2=y1 + Math.sin(rtRad + Math.PI / 2);
        Line2D line=new Line2D.Double(x1,y1,x2,y2);
        lines.add(line);
      }
    }
    anchor.clearBundleOffsets();
    if (lines.size() == 1) {
      anchor.addBundleOffset(new Point2D.Double(lines.get(0).getP1().getX() - anchor.getX(),lines.get(0).getP1().getY() - anchor.getY()));
    }
 else {
      for (int a=0; a < lines.size(); a++) {
        for (int b=a + 1; b < lines.size(); b++) {
          Point2D isect=FPUtil.lineLineIntersection(lines.get(a),lines.get(b));
          if (isect != null) {
            Point2D.Double isectOffset=new Point2D.Double(isect.getX() - anchor.getX(),isect.getY() - anchor.getY());
            anchor.addBundleOffset(isectOffset);
          }
 else {
            anchor.addBundleOffset(new Point2D.Double(lines.get(a).getP1().getX() - anchor.getX(),lines.get(a).getP1().getY() - anchor.getY()));
            anchor.addBundleOffset(new Point2D.Double(lines.get(b).getP1().getX() - anchor.getX(),lines.get(b).getP1().getY() - anchor.getY()));
          }
        }
      }
    }
    anchor.computeOffsetCenter();
  }
}