Program: 44047
Project: 44047
Buggy source:
public void refrashOverlay(){
  overlayI=new BufferedImage(this.getWidth() + 1,this.getHeight() + 1,BufferedImage.TYPE_INT_ARGB);
  Graphics g=overlayI.getGraphics();
  Changeset ch=drawStyle.getSelectedChangeset();
  long changesetid=-1;
  if (ch != null) {
    changesetid=ch.id;
  }
 else {
    Node node=drawStyle.getSelectedNode();
    if (node != null)     changesetid=node.changesetId;
  }
  if (changesetid != -1) {
    System.out.println("String_Node_Str" + changesetid);
    Iterator<Long> iterator=dc.nodes.keySet().iterator();
    if (iterator.hasNext()) {
      Node n=dc.nodes.get(iterator.next());
      double left=-360;
      double right=-360;
      double top=-360;
      double bottom=-360;
      while (iterator.hasNext()) {
        Node node=dc.nodes.get(iterator.next());
        if (node.changesetId == changesetid) {
          if (left > node.lat || left == -360)           left=node.lat;
          if (right < node.lat || right == -360)           right=node.lat;
          if (top < node.lon || top == -360)           top=node.lon;
          if (bottom > node.lon || bottom == -360)           bottom=node.lon;
        }
      }
      Point p1=this.getMapPosition(left,top,false);
      Point p2=this.getMapPosition(right,bottom,false);
      if (p1 != null && p2 != null) {
        System.out.println(p1.x + "String_Node_Str" + p1.y+ "String_Node_Str"+ (p2.x - p1.x)+ "String_Node_Str"+ (p2.y - p1.y));
        g.setColor(new Color(255,0,0,30));
        g.fillRect(p2.x,p2.y,p1.x - p2.x,p1.y - p2.y);
      }
    }
  }
  g.setColor(Color.BLACK);
  if (drawStyle != null) {
    Iterator<Long> iterator=dc.nodes.keySet().iterator();
    while (iterator.hasNext()) {
      Node node=dc.nodes.get(iterator.next());
      drawStyle.drawNode(g,this,node);
    }
  }
  MapFilter mf=Configuration.instance.getSelectedProfile().getMapFilter();
  if (mf instanceof DrawerOverlay) {
    DrawerOverlay dov=(DrawerOverlay)mf;
    dov.draw(g,this);
  }
  repaint();
}

Fixed version (ground truth):
public void refrashOverlay(){
  overlayI=new BufferedImage(this.getWidth() + 1,this.getHeight() + 1,BufferedImage.TYPE_INT_ARGB);
  Graphics g=overlayI.getGraphics();
  Changeset ch=drawStyle.getSelectedChangeset();
  long changesetid=-1;
  if (ch != null) {
    changesetid=ch.id;
  }
 else {
    Node node=drawStyle.getSelectedNode();
    if (node != null)     changesetid=node.changesetId;
  }
  if (changesetid != -1) {
    System.out.println("String_Node_Str" + changesetid);
    Iterator<Long> iterator=dc.nodes.keySet().iterator();
    if (iterator.hasNext()) {
      Node n=dc.nodes.get(iterator.next());
      double left=-360;
      double right=-360;
      double top=-360;
      double bottom=-360;
      while (iterator.hasNext()) {
        Node node=dc.nodes.get(iterator.next());
        if (node.changesetId == changesetid) {
          if (left > node.lat || left == -360)           left=node.lat;
          if (right < node.lat || right == -360)           right=node.lat;
          if (top < node.lon || top == -360)           top=node.lon;
          if (bottom > node.lon || bottom == -360)           bottom=node.lon;
        }
      }
      Point p1=this.getMapPosition(left,top,false);
      Point p2=this.getMapPosition(right,bottom,false);
      if (p1 != null && p2 != null) {
        System.out.println(p1.x + "String_Node_Str" + p1.y+ "String_Node_Str"+ (p2.x - p1.x)+ "String_Node_Str"+ (p2.y - p1.y));
        g.setColor(new Color(255,0,0,30));
        g.fillRect(p2.x,p2.y,p1.x - p2.x,p1.y - p2.y);
      }
    }
  }
  g.setColor(Color.BLACK);
  if (drawStyle != null) {
    Iterator<Long> iterator=dc.nodes.keySet().iterator();
    while (iterator.hasNext()) {
      Node node=dc.nodes.get(iterator.next());
      drawStyle.drawNode(g,this,node);
    }
  }
  Profile p=Configuration.instance.getSelectedProfile();
  if (p != null) {
    MapFilter mf=p.getMapFilter();
    if (mf instanceof DrawerOverlay) {
      DrawerOverlay dov=(DrawerOverlay)mf;
      dov.draw(g,this);
    }
  }
  repaint();
}