Program: 21594
Project: 21594
Buggy source:
public JComponent getComponent(OTObject otObject){
  wrapper=(OTOverlayWrapper)otObject;
  overlay=wrapper.getOverlay();
  groupListManager=wrapper.getOTObjectService().getOTrunkService(OTGroupListManager.class);
  overlayManager=wrapper.getOTObjectService().getOTrunkService(OTUserOverlayManager.class);
  wrappedObject=wrapper.getWrappedObject();
  if (overlay == null && groupListManager != null && overlayManager != null) {
    OTUserObject currentGroupMember=groupListManager.getCurrentGroupMember().getUserObject();
    overlay=overlayManager.getOverlay(currentGroupMember);
  }
  subview=createSubViewComponent(wrappedObject);
  mainPanel=new JPanel();
  mainPanel.setLayout(new GridBagLayout());
  noStretchConstraints=new GridBagConstraints();
  noStretchConstraints.anchor=GridBagConstraints.NORTHWEST;
  noStretchConstraints.weightx=0;
  noStretchConstraints.weighty=0;
  noStretchConstraints.fill=GridBagConstraints.NONE;
  noStretchConstraints.gridwidth=GridBagConstraints.REMAINDER;
  noStretchConstraints.ipady=5;
  stretchConstraints=new GridBagConstraints();
  stretchConstraints.anchor=GridBagConstraints.NORTHWEST;
  stretchConstraints.weightx=1;
  stretchConstraints.weighty=0;
  stretchConstraints.fill=GridBagConstraints.HORIZONTAL;
  stretchConstraints.gridwidth=GridBagConstraints.REMAINDER;
  stretchConstraints.ipady=5;
  mainPanel.add(subview,stretchConstraints);
  JPanel buttonPanel=new JPanel();
  buttonPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
  if (wrapper.getShowButton()) {
    submitButton=new JButton(wrapper.getButtonText());
    buttonPanel.add(submitButton);
    submitButton.addActionListener(new ActionListener(){
      public void actionPerformed(      ActionEvent e){
        saveData();
      }
    }
);
  }
  resultsObject=wrapper.getResultsObject();
  if (resultsObject != null) {
    JButton resultsButton=new JButton("String_Node_Str");
    buttonPanel.add(resultsButton);
    resultsButton.addActionListener(new ActionListener(){
      public void actionPerformed(      ActionEvent e){
        popUpResults();
      }
    }
);
  }
  submittedLabel=new JLabel("String_Node_Str");
  buttonPanel.add(submittedLabel);
  mainPanel.add(buttonPanel,stretchConstraints);
  return mainPanel;
}

Fixed version (ground truth):
public JComponent getComponent(OTObject otObject){
  wrapper=(OTOverlayWrapper)otObject;
  overlay=wrapper.getOverlay();
  groupListManager=wrapper.getOTObjectService().getOTrunkService(OTGroupListManager.class);
  overlayManager=wrapper.getOTObjectService().getOTrunkService(OTUserOverlayManager.class);
  wrappedObject=wrapper.getWrappedObject();
  if (overlay == null && groupListManager != null && overlayManager != null) {
    OTUserObject currentGroupMember=groupListManager.getCurrentGroupMember().getUserObject();
    overlay=overlayManager.getOverlay(currentGroupMember);
  }
  subview=createSubViewComponent(wrappedObject);
  mainPanel=new JPanel();
  mainPanel.setLayout(new GridBagLayout());
  noStretchConstraints=new GridBagConstraints();
  noStretchConstraints.anchor=GridBagConstraints.NORTHWEST;
  noStretchConstraints.weightx=0;
  noStretchConstraints.weighty=0;
  noStretchConstraints.fill=GridBagConstraints.NONE;
  noStretchConstraints.gridwidth=GridBagConstraints.REMAINDER;
  noStretchConstraints.ipady=5;
  stretchConstraints=new GridBagConstraints();
  stretchConstraints.anchor=GridBagConstraints.NORTHWEST;
  stretchConstraints.weightx=1;
  stretchConstraints.weighty=0;
  stretchConstraints.fill=GridBagConstraints.HORIZONTAL;
  stretchConstraints.gridwidth=GridBagConstraints.REMAINDER;
  stretchConstraints.ipady=5;
  mainPanel.add(subview,stretchConstraints);
  JPanel buttonPanel=new JPanel();
  buttonPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
  if (wrapper.getShowButton()) {
    submitButton=new JButton(wrapper.getButtonText());
    buttonPanel.add(submitButton);
    submitButton.addActionListener(new ActionListener(){
      public void actionPerformed(      ActionEvent e){
        saveData();
      }
    }
);
  }
  resultsObject=wrapper.getResultsObject();
  if (resultsObject != null) {
    JButton resultsButton=new JButton("String_Node_Str");
    buttonPanel.add(resultsButton);
    resultsButton.addActionListener(new ActionListener(){
      public void actionPerformed(      ActionEvent e){
        popUpResults();
      }
    }
);
  }
  submittedLabel=new JLabel("String_Node_Str");
  buttonPanel.add(submittedLabel);
  mainPanel.add(buttonPanel,stretchConstraints);
  invokeLater(10);
  return mainPanel;
}