Program: 31098
Project: 31098
Buggy source:
@Override public void mouseReleased(Canvas canvas,Graphics g,MouseEvent e){
  Component added=null;
  if (state == SHOW_ADD) {
    Circuit circ=canvas.getCircuit();
    if (!canvas.getProject().getLogisimFile().contains(circ))     return;
    if (shouldSnap)     Canvas.snapToGrid(e);
    moveTo(canvas,g,e.getX(),e.getY());
    Location loc=Location.create(e.getX(),e.getY());
    AttributeSet attrsCopy=(AttributeSet)attrs.clone();
    ComponentFactory source=getFactory();
    if (source == null)     return;
    Component c=source.createComponent(loc,attrsCopy);
    if (circ.hasConflict(c)) {
      canvas.setErrorMessage(Strings.getter("String_Node_Str"));
      return;
    }
    Bounds bds=c.getBounds(g);
    if (bds.getX() < 0 || bds.getY() < 0) {
      canvas.setErrorMessage(Strings.getter("String_Node_Str"));
      return;
    }
    try {
      CircuitMutation mutation=new CircuitMutation(circ);
      mutation.add(c);
      Action action=mutation.toAction(Strings.getter("String_Node_Str",factory.getDisplayGetter()));
      canvas.getProject().doAction(action);
      lastAddition=action;
      added=c;
      if (attrs.containsAttribute(StdAttr.LABEL)) {
        if (AutoLabler.hasNext())         attrs.setValue(StdAttr.LABEL,AutoLabler.GetNext());
 else         attrs.setValue(StdAttr.LABEL,"String_Node_Str");
      }
    }
 catch (    CircuitException ex) {
      JOptionPane.showMessageDialog(canvas.getProject().getFrame(),ex.getMessage());
    }
    setState(canvas,SHOW_GHOST);
  }
 else   if (state == SHOW_ADD_NO) {
    setState(canvas,SHOW_NONE);
  }
  Project proj=canvas.getProject();
  Tool next=determineNext(proj);
  if (next != null) {
    if (attrs.containsAttribute(StdAttr.LABEL))     attrs.setValue(StdAttr.LABEL,"String_Node_Str");
    AutoLabler.Stop();
    proj.setTool(next);
    Action act=SelectionActions.dropAll(canvas.getSelection());
    if (act != null) {
      proj.doAction(act);
    }
    if (added != null)     canvas.getSelection().add(added);
  }
}

Fixed version (ground truth):
@Override public void mouseReleased(Canvas canvas,Graphics g,MouseEvent e){
  Component added=null;
  if (state == SHOW_ADD) {
    Circuit circ=canvas.getCircuit();
    if (!canvas.getProject().getLogisimFile().contains(circ))     return;
    if (shouldSnap)     Canvas.snapToGrid(e);
    moveTo(canvas,g,e.getX(),e.getY());
    Location loc=Location.create(e.getX(),e.getY());
    AttributeSet attrsCopy=(AttributeSet)attrs.clone();
    attrsCopy.setValue(StdAttr.LABEL,AutoLabler.GetCurrent(canvas.getCircuit()));
    if (AutoLabler.IsActive(canvas.getCircuit())) {
      if (AutoLabler.hasNext(canvas.getCircuit()))       AutoLabler.GetNext(canvas.getCircuit());
 else       AutoLabler.Stop(canvas.getCircuit());
    }
 else     AutoLabler.SetLabel("String_Node_Str",canvas.getCircuit());
    ComponentFactory source=getFactory();
    if (source == null)     return;
    Component c=source.createComponent(loc,attrsCopy);
    if (circ.hasConflict(c)) {
      canvas.setErrorMessage(Strings.getter("String_Node_Str"));
      return;
    }
    Bounds bds=c.getBounds(g);
    if (bds.getX() < 0 || bds.getY() < 0) {
      canvas.setErrorMessage(Strings.getter("String_Node_Str"));
      return;
    }
    try {
      CircuitMutation mutation=new CircuitMutation(circ);
      mutation.add(c);
      Action action=mutation.toAction(Strings.getter("String_Node_Str",factory.getDisplayGetter()));
      canvas.getProject().doAction(action);
      lastAddition=action;
      added=c;
      canvas.repaint();
    }
 catch (    CircuitException ex) {
      JOptionPane.showMessageDialog(canvas.getProject().getFrame(),ex.getMessage());
    }
    setState(canvas,SHOW_GHOST);
  }
 else   if (state == SHOW_ADD_NO) {
    setState(canvas,SHOW_NONE);
  }
  Project proj=canvas.getProject();
  Tool next=determineNext(proj);
  if (next != null) {
    proj.setTool(next);
    Action act=SelectionActions.dropAll(canvas.getSelection());
    if (act != null) {
      proj.doAction(act);
    }
    if (added != null)     canvas.getSelection().add(added);
  }
}