Program: 143938
Project: 143938
Buggy source:
/** 
 * Create a new terminal plugin and initialize the terminal emulation.
 */
public Terminal(final PluginBus bus,final String id){
  super(bus,id);
  if (!personalJava) {
    menu=new Menu("String_Node_Str");
    MenuItem item;
    menu.add(item=new MenuItem("String_Node_Str"));
    item.addActionListener(new ActionListener(){
      public void actionPerformed(      ActionEvent e){
        Font font=terminal.getFont();
        terminal.setFont(new Font(font.getName(),font.getStyle(),font.getSize() - 1));
        if (tPanel.getParent() != null) {
          Component parent=tPanel.getParent();
          if (parent instanceof java.awt.Frame)           ((java.awt.Frame)parent).pack();
          tPanel.getParent().doLayout();
          tPanel.getParent().validate();
        }
      }
    }
);
    menu.add(item=new MenuItem("String_Node_Str"));
    item.addActionListener(new ActionListener(){
      public void actionPerformed(      ActionEvent e){
        Font font=terminal.getFont();
        terminal.setFont(new Font(font.getName(),font.getStyle(),font.getSize() + 1));
        if (tPanel.getParent() != null) {
          Component parent=tPanel.getParent();
          if (parent instanceof java.awt.Frame)           ((java.awt.Frame)parent).pack();
          tPanel.getParent().doLayout();
          tPanel.getParent().validate();
        }
      }
    }
);
    menu.add(item=new MenuItem("String_Node_Str"));
    item.addActionListener(new ActionListener(){
      public void actionPerformed(      ActionEvent e){
        terminal.reset();
      }
    }
);
  }
  terminal=new vt320(){
    public void write(    byte[] b){
      try {
        Terminal.this.write(b);
      }
 catch (      IOException e) {
        reader=null;
      }
    }
  }
;
  tPanel=new Panel(new BorderLayout()){
    public void update(    java.awt.Graphics g){
      paint(g);
    }
  }
;
  tPanel.add("String_Node_Str",terminal);
  terminal.addFocusListener(new FocusListener(){
    public void focusGained(    FocusEvent evt){
      terminal.setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));
      bus.broadcast(new FocusStatus(Terminal.this,evt));
    }
    public void focusLost(    FocusEvent evt){
      terminal.setCursor(Cursor.getDefaultCursor());
      bus.broadcast(new FocusStatus(Terminal.this,evt));
    }
  }
);
  bus.registerPluginListener(new OnlineStatusListener(){
    public void online(){
      if (debug > 0)       System.err.println("String_Node_Str" + reader);
      if (reader == null) {
        reader=new Thread(Terminal.this);
        reader.start();
      }
    }
    public void offline(){
      if (debug > 0)       System.err.println("String_Node_Str");
      if (reader != null)       reader=null;
    }
  }
);
  bus.registerPluginListener(new TerminalTypeListener(){
    public String getTerminalType(){
      return terminal.getTerminalID();
    }
  }
);
  bus.registerPluginListener(new WindowSizeListener(){
    public Dimension getWindowSize(){
      return terminal.getScreenSize();
    }
  }
);
  bus.registerPluginListener(new LocalEchoListener(){
    public void setLocalEcho(    boolean echo){
      terminal.setLocalEcho(echo);
    }
  }
);
  bus.registerPluginListener(new ConfigurationListener(){
    public void setConfiguration(    PluginConfig config){
      configure(config);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Create a new terminal plugin and initialize the terminal emulation.
 */
public Terminal(final PluginBus bus,final String id){
  super(bus,id);
  if (!personalJava) {
    menu=new Menu("String_Node_Str");
    MenuItem item;
    menu.add(item=new MenuItem("String_Node_Str"));
    item.addActionListener(new ActionListener(){
      public void actionPerformed(      ActionEvent e){
        Font font=terminal.getFont();
        terminal.setFont(new Font(font.getName(),font.getStyle(),font.getSize() - 1));
        if (tPanel.getParent() != null) {
          Component parent=tPanel.getParent();
          if (parent instanceof java.awt.Frame)           ((java.awt.Frame)parent).pack();
          tPanel.getParent().doLayout();
          tPanel.getParent().validate();
        }
      }
    }
);
    menu.add(item=new MenuItem("String_Node_Str"));
    item.addActionListener(new ActionListener(){
      public void actionPerformed(      ActionEvent e){
        Font font=terminal.getFont();
        terminal.setFont(new Font(font.getName(),font.getStyle(),font.getSize() + 1));
        if (tPanel.getParent() != null) {
          Component parent=tPanel.getParent();
          if (parent instanceof java.awt.Frame)           ((java.awt.Frame)parent).pack();
          tPanel.getParent().doLayout();
          tPanel.getParent().validate();
        }
      }
    }
);
    menu.add(item=new MenuItem("String_Node_Str"));
    item.addActionListener(new ActionListener(){
      public void actionPerformed(      ActionEvent e){
        terminal.setBufferSize(terminal.getBufferSize() + 50);
      }
    }
);
    menu.add(item=new MenuItem("String_Node_Str"));
    item.addActionListener(new ActionListener(){
      public void actionPerformed(      ActionEvent e){
        terminal.setBufferSize(terminal.getBufferSize() - 50);
      }
    }
);
    menu.addSeparator();
    menu.add(item=new MenuItem("String_Node_Str"));
    item.addActionListener(new ActionListener(){
      public void actionPerformed(      ActionEvent e){
        terminal.reset();
      }
    }
);
  }
  terminal=new vt320(){
    public void write(    byte[] b){
      try {
        Terminal.this.write(b);
      }
 catch (      IOException e) {
        reader=null;
      }
    }
  }
;
  tPanel=new Panel(new BorderLayout()){
    public void update(    java.awt.Graphics g){
      paint(g);
    }
  }
;
  tPanel.add("String_Node_Str",terminal);
  terminal.addFocusListener(new FocusListener(){
    public void focusGained(    FocusEvent evt){
      terminal.setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));
      bus.broadcast(new FocusStatus(Terminal.this,evt));
    }
    public void focusLost(    FocusEvent evt){
      terminal.setCursor(Cursor.getDefaultCursor());
      bus.broadcast(new FocusStatus(Terminal.this,evt));
    }
  }
);
  bus.registerPluginListener(new OnlineStatusListener(){
    public void online(){
      if (debug > 0)       System.err.println("String_Node_Str" + reader);
      if (reader == null) {
        reader=new Thread(Terminal.this);
        reader.start();
      }
    }
    public void offline(){
      if (debug > 0)       System.err.println("String_Node_Str");
      if (reader != null)       reader=null;
    }
  }
);
  bus.registerPluginListener(new TerminalTypeListener(){
    public String getTerminalType(){
      return terminal.getTerminalID();
    }
  }
);
  bus.registerPluginListener(new WindowSizeListener(){
    public Dimension getWindowSize(){
      return terminal.getScreenSize();
    }
  }
);
  bus.registerPluginListener(new LocalEchoListener(){
    public void setLocalEcho(    boolean echo){
      terminal.setLocalEcho(echo);
    }
  }
);
  bus.registerPluginListener(new ConfigurationListener(){
    public void setConfiguration(    PluginConfig config){
      configure(config);
    }
  }
);
}