Program: 75923
Project: 75923
Buggy source:
/** 
 * Construct a panel for interacting with the specified Ptolemy II model. The layout argument should be one of HORIZONTAL or VERTICAL; it determines whether the controls are put to the left of, or above the placeable displays.  The show argument should be a bitwise or of any of BUTTONS, TOP_PARAMETERS, or DIRECTOR_PARAMETERS. Or it can be 0, in which case, no controls are shown. If BUTTONS is included, then a panel of buttons, go, pause, resume, and stop, are shown.  If TOP_PARAMETERS is included, then the top-level parameters of the model are included. If DIRECTOR_PARAMETERS is included, then the paramters of the director are included.
 * @param model The model to control.
 * @param layout HORIZONTAL or VERTICAL layout.
 * @param show Indicator of which controls to show.
 */
public ModelPane(final CompositeActor model,int layout,int show){
  if (layout == HORIZONTAL) {
    setLayout(new BoxLayout(this,BoxLayout.X_AXIS));
  }
 else {
    setLayout(new BoxLayout(this,BoxLayout.Y_AXIS));
  }
  _layout=layout;
  if (show != 0) {
    _controlPanel=new JPanel();
    _controlPanel.setLayout(new BoxLayout(_controlPanel,BoxLayout.Y_AXIS));
    _controlPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
    if ((show & BUTTONS) != 0) {
      _buttonPanel=new JPanel();
      _buttonPanel.setLayout(new BoxLayout(_buttonPanel,BoxLayout.X_AXIS));
      _buttonPanel.setBorder(BorderFactory.createEmptyBorder(10,0,10,0));
      _buttonPanel.setAlignmentX(LEFT_ALIGNMENT);
      _goButton=new JButton("String_Node_Str");
      _goButton.setToolTipText("String_Node_Str");
      _goButton.setAlignmentX(LEFT_ALIGNMENT);
      _buttonPanel.add(_goButton);
      _buttonPanel.add(Box.createRigidArea(new Dimension(10,0)));
      _goButton.addActionListener(new ActionListener(){
        public void actionPerformed(        ActionEvent evt){
          startRun();
        }
      }
);
      _pauseButton=new JButton("String_Node_Str");
      _pauseButton.setToolTipText("String_Node_Str");
      _buttonPanel.add(_pauseButton);
      _buttonPanel.add(Box.createRigidArea(new Dimension(10,0)));
      _pauseButton.addActionListener(new ActionListener(){
        public void actionPerformed(        ActionEvent evt){
          pauseRun();
        }
      }
);
      _resumeButton=new JButton("String_Node_Str");
      _resumeButton.setToolTipText("String_Node_Str");
      _buttonPanel.add(_resumeButton);
      _buttonPanel.add(Box.createRigidArea(new Dimension(10,0)));
      _resumeButton.addActionListener(new ActionListener(){
        public void actionPerformed(        ActionEvent evt){
          resumeRun();
        }
      }
);
      _stopButton=new JButton("String_Node_Str");
      _stopButton.setToolTipText("String_Node_Str");
      _buttonPanel.add(_stopButton);
      _stopButton.addActionListener(new ActionListener(){
        public void actionPerformed(        ActionEvent evt){
          stopRun();
        }
      }
);
      _controlPanel.add(_buttonPanel);
      _buttonPanel.setBackground(null);
    }
    add(_controlPanel);
    _controlPanel.setBackground(null);
  }
  _show=show;
  setModel(model);
}

Fixed version (ground truth):
/** 
 * Construct a panel for interacting with the specified Ptolemy II model. The layout argument should be one of HORIZONTAL or VERTICAL; it determines whether the controls are put to the left of, or above the placeable displays.  The show argument should be a bitwise or of any of BUTTONS, TOP_PARAMETERS, or DIRECTOR_PARAMETERS. Or it can be 0, in which case, no controls are shown. If BUTTONS is included, then a panel of buttons, go, pause, resume, and stop, are shown.  If TOP_PARAMETERS is included, then the top-level parameters of the model are included. If DIRECTOR_PARAMETERS is included, then the paramters of the director are included.
 * @param model The model to control.
 * @param layout HORIZONTAL or VERTICAL layout.
 * @param show Indicator of which controls to show.
 */
public ModelPane(final CompositeActor model,int layout,int show){
  if (layout == HORIZONTAL) {
    setLayout(new BoxLayout(this,BoxLayout.X_AXIS));
  }
 else {
    setLayout(new BoxLayout(this,BoxLayout.Y_AXIS));
  }
  _layout=layout;
  if (show != 0) {
    _controlPanel=new JPanel();
    _controlPanel.setLayout(new BoxLayout(_controlPanel,BoxLayout.Y_AXIS));
    _controlPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
    ClickListener clickListener=new ClickListener();
    _controlPanel.addMouseListener(clickListener);
    _controlPanel.addKeyListener(new CommandListener());
    if ((show & BUTTONS) != 0) {
      _buttonPanel=new JPanel();
      _buttonPanel.setLayout(new BoxLayout(_buttonPanel,BoxLayout.X_AXIS));
      _buttonPanel.addMouseListener(clickListener);
      _buttonPanel.setBorder(BorderFactory.createEmptyBorder(10,0,10,0));
      _buttonPanel.setAlignmentX(LEFT_ALIGNMENT);
      _goButton=new JButton("String_Node_Str");
      _goButton.setToolTipText("String_Node_Str");
      _goButton.setAlignmentX(LEFT_ALIGNMENT);
      _buttonPanel.add(_goButton);
      _buttonPanel.add(Box.createRigidArea(new Dimension(10,0)));
      _goButton.addActionListener(new ActionListener(){
        public void actionPerformed(        ActionEvent evt){
          startRun();
        }
      }
);
      _pauseButton=new JButton("String_Node_Str");
      _pauseButton.setToolTipText("String_Node_Str");
      _buttonPanel.add(_pauseButton);
      _buttonPanel.add(Box.createRigidArea(new Dimension(10,0)));
      _pauseButton.addActionListener(new ActionListener(){
        public void actionPerformed(        ActionEvent evt){
          pauseRun();
        }
      }
);
      _resumeButton=new JButton("String_Node_Str");
      _resumeButton.setToolTipText("String_Node_Str");
      _buttonPanel.add(_resumeButton);
      _buttonPanel.add(Box.createRigidArea(new Dimension(10,0)));
      _resumeButton.addActionListener(new ActionListener(){
        public void actionPerformed(        ActionEvent evt){
          resumeRun();
        }
      }
);
      _stopButton=new JButton("String_Node_Str");
      _stopButton.setToolTipText("String_Node_Str");
      _buttonPanel.add(_stopButton);
      _stopButton.addActionListener(new ActionListener(){
        public void actionPerformed(        ActionEvent evt){
          stopRun();
        }
      }
);
      _controlPanel.add(_buttonPanel);
      _buttonPanel.setBackground(null);
    }
    add(_controlPanel);
    _controlPanel.setBackground(null);
  }
  _show=show;
  setModel(model);
}