nus-yam/ex-repair huggingface dataset:
Program: 95999
Project: 95999
Buggy source:
/** 
 * Tries to click in the cell under the mouse position. If the mouse is not over a cell, the current selected cell will be clicked on. If there is no selected cell, the middle of the table is used to click on.
 * @param count Number of clicks
 * @param button The mouse button
 */
public void gdClick(int count,int button){
  ITableAdapter adapter=getTableAdapter();
  Cell cell=null;
  if (isMouseOverCell()) {
    cell=getCellAtMousePosition();
  }
 else   if (adapter.hasCellSelection()) {
    cell=adapter.getSelectedCell();
  }
  if (cell != null) {
    Rectangle cellRect=adapter.scrollCellToVisible(cell.getRow(),cell.getCol());
    getRobot().click(getRealTable(),cellRect,ClickOptions.create().setClickCount(count).setMouseButton(button));
  }
 else {
    super.gdClick(count,button);
  }
}

Fixed version (ground truth):
/** 
 * Tries to click in the cell under the mouse position. If the mouse is not over a cell, the current selected cell will be clicked on. If there is no selected cell, the middle of the table is used to click on.
 * @param count Number of clicks
 * @param button The mouse button
 */
public void gdClick(int count,int button){
  ITableAdapter adapter=getTableAdapter();
  Cell cell=null;
  if (isMouseOverCell()) {
    cell=getCellAtMousePosition();
  }
 else   if (adapter.hasCellSelection()) {
    cell=adapter.getSelectedCell();
  }
  if (cell != null) {
    Rectangle cellRect=adapter.scrollCellToVisible(cell.getRow(),cell.getCol());
    Object robotSpecifcRectangle=getSpecificRectangle(cellRect);
    getRobot().click(getRealTable(),robotSpecifcRectangle,ClickOptions.create().setClickCount(count).setMouseButton(button));
  }
 else {
    super.gdClick(count,button);
  }
}
Program: 96000
Project: 96000
Buggy source:
/** 
 * {@inheritDoc}
 */
protected void closeMenu(IMenuAdapter menuBar,int[] path){
  if (menuBar.getRealComponent() instanceof JPopupMenu) {
    for (int i=0; i < path.length; i++) {
      getRobot().keyType(menuBar.getRealComponent(),KeyEvent.VK_ESCAPE);
    }
    return;
  }
  super.closeMenu(menuBar,path);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
protected void closeMenu(IMenuAdapter menuBar,int[] path){
  if (menuBar.getRealComponent() instanceof JPopupMenu) {
    for (int i=0; i < path.length; i++) {
      if (((JPopupMenu)menuBar.getRealComponent()).isVisible()) {
        getRobot().keyType(menuBar.getRealComponent(),KeyEvent.VK_ESCAPE);
      }
    }
    return;
  }
  super.closeMenu(menuBar,path);
}
Program: 96001
Project: 96001
Buggy source:
/** 
 * select MenuItem programatically (for Mac OS)
 */
public void selectProgramatically(){
  final MenuItem menuItem=m_menuItem;
  final InterceptorOptions options=new InterceptorOptions(new long[]{SWT.Selection});
  final IEventMatcher matcher=new SelectionSwtEventMatcher();
  RobotFactorySwtImpl robotSwt=new RobotFactorySwtImpl();
  IRobotEventInterceptor interceptor=robotSwt.getRobotEventInterceptor();
  final IRobotEventConfirmer confirmer=interceptor.intercept(options);
  final Event event=new Event();
  event.time=(int)System.currentTimeMillis();
  event.widget=menuItem;
  event.display=menuItem.getDisplay();
  event.type=SWT.Selection;
  getEventThreadQueuer().invokeLater("String_Node_Str",new Runnable(){
    public void run(){
      if ((menuItem.getStyle() & SWT.CHECK) == 0 || (menuItem.getStyle() & SWT.RADIO) == 0) {
        if (menuItem.getSelection()) {
          menuItem.setSelection(false);
        }
 else {
          menuItem.setSelection(true);
        }
      }
      menuItem.notifyListeners(SWT.Selection,event);
    }
  }
);
  try {
    confirmer.waitToConfirm(menuItem,matcher);
  }
 catch (  RobotException re) {
    final StringBuffer sb=new StringBuffer("String_Node_Str");
    sb.append("String_Node_Str");
    getEventThreadQueuer().invokeAndWait("String_Node_Str",new IRunnable(){
      public Object run() throws StepExecutionException {
        sb.append(menuItem);
        return null;
      }
    }
);
    throw re;
  }
}

Fixed version (ground truth):
/** 
 * select MenuItem programatically (for Mac OS)
 */
public void selectProgramatically(){
  final MenuItem menuItem=m_menuItem;
  final InterceptorOptions options=new InterceptorOptions(new long[]{SWT.Selection});
  final IEventMatcher matcher=new SelectionSwtEventMatcher();
  RobotFactorySwtImpl robotSwt=new RobotFactorySwtImpl();
  IRobotEventInterceptor interceptor=robotSwt.getRobotEventInterceptor();
  final IRobotEventConfirmer confirmer=interceptor.intercept(options);
  final Event event=new Event();
  event.time=(int)System.currentTimeMillis();
  event.widget=menuItem;
  event.display=menuItem.getDisplay();
  event.type=SWT.Selection;
  closeUnderMac();
  getEventThreadQueuer().invokeLater("String_Node_Str",new Runnable(){
    public void run(){
      if ((menuItem.getStyle() & SWT.CHECK) == 0 || (menuItem.getStyle() & SWT.RADIO) == 0) {
        if (menuItem.getSelection()) {
          menuItem.setSelection(false);
        }
 else {
          menuItem.setSelection(true);
        }
      }
      menuItem.notifyListeners(SWT.Selection,event);
    }
  }
);
  try {
    confirmer.waitToConfirm(menuItem,matcher);
  }
 catch (  RobotException re) {
    final StringBuffer sb=new StringBuffer("String_Node_Str");
    sb.append("String_Node_Str");
    getEventThreadQueuer().invokeAndWait("String_Node_Str",new IRunnable(){
      public Object run() throws StepExecutionException {
        sb.append(menuItem);
        return null;
      }
    }
);
    throw re;
  }
}
Program: 96002
Project: 96002
Buggy source:
public Object run() throws StepExecutionException {
  sb.append(menuItem);
  return null;
}

Fixed version (ground truth):
public void run(){
  Menu parentMenu=m_menuItem.getParent();
  while (parentMenu.getParentMenu() != null) {
    parentMenu=parentMenu.getParentMenu();
  }
  parentMenu.setVisible(false);
}
Program: 96003
Project: 96003
Buggy source:
/** 
 * Collect all problems
 * @param checkCompNamesPair boolean, also used to determine whether missing project problems will be reused or rechecked.
 * @param state ServerState
 */
private void doProblemsCheck(boolean checkCompNamesPair,ServerState state){
  clearOldProblems();
  IProjectPO project=GeneralStorage.getInstance().getProject();
  if (project == null) {
    problemNoProjectExists();
  }
 else {
    if (TestSuiteBP.getListOfTestSuites().isEmpty()) {
      problemNoTestSuiteExists();
    }
    checkAllTestSuites();
    checkAllAutConfigs();
    checkAllTestJobs();
    if (project.getIsProtected()) {
      problemProtectedProjectLoaded();
    }
  }
  if (checkCompNamesPair) {
    checkCompNamesPairs();
  }
 else {
    copyCompNamesProblems();
  }
  if (checkCompNamesPair) {
    checkMissingProjects();
  }
 else {
    copyMissingProjectProblems();
  }
  checkReusedProjectLanguages();
  checkServerState(state);
  collectAdditionalProblemsWhichShouldBeMarked();
  createMarkers();
  cleanupProblems();
  ProblemPropagator.getInstance().propagate();
}

Fixed version (ground truth):
/** 
 * Collect all problems
 * @param checkCompNamesPair boolean, also used to determine whether missing project problems will be reused or rechecked.
 * @param state ServerState
 */
private void doProblemsCheck(boolean checkCompNamesPair,ServerState state){
  clearOldProblems();
  IProjectPO project=GeneralStorage.getInstance().getProject();
  if (project != null) {
    if (TestSuiteBP.getListOfTestSuites().isEmpty()) {
      problemNoTestSuiteExists();
    }
    checkAllTestSuites();
    checkAllAutConfigs();
    checkAllTestJobs();
    if (project.getIsProtected()) {
      problemProtectedProjectLoaded();
    }
  }
  if (checkCompNamesPair) {
    checkCompNamesPairs();
  }
 else {
    copyCompNamesProblems();
  }
  if (checkCompNamesPair) {
    checkMissingProjects();
  }
 else {
    copyMissingProjectProblems();
  }
  checkReusedProjectLanguages();
  checkServerState(state);
  collectAdditionalProblemsWhichShouldBeMarked();
  createMarkers();
  cleanupProblems();
  ProblemPropagator.getInstance().propagate();
}
Program: 96004
Project: 96004
Buggy source:
/** 
 * Checks if there is a Connection to AutAgent
 * @param state ServerState
 */
private void checkServerState(ServerState state){
  final String serverPortPref=Plugin.getDefault().getPreferenceStore().getString(Constants.AUT_AGENT_SETTINGS_KEY);
  boolean isConnected=false;
  boolean isServerDefined=(serverPortPref.length() != 0);
  if (state == null) {
    try {
      isConnected=AutAgentConnection.getInstance().isConnected();
    }
 catch (    ConnectionException e) {
    }
  }
 else {
switch (state) {
case Connected:
      isConnected=true;
    break;
case Disconnected:
  isConnected=false;
break;
default :
break;
}
}
if (!isServerDefined) {
problemNoServerDefined();
}
 else if (!isConnected) {
problemNoAutStarterConnection();
}
}

Fixed version (ground truth):
/** 
 * Checks if there is a Connection to AutAgent
 * @param state ServerState
 */
private void checkServerState(ServerState state){
  final String serverPortPref=Plugin.getDefault().getPreferenceStore().getString(Constants.AUT_AGENT_SETTINGS_KEY);
  boolean isServerDefined=(serverPortPref.length() != 0);
  if (!isServerDefined) {
    problemNoServerDefined();
  }
}
Program: 96005
Project: 96005
Buggy source:
/** 
 * Clicks on a menu item
 * @param robot the robot
 * @param item the menu item
 */
public static void clickMenuItem(IRobot robot,JMenuItem item){
  if (!item.isEnabled()) {
    throw new StepExecutionException("String_Node_Str",EventFactory.createActionError(TestErrorEvent.MENU_ITEM_NOT_ENABLED));
  }
  if (item.getParent() instanceof JPopupMenu && ((JPopupMenu)item.getParent()).getInvoker().getParent() instanceof JMenuBar) {
    robot.click(item,null,ClickOptions.create().setClickType(ClickOptions.ClickType.RELEASED).setFirstHorizontal(true));
  }
 else {
    robot.click(item,null,ClickOptions.create().setClickType(ClickOptions.ClickType.RELEASED));
  }
}

Fixed version (ground truth):
/** 
 * Clicks on a menu item
 * @param robot the robot
 * @param item the menu item
 */
public static void clickMenuItem(IRobot robot,JMenuItem item){
  if (!item.isEnabled()) {
    throw new StepExecutionException("String_Node_Str",EventFactory.createActionError(TestErrorEvent.MENU_ITEM_NOT_ENABLED));
  }
  if (item.getParent() instanceof JPopupMenu && ((JPopupMenu)item.getParent()).getInvoker().getParent() instanceof JMenuBar) {
    robot.click(item,null,ClickOptions.create().setClickType(ClickOptions.ClickType.RELEASED).setFirstHorizontal(false));
  }
 else {
    robot.click(item,null,ClickOptions.create().setClickType(ClickOptions.ClickType.RELEASED));
  }
}
Program: 96006
Project: 96006
Buggy source:
/** 
 * {@inheritDoc}
 */
public IMenuAdapter openSubMenu(){
  if (!m_menuItem.isEnabled()) {
    throw new StepExecutionException("String_Node_Str",EventFactory.createActionError(TestErrorEvent.MENU_ITEM_NOT_ENABLED));
  }
  if (!(m_menuItem instanceof JMenu)) {
    throw new StepExecutionException("String_Node_Str",EventFactory.createActionError(TestErrorEvent.NOT_FOUND));
  }
  JMenu menu=(JMenu)m_menuItem;
  getRobot().click(m_menuItem,null,ClickOptions.create().setClickType(ClickOptions.ClickType.RELEASED));
  RobotTiming.sleepPostShowSubMenuItem(menu.getDelay());
  return getMenu();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public IMenuAdapter openSubMenu(){
  if (!m_menuItem.isEnabled()) {
    throw new StepExecutionException("String_Node_Str",EventFactory.createActionError(TestErrorEvent.MENU_ITEM_NOT_ENABLED));
  }
  if (!(m_menuItem instanceof JMenu)) {
    throw new StepExecutionException("String_Node_Str",EventFactory.createActionError(TestErrorEvent.NOT_FOUND));
  }
  JMenu menu=(JMenu)m_menuItem;
  clickMenuItem(getRobot(),m_menuItem);
  RobotTiming.sleepPostShowSubMenuItem(menu.getDelay());
  return getMenu();
}
Program: 96007
Project: 96007
Buggy source:
/** 
 * Clicks on a menu item
 * @param robot the robot
 * @param item  the menu item
 */
private void clickMenuItem(IRobot robot,JMenuItem item){
  if (!item.isEnabled()) {
    throw new StepExecutionException("String_Node_Str",EventFactory.createActionError(TestErrorEvent.MENU_ITEM_NOT_ENABLED));
  }
  robot.click(item,null,ClickOptions.create().setClickType(ClickOptions.ClickType.RELEASED));
}

Fixed version (ground truth):
/** 
 * Clicks on a menu item
 * @param robot the robot
 * @param item  the menu item
 */
private void clickMenuItem(IRobot robot,JMenuItem item){
  if (!item.isEnabled()) {
    throw new StepExecutionException("String_Node_Str",EventFactory.createActionError(TestErrorEvent.MENU_ITEM_NOT_ENABLED));
  }
  if (item.getParent() instanceof JPopupMenu && ((JPopupMenu)item.getParent()).getInvoker().getParent() instanceof JMenuBar) {
    robot.click(item,null,ClickOptions.create().setClickType(ClickOptions.ClickType.RELEASED).setFirstHorizontal(false));
  }
 else {
    robot.click(item,null,ClickOptions.create().setClickType(ClickOptions.ClickType.RELEASED));
  }
}
Program: 96008
Project: 96008
Buggy source:
/** 
 * Clicks on a menu item
 * @param robot the robot
 * @param item the menu item
 * @param clickCount the number of times to click the menu item
 */
public static void clickMenuItem(IRobot robot,final MenuItem item,int clickCount){
  robot.click(item,null,ClickOptions.create().setClickType(ClickOptions.ClickType.RELEASED).setStepMovement(false).setClickCount(clickCount));
}

Fixed version (ground truth):
/** 
 * Clicks on a menu item
 * @param robot the robot
 * @param item the menu item
 * @param clickCount the number of times to click the menu item
 */
private void clickMenuItem(IRobot robot,final MenuItem item,int clickCount){
  boolean isSecondInMenu=((Boolean)getEventThreadQueuer().invokeAndWait("String_Node_Str",new IRunnable(){
    public Object run() throws StepExecutionException {
      try {
        if ((item.getParent().getParentMenu().getStyle() & SWT.BAR) != 0) {
          return Boolean.TRUE;
        }
        Menu parent=item.getMenu().getParentMenu();
        if (parent != null) {
          Menu preparent=parent.getParentMenu();
          if (preparent != null) {
            return (preparent.getStyle() & SWT.BAR) != 0 ? Boolean.TRUE : Boolean.FALSE;
          }
        }
      }
 catch (      NullPointerException ne) {
      }
      return Boolean.FALSE;
    }
  }
)).booleanValue();
  if (isSecondInMenu) {
    robot.click(item,null,ClickOptions.create().setClickType(ClickOptions.ClickType.RELEASED).setStepMovement(true).setClickCount(clickCount).setFirstHorizontal(false));
  }
 else {
    robot.click(item,null,ClickOptions.create().setClickType(ClickOptions.ClickType.RELEASED).setStepMovement(true).setClickCount(clickCount));
  }
}
Program: 96010
Project: 96010
Buggy source:
/** 
 * notify listener about loading of a project
 * @param monitor The progress monitor for this poperation.
 */
public void fireProjectLoadedListener(IProgressMonitor monitor){
  new LoadProjectDataOperation().run(monitor);
}

Fixed version (ground truth):
/** 
 * notify listener about loading of a project
 * @param monitor The progress monitor for this operation.
 */
public void fireProjectLoadedListener(IProgressMonitor monitor){
  new LoadProjectDataOperation().run(monitor);
}
Program: 96011
Project: 96011
Buggy source:
/** 
 * private constructor
 */
private DataEventDispatcher(){
  GeneralStorage.getInstance().addReloadedSessListener(this);
  GeneralStorage.getInstance().addDataModifiedListener(this);
}

Fixed version (ground truth):
/** 
 * private constructor
 */
private DataEventDispatcher(){
  final GeneralStorage gs=GeneralStorage.getInstance();
  gs.addReloadedSessListener(this);
  gs.addDataModifiedListener(this);
}
Program: 96012
Project: 96012
Buggy source:
/** 
 * Constructor
 */
public InspectableAutSourceProvider(){
  DataEventDispatcher.getInstance().addProjectLoadedListener(this,true);
  DataEventDispatcher.getInstance().addProjectPropertiesModifyListener(this,true);
  AutAgentRegistration.getInstance().addListener(this);
}

Fixed version (ground truth):
/** 
 * Constructor
 */
public InspectableAutSourceProvider(){
  final DataEventDispatcher ded=DataEventDispatcher.getInstance();
  ded.addProjectLoadedListener(this,true);
  ded.addProjectStateListener(this);
  AutAgentRegistration.getInstance().addListener(this);
}
Program: 96013
Project: 96013
Buggy source:
/** 
 * {@inheritDoc}
 */
public void dispose(){
  DataEventDispatcher.getInstance().removeProjectLoadedListener(this);
  DataEventDispatcher.getInstance().removeProjectPropertiesModifyListener(this);
  AutAgentRegistration.getInstance().removeListener(this);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void dispose(){
  final DataEventDispatcher ded=DataEventDispatcher.getInstance();
  ded.removeProjectLoadedListener(this);
  ded.removeProjectStateListener(this);
  AutAgentRegistration.getInstance().removeListener(this);
}
Program: 96014
Project: 96014
Buggy source:
/** 
 * {@inheritDoc} 
 */
public void doSave(IProgressMonitor monitor){
  monitor.beginTask(Messages.EditorsSaveEditors,IProgressMonitor.UNKNOWN);
  EditSupport editSupport=getEditorHelper().getEditSupport();
  try {
    editSupport.saveWorkVersion();
    updateReferencedParamNodes();
    getEditorHelper().resetEditableState();
    getEditorHelper().setDirty(false);
  }
 catch (  IncompatibleTypeException pmce) {
    handlePMCompNameException(pmce);
  }
catch (  PMException e) {
    PMExceptionHandler.handlePMExceptionForMasterSession(e);
    try {
      reOpenEditor(((PersistableEditorInput)getEditorInput()).getNode());
    }
 catch (    PMException e1) {
      PMExceptionHandler.handlePMExceptionForEditor(e,this);
    }
  }
catch (  ProjectDeletedException e) {
    PMExceptionHandler.handleGDProjectDeletedException();
  }
 finally {
    monitor.done();
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public void doSave(IProgressMonitor monitor){
  monitor.beginTask(Messages.EditorsSaveEditors,IProgressMonitor.UNKNOWN);
  EditSupport editSupport=getEditorHelper().getEditSupport();
  try {
    editSupport.saveWorkVersion();
    final EntityManager masterSession=GeneralStorage.getInstance().getMasterSession();
    IPersistentObject original=editSupport.getOriginal();
    if (original != null) {
      masterSession.refresh(original);
      if (original instanceof ITestDataCategoryPO) {
        for (        ITestDataCubePO dataCube : ((ITestDataCategoryPO)original).getTestDataChildren()) {
          masterSession.refresh(dataCube);
          ITDManager manager=dataCube.getDataManager();
          masterSession.refresh(manager);
        }
      }
    }
    updateReferencedParamNodes();
    getEditorHelper().resetEditableState();
    getEditorHelper().setDirty(false);
  }
 catch (  IncompatibleTypeException pmce) {
    handlePMCompNameException(pmce);
  }
catch (  PMException e) {
    PMExceptionHandler.handlePMExceptionForMasterSession(e);
    try {
      reOpenEditor(((PersistableEditorInput)getEditorInput()).getNode());
    }
 catch (    PMException e1) {
      PMExceptionHandler.handlePMExceptionForEditor(e,this);
    }
  }
catch (  ProjectDeletedException e) {
    PMExceptionHandler.handleGDProjectDeletedException();
  }
 finally {
    monitor.done();
  }
}
Program: 96018
Project: 96018
Buggy source:
/** 
 * get a list of parameters for cap
 * @param node TestResultNode
 * @param parameterInterface Source for Parameter information.
 * @param keyword ITestResultPO
 * @return result mit parameter
 */
private ITestResultPO addParameterListToResult(ITestResultPO keyword,TestResultNode node,IParameterInterfacePO parameterInterface){
  int index=0;
  for (  IParamDescriptionPO param : parameterInterface.getParameterList()) {
    IParameterDetailsPO parameter=PoMaker.createParameterDetailsPO();
    parameter.setParameterName(param.getName());
    parameter.setInternalParameterType(param.getType());
    parameter.setParameterType(CompSystemI18n.getString(param.getType()));
    String paramValue=StringConstants.EMPTY;
    List<TestResultParameter> parameters=node.getParameters();
    if (parameters.size() >= index + 1) {
      final String value=parameters.get(index).getValue();
      paramValue=StringUtils.defaultString(value);
    }
    parameter.setParameterValue(paramValue);
    keyword.addParameter(parameter);
    index++;
  }
  return keyword;
}

Fixed version (ground truth):
/** 
 * get a list of parameters for cap
 * @param node TestResultNode
 * @param parameterInterface Source for Parameter information.
 * @param keyword ITestResultPO
 * @return result mit parameter
 */
private ITestResultPO addParameterListToResult(ITestResultPO keyword,TestResultNode node,IParameterInterfacePO parameterInterface){
  int index=0;
  for (  IParamDescriptionPO param : parameterInterface.getParameterList()) {
    IParameterDetailsPO parameter=PoMaker.createParameterDetailsPO();
    parameter.setParameterName(param.getName());
    parameter.setInternalParameterType(param.getType());
    parameter.setParameterType(CompSystemI18n.getString(param.getType(),true));
    String paramValue=StringConstants.EMPTY;
    List<TestResultParameter> parameters=node.getParameters();
    if (parameters.size() >= index + 1) {
      final String value=parameters.get(index).getValue();
      paramValue=StringUtils.defaultString(value);
    }
    parameter.setParameterValue(paramValue);
    keyword.addParameter(parameter);
    index++;
  }
  return keyword;
}
Program: 96019
Project: 96019
Buggy source:
/** 
 * {@inheritDoc}
 */
@Transient public String getName(){
  return CompSystemI18n.getString(getUniqueId());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Transient public String getName(){
  return CompSystemI18n.getString(getUniqueId(),true);
}
Program: 96022
Project: 96022
Buggy source:
/** 
 * @param cap the corresponding cap
 */
private void problemCompDoesNotExist(ICapPO cap){
  final ITestCasePO tcPO=(ITestCasePO)cap.getParentNode();
  String message=NLS.bind(Messages.ProblemCheckerCompDoesNotExist,new String[]{cap.getName(),tcPO.getName(),CompSystemI18n.getString(cap.getComponentType())});
  m_localProblemsToShow.add(ProblemFactory.createProblemWithMarker(new Status(IStatus.ERROR,Activator.PLUGIN_ID,message),message,cap,ProblemType.REASON_COMP_DOES_NOT_EXIST));
}

Fixed version (ground truth):
/** 
 * @param cap the corresponding cap
 */
private void problemCompDoesNotExist(ICapPO cap){
  final ITestCasePO tcPO=(ITestCasePO)cap.getParentNode();
  String message=NLS.bind(Messages.ProblemCheckerCompDoesNotExist,new String[]{cap.getName(),tcPO.getName(),CompSystemI18n.getString(cap.getComponentType(),true)});
  m_localProblemsToShow.add(ProblemFactory.createProblemWithMarker(new Status(IStatus.ERROR,Activator.PLUGIN_ID,message),message,cap,ProblemType.REASON_COMP_DOES_NOT_EXIST));
}
Program: 96023
Project: 96023
Buggy source:
/** 
 * @param parameter The Parameter object.
 * @param columnIndex the index of the table column.
 * @return the table entry.
 */
private String getTableCellText(Parameter parameter,int columnIndex){
switch (columnIndex) {
case NAME_TABLE_COLUMN:
    return parameter.getName();
case TYPE_TABLE_COLUMN:
  final String paramType=parameter.getType();
return CompSystemI18n.getString(paramType);
default :
StringBuilder msg=new StringBuilder();
msg.append(Messages.ColumnIndex).append(StringConstants.SPACE).append(StringConstants.APOSTROPHE).append(columnIndex).append(StringConstants.APOSTROPHE).append(StringConstants.SPACE).append(Messages.DoesNotExist).append(StringConstants.EXCLAMATION_MARK);
Assert.notReached(msg.toString());
break;
}
return EMPTY_ENTRY;
}

Fixed version (ground truth):
/** 
 * @param parameter The Parameter object.
 * @param columnIndex the index of the table column.
 * @return the table entry.
 */
private String getTableCellText(Parameter parameter,int columnIndex){
switch (columnIndex) {
case NAME_TABLE_COLUMN:
    return parameter.getName();
case TYPE_TABLE_COLUMN:
  final String paramType=parameter.getType();
return CompSystemI18n.getString(paramType,true);
default :
StringBuilder msg=new StringBuilder();
msg.append(Messages.ColumnIndex).append(StringConstants.SPACE).append(StringConstants.APOSTROPHE).append(columnIndex).append(StringConstants.APOSTROPHE).append(StringConstants.SPACE).append(Messages.DoesNotExist).append(StringConstants.EXCLAMATION_MARK);
Assert.notReached(msg.toString());
break;
}
return EMPTY_ENTRY;
}
Program: 96024
Project: 96024
Buggy source:
/** 
 * {@inheritDoc}
 */
public String getText(Object element){
  if (element instanceof IParameterInterfacePO) {
    IParameterInterfacePO tdc=(IParameterInterfacePO)element;
    StringBuilder info=new StringBuilder(tdc.getName());
    Iterator iter=tdc.getParameterList().iterator();
    boolean parameterExist=false;
    if (iter.hasNext()) {
      parameterExist=true;
      info.append(OPEN_BRACKED);
    }
    if (iter.hasNext()) {
      while (iter.hasNext()) {
        IParamDescriptionPO descr=(IParamDescriptionPO)iter.next();
        info.append(CompSystemI18n.getString(descr.getType()));
        info.append(StringConstants.COLON);
        info.append(descr.getName());
        if (iter.hasNext()) {
          info.append(SEPARATOR);
        }
      }
    }
    if (parameterExist) {
      info.append(CLOSE_BRACKED);
    }
    return info.toString();
  }
  if (element instanceof ITestDataCategoryPO) {
    return ((ITestDataCategoryPO)element).getName();
  }
  return super.getText(element);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public String getText(Object element){
  if (element instanceof IParameterInterfacePO) {
    IParameterInterfacePO tdc=(IParameterInterfacePO)element;
    StringBuilder info=new StringBuilder(tdc.getName());
    Iterator iter=tdc.getParameterList().iterator();
    boolean parameterExist=false;
    if (iter.hasNext()) {
      parameterExist=true;
      info.append(OPEN_BRACKED);
    }
    if (iter.hasNext()) {
      while (iter.hasNext()) {
        IParamDescriptionPO descr=(IParamDescriptionPO)iter.next();
        info.append(CompSystemI18n.getString(descr.getType(),true));
        info.append(StringConstants.COLON);
        info.append(descr.getName());
        if (iter.hasNext()) {
          info.append(SEPARATOR);
        }
      }
    }
    if (parameterExist) {
      info.append(CLOSE_BRACKED);
    }
    return info.toString();
  }
  if (element instanceof ITestDataCategoryPO) {
    return ((ITestDataCategoryPO)element).getName();
  }
  return super.getText(element);
}
Program: 96025
Project: 96025
Buggy source:
/** 
 * Logs in error log
 * @param key the I18n-key
 * @param throwable the Throwable
 */
private static void logError(String key,Throwable throwable){
  log.error("String_Node_Str" + key,throwable);
}

Fixed version (ground truth):
/** 
 * Logs in error log
 * @param key the I18n-key
 * @param throwable the throwable
 */
private static void logError(String key,Throwable throwable){
  log.error("String_Node_Str" + key,throwable);
}
Program: 96026
Project: 96026
Buggy source:
/** 
 * Searches for th evalue of th egiven key in all bundles.<br> throws MissingResourceException if the key was not found. 
 * @param key the key
 * @return the value for the given key
 */
private static String getStringInternal(String key){
  if (key == null) {
    return StringUtils.EMPTY;
  }
  String value=(String)I18N_MAP.get(key);
  if (value != null) {
    return value;
  }
  Iterator bundleIter=PLUGIN_BUNDLES.iterator();
  while (bundleIter.hasNext()) {
    ResourceBundle bundle=(ResourceBundle)bundleIter.next();
    try {
      value=bundle.getString(key);
      I18N_MAP.put(key,value);
      return value;
    }
 catch (    MissingResourceException ex) {
    }
  }
  I18N_MAP.put(key,key);
  throw new MissingResourceException("String_Node_Str" + key,CompSystemI18n.class.getName(),key);
}

Fixed version (ground truth):
/** 
 * Searches for the value of the given key in all bundles.<br> throws MissingResourceException if the key was not found. 
 * @param key the key
 * @return the value for the given key
 */
private static String getStringInternal(String key){
  if (key == null) {
    return StringUtils.EMPTY;
  }
  String value=(String)I18N_MAP.get(key);
  if (value != null) {
    return value;
  }
  Iterator bundleIter=PLUGIN_BUNDLES.iterator();
  while (bundleIter.hasNext()) {
    ResourceBundle bundle=(ResourceBundle)bundleIter.next();
    try {
      value=bundle.getString(key);
      I18N_MAP.put(key,value);
      return value;
    }
 catch (    MissingResourceException ex) {
    }
  }
  I18N_MAP.put(key,key);
  throw new MissingResourceException("String_Node_Str" + key,CompSystemI18n.class.getName(),key);
}
Program: 96027
Project: 96027
Buggy source:
/** 
 * Creates a ResourceBundle from the given String.<br> The given String must have the specification of a Propeties-File:<br> key=value<br> key=value<br> ...<br> with a line break (\n) after every value.
 * @param string a String from bundleToString
 */
public static void fromString(String string){
  final ByteArrayInputStream stream=new ByteArrayInputStream(string.getBytes());
  try {
    final PropertyResourceBundle bundle=new PropertyResourceBundle(stream);
    PLUGIN_BUNDLES.clear();
    addResourceBundle(bundle);
  }
 catch (  IOException e) {
    log.error(DebugConstants.ERROR,e);
  }
}

Fixed version (ground truth):
/** 
 * Creates a ResourceBundle from the given String.<br> The given String must have the specification of a properties-file:<br> key=value<br> key=value<br> ...<br> with a line break (\n) after every value.
 * @param string a String from bundleToString
 */
public static void fromString(String string){
  final ByteArrayInputStream stream=new ByteArrayInputStream(string.getBytes());
  try {
    final PropertyResourceBundle bundle=new PropertyResourceBundle(stream);
    PLUGIN_BUNDLES.clear();
    addResourceBundle(bundle);
  }
 catch (  IOException e) {
    log.error(DebugConstants.ERROR,e);
  }
}
Program: 96028
Project: 96028
Buggy source:
/** 
 * @return a String repesentation of the ResourceBundles to use forfromString(String string)
 * @see fromString(String string)
 */
public static String bundlesToString(){
  final String keyValueSeparator="String_Node_Str";
  final String lineBreak="String_Node_Str";
  final StringBuffer entries=new StringBuffer();
  for (Iterator bundlesIt=PLUGIN_BUNDLES.iterator(); bundlesIt.hasNext(); ) {
    final ResourceBundle bundle=(ResourceBundle)bundlesIt.next();
    for (Enumeration keys=bundle.getKeys(); keys.hasMoreElements(); ) {
      final String key=String.valueOf(keys.nextElement());
      final String value=bundle.getString(key);
      entries.append(key).append(keyValueSeparator).append(value).append(lineBreak);
    }
  }
  return entries.toString();
}

Fixed version (ground truth):
/** 
 * @return a String representation of the ResourceBundles to use forfromString(String string)
 * @see fromString(String string)
 */
public static String bundlesToString(){
  final String keyValueSeparator="String_Node_Str";
  final String lineBreak="String_Node_Str";
  final StringBuffer entries=new StringBuffer();
  for (Iterator bundlesIt=PLUGIN_BUNDLES.iterator(); bundlesIt.hasNext(); ) {
    final ResourceBundle bundle=(ResourceBundle)bundlesIt.next();
    for (Enumeration keys=bundle.getKeys(); keys.hasMoreElements(); ) {
      final String key=String.valueOf(keys.nextElement());
      final String value=bundle.getString(key);
      entries.append(key).append(keyValueSeparator).append(value).append(lineBreak);
    }
  }
  return entries.toString();
}
Program: 96029
Project: 96029
Buggy source:
/** 
 * Returns the components with the specified typeName.
 * @param typeName Name of the specified component (the I18N key).
 * @return the specified Components.
 */
public List findComponents(String typeName){
  Validate.notNull(typeName);
  List comps=new LinkedList();
  if (StringConstants.EMPTY.equals(typeName)) {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str");
    }
    comps.add(new InvalidComponent());
    return comps;
  }
  Iterator it=getComponents().iterator();
  while (it.hasNext()) {
    Component comp=(Component)it.next();
    if (comp instanceof ConcreteComponent) {
      ConcreteComponent ccomp=(ConcreteComponent)comp;
      if (typeName.equals(ccomp.getComponentClass())) {
        comps.add(ccomp);
      }
    }
  }
  if (!(comps.isEmpty())) {
    return comps;
  }
  if (log.isDebugEnabled()) {
    String translatedName=CompSystemI18n.getString(typeName);
    String message="String_Node_Str" + translatedName + "String_Node_Str";
    log.debug(message);
  }
  comps.add(new InvalidComponent());
  return comps;
}

Fixed version (ground truth):
/** 
 * Returns the components with the specified typeName.
 * @param typeName Name of the specified component (the I18N key).
 * @return the specified Components.
 */
public List findComponents(String typeName){
  Validate.notNull(typeName);
  List comps=new LinkedList();
  if (StringConstants.EMPTY.equals(typeName)) {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str");
    }
    comps.add(new InvalidComponent());
    return comps;
  }
  Iterator it=getComponents().iterator();
  while (it.hasNext()) {
    Component comp=(Component)it.next();
    if (comp instanceof ConcreteComponent) {
      ConcreteComponent ccomp=(ConcreteComponent)comp;
      if (typeName.equals(ccomp.getComponentClass())) {
        comps.add(ccomp);
      }
    }
  }
  if (!(comps.isEmpty())) {
    return comps;
  }
  if (log.isDebugEnabled()) {
    String translatedName=CompSystemI18n.getString(typeName,true);
    String message="String_Node_Str" + translatedName + "String_Node_Str";
    log.debug(message);
  }
  comps.add(new InvalidComponent());
  return comps;
}
Program: 96030
Project: 96030
Buggy source:
/** 
 * Returns the component with the specified typeName.
 * @param typeName Name of the specified component (the I18N key).
 * @return the specified Component.
 */
public Component findComponent(String typeName){
  Validate.notNull(typeName);
  if (StringConstants.EMPTY.equals(typeName)) {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str");
    }
    return new InvalidComponent();
  }
  Component comp=(Component)m_componentsByType.get(typeName);
  if (comp != null) {
    return comp;
  }
  if (log.isDebugEnabled()) {
    String translatedName=CompSystemI18n.getString(typeName);
    String message="String_Node_Str" + translatedName + "String_Node_Str";
    log.debug(message);
  }
  return new InvalidComponent();
}

Fixed version (ground truth):
/** 
 * Returns the component with the specified typeName.
 * @param typeName Name of the specified component (the I18N key).
 * @return the specified Component.
 */
public Component findComponent(String typeName){
  Validate.notNull(typeName);
  if (StringConstants.EMPTY.equals(typeName)) {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str");
    }
    return new InvalidComponent();
  }
  Component comp=(Component)m_componentsByType.get(typeName);
  if (comp != null) {
    return comp;
  }
  if (log.isDebugEnabled()) {
    String translatedName=CompSystemI18n.getString(typeName,true);
    String message="String_Node_Str" + translatedName + "String_Node_Str";
    log.debug(message);
  }
  return new InvalidComponent();
}
Program: 96031
Project: 96031
Buggy source:
/** 
 * Creates the instance of the persistent object which is defined by the XML element used as prameter. The method generates all dependend objects as well.
 * @param xml Abstraction of the XML element (see Apache XML Beans)
 * @param assignNewGuid <code>true</code> if the test suiteshould be assigned a new GUID. Otherwise  <code>false</code>.
 * @return a persistent object generated from the information in the XMLelement
 */
private ITestJobPO createTestJob(TestJobs xml,boolean assignNewGuid){
  ITestJobPO tj;
  if (xml.getGUID() != null && !assignNewGuid) {
    tj=NodeMaker.createTestJobPO(xml.getName(),xml.getGUID());
  }
 else {
    tj=NodeMaker.createTestJobPO(xml.getName());
  }
  tj.setComment(xml.getComment());
  for (  RefTestSuite xmlRts : xml.getRefTestSuiteList()) {
    IRefTestSuitePO rts;
    if (assignNewGuid) {
      String testSuiteGuid=m_oldToNewGuids.get(xmlRts.getTsGuid());
      if (testSuiteGuid == null) {
        log.error("String_Node_Str" + xmlRts.getTsGuid());
      }
      rts=NodeMaker.createRefTestSuitePO(xmlRts.getName(),testSuiteGuid,xmlRts.getAutId());
    }
 else {
      rts=NodeMaker.createRefTestSuitePO(xmlRts.getName(),xmlRts.getGUID(),xmlRts.getTsGuid(),xmlRts.getAutId());
    }
    rts.setComment(xmlRts.getComment());
    tj.addNode(rts);
  }
  return tj;
}

Fixed version (ground truth):
/** 
 * Creates the instance of the persistent object which is defined by the XML element used as prameter. The method generates all dependend objects as well.
 * @param xml Abstraction of the XML element (see Apache XML Beans)
 * @param assignNewGuid <code>true</code> if the test suiteshould be assigned a new GUID. Otherwise  <code>false</code>.
 * @return a persistent object generated from the information in the XMLelement
 * @throws InvalidDataException if some data is invalid when constructingan object. This should not happen for exported project, but may happen when someone generates XML project description outside of GUIdancer.
 */
private ITestJobPO createTestJob(TestJobs xml,boolean assignNewGuid) throws InvalidDataException {
  ITestJobPO tj;
  if (xml.getGUID() != null && !assignNewGuid) {
    tj=NodeMaker.createTestJobPO(xml.getName(),xml.getGUID());
  }
 else {
    tj=NodeMaker.createTestJobPO(xml.getName());
  }
  tj.setComment(xml.getComment());
  for (  RefTestSuite xmlRts : xml.getRefTestSuiteList()) {
    IRefTestSuitePO rts;
    if (assignNewGuid) {
      String testSuiteGuid=m_oldToNewGuids.get(xmlRts.getTsGuid());
      if (testSuiteGuid == null) {
        throw new InvalidDataException("String_Node_Str" + xmlRts.getTsGuid(),MessageIDs.E_IMPORT_PROJECT_XML_FAILED);
      }
      rts=NodeMaker.createRefTestSuitePO(xmlRts.getName(),testSuiteGuid,xmlRts.getAutId());
    }
 else {
      rts=NodeMaker.createRefTestSuitePO(xmlRts.getName(),xmlRts.getGUID(),xmlRts.getTsGuid(),xmlRts.getAutId());
    }
    rts.setComment(xmlRts.getComment());
    tj.addNode(rts);
  }
  return tj;
}
Program: 96032
Project: 96032
Buggy source:
/** 
 * @param proj the project po
 * @param xml the project xml
 * @param assignNewGuid flag to indicate whether new ids should be assigned
 * @throws InterruptedException in case of interruption
 * @throws InvalidDataException in case of invalid data
 */
private void handleTestSuitesAndTestJobsAndCategories(IProjectPO proj,Project xml,boolean assignNewGuid) throws InterruptedException, InvalidDataException {
  for (  ExecCategory catXml : xml.getExecCategoriesList()) {
    checkCancel();
    List<IExecPersistable> tsAndCats=createListOfCategoriesAndTestsuites(proj,catXml,assignNewGuid);
    for (    IExecPersistable exec : tsAndCats) {
      proj.getExecObjCont().addExecObject(exec);
    }
    List<IExecPersistable> tjs=createListOfTestJobs(catXml,assignNewGuid);
    for (    IExecPersistable exec : tjs) {
      proj.getExecObjCont().addExecObject(exec);
    }
  }
}

Fixed version (ground truth):
/** 
 * @param proj the project po
 * @param xml the project xml
 * @param assignNewGuid flag to indicate whether new ids should be assigned
 * @throws InterruptedException in case of interruption
 * @throws InvalidDataException in case of invalid data
 */
private void handleTestSuitesAndTestJobsAndCategories(IProjectPO proj,Project xml,boolean assignNewGuid) throws InterruptedException, InvalidDataException {
  for (  ExecCategory catXml : xml.getExecCategoriesList()) {
    checkCancel();
    List<IExecPersistable> tsAndCats=createListOfCategoriesAndTestsuites(proj,catXml,assignNewGuid);
    for (    IExecPersistable exec : tsAndCats) {
      proj.getExecObjCont().addExecObject(exec);
    }
  }
  for (  ExecCategory catXml : xml.getExecCategoriesList()) {
    checkCancel();
    List<IExecPersistable> tjs=createListOfTestJobs(catXml,assignNewGuid);
    for (    IExecPersistable exec : tjs) {
      proj.getExecObjCont().addExecObject(exec);
    }
  }
}
Program: 96033
Project: 96033
Buggy source:
/** 
 * Handle "old"-XML data structure for pre 1.2 datamodel
 * @param proj the project
 * @param xml the project xml
 * @param attrDescSession the attribute description
 * @param assignNewGuid whether new GUIDs should be assigned or not
 * @throws InterruptedException in case of an interruption
 */
private void handleOldTestSuitesAndTestJobs(IProjectPO proj,Project xml,EntityManager attrDescSession,boolean assignNewGuid) throws InterruptedException {
  if (!xml.getTestsuiteList().isEmpty()) {
    ICategoryPO catTS=NodeMaker.createCategoryPO("String_Node_Str");
    for (    TestSuite tsXml : xml.getTestsuiteList()) {
      checkCancel();
      ITestSuitePO tsPO=createTestSuite(proj,tsXml,assignNewGuid);
      catTS.addNode(tsPO);
    }
    proj.getExecObjCont().addExecObject(catTS);
  }
  if (!xml.getTestsuiteList().isEmpty()) {
    ICategoryPO catTJ=NodeMaker.createCategoryPO("String_Node_Str");
    for (    TestJobs tjXml : xml.getTestJobsList()) {
      checkCancel();
      catTJ.addNode(createTestJob(tjXml,assignNewGuid));
    }
    proj.getExecObjCont().addExecObject(catTJ);
  }
}

Fixed version (ground truth):
/** 
 * Handle "old"-XML data structure for pre 1.2 datamodel
 * @param proj the project
 * @param xml the project xml
 * @param attrDescSession the attribute description
 * @param assignNewGuid whether new GUIDs should be assigned or not
 * @throws InterruptedException in case of an interruption
 * @throws InvalidDataException if some data is invalid when constructing an object. This should not happen for exported project, but may happen when someone generates XML project description outside of GUIdancer.
 */
private void handleOldTestSuitesAndTestJobs(IProjectPO proj,Project xml,EntityManager attrDescSession,boolean assignNewGuid) throws InterruptedException, InvalidDataException {
  if (!xml.getTestsuiteList().isEmpty()) {
    ICategoryPO catTS=NodeMaker.createCategoryPO("String_Node_Str");
    for (    TestSuite tsXml : xml.getTestsuiteList()) {
      checkCancel();
      ITestSuitePO tsPO=createTestSuite(proj,tsXml,assignNewGuid);
      catTS.addNode(tsPO);
    }
    proj.getExecObjCont().addExecObject(catTS);
  }
  if (!xml.getTestsuiteList().isEmpty()) {
    ICategoryPO catTJ=NodeMaker.createCategoryPO("String_Node_Str");
    for (    TestJobs tjXml : xml.getTestJobsList()) {
      checkCancel();
      catTJ.addNode(createTestJob(tjXml,assignNewGuid));
    }
    proj.getExecObjCont().addExecObject(catTJ);
  }
}
Program: 96036
Project: 96036
Buggy source:
/** 
 * Clicks at the current mouse position.
 * @param graphicsComponent The component used for confirming the click.
 * @param clickOptions Configuration for the click.
 */
private void clickImpl(Object graphicsComponent,ClickOptions clickOptions){
  int buttonMask=getButtonMask(clickOptions.getMouseButton());
  int clickCount=clickOptions.getClickCount();
  int[] modifierMask=getModifierMask(clickOptions.getClickModifier());
  if (clickCount > 0) {
    InterceptorOptions options=new InterceptorOptions(new long[]{AWTEvent.MOUSE_EVENT_MASK});
    IRobotEventConfirmer confirmer=m_interceptor.intercept(options);
    try {
      pressModifier(modifierMask);
      RobotTiming.sleepPreClickDelay();
      for (int i=0; i < clickCount; i++) {
        m_robot.mousePress(buttonMask);
        RobotTiming.sleepPostMouseDownDelay();
        m_eventFlusher.flush();
        m_robot.mouseRelease(buttonMask);
        RobotTiming.sleepPostMouseUpDelay();
        m_eventFlusher.flush();
      }
      if (clickOptions.isConfirmClick()) {
        confirmer.waitToConfirm(graphicsComponent,new ClickAwtEventMatcher(clickOptions));
      }
    }
  finally {
      releaseModifier(modifierMask);
    }
  }
}

Fixed version (ground truth):
/** 
 * Clicks at the current mouse position.
 * @param graphicsComponent The component used for confirming the click.
 * @param clickOptions Configuration for the click.
 */
private void clickImpl(Object graphicsComponent,ClickOptions clickOptions){
  int buttonMask=getButtonMask(clickOptions.getMouseButton());
  int clickCount=clickOptions.getClickCount();
  int[] modifierMask=getModifierMask(clickOptions.getClickModifier());
  if (clickCount > 0) {
    IRobotEventConfirmer confirmer=null;
    if (clickOptions.isConfirmClick()) {
      InterceptorOptions options=new InterceptorOptions(new long[]{AWTEvent.MOUSE_EVENT_MASK});
      confirmer=m_interceptor.intercept(options);
    }
    try {
      pressModifier(modifierMask);
      RobotTiming.sleepPreClickDelay();
      for (int i=0; i < clickCount; i++) {
        m_robot.mousePress(buttonMask);
        RobotTiming.sleepPostMouseDownDelay();
        m_eventFlusher.flush();
        m_robot.mouseRelease(buttonMask);
        RobotTiming.sleepPostMouseUpDelay();
        m_eventFlusher.flush();
      }
      if (confirmer != null) {
        confirmer.waitToConfirm(graphicsComponent,new ClickAwtEventMatcher(clickOptions));
      }
    }
  finally {
      releaseModifier(modifierMask);
    }
  }
}
Program: 96037
Project: 96037
Buggy source:
/** 
 * Enables or disables the confirmer. If the confirmer is enabled, the AWT listener is added to the AWT event queue so that the confirmer starts storing events of the configuered class of events. If it is disabled, the listener is removed from the AWT event queue.
 * @param enabled <code>true</code> or <code>false</code>.
 */
void setEnabled(boolean enabled){
  m_enabled=enabled;
  m_eventList.clear();
  if (enabled) {
    for (int i=0; i < m_options.getEventMask().length; i++) {
      Toolkit.getDefaultToolkit().addAWTEventListener(this,m_options.getEventMask()[i]);
    }
  }
 else {
    Toolkit.getDefaultToolkit().removeAWTEventListener(this);
  }
}

Fixed version (ground truth):
/** 
 * Enables or disables the confirmer. If the confirmer is enabled, the AWT listener is added to the AWT event queue so that the confirmer starts storing events of the configured class of events. If it is disabled, the listener is removed from the AWT event queue.
 * @param enabled <code>true</code> or <code>false</code>.
 */
void setEnabled(boolean enabled){
  m_enabled=enabled;
  m_eventList.clear();
  if (enabled) {
    for (int i=0; i < m_options.getEventMask().length; i++) {
      Toolkit.getDefaultToolkit().addAWTEventListener(this,m_options.getEventMask()[i]);
    }
  }
 else {
    Toolkit.getDefaultToolkit().removeAWTEventListener(this);
  }
}