nus-yam/ex-repair huggingface dataset:
Program: 148049
Project: 148049
Buggy source:
public static List<IRepositoryViewObject> findAllViewObjects(ERepositoryObjectType type,boolean useRepositoryViewObject){
  IProxyRepositoryFactory factory=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
  try {
    List<IRepositoryViewObject> allObjs=factory.getAll(type);
    List<IRepositoryViewObject> viewObjects=new LinkedList<IRepositoryViewObject>();
    for (    IRepositoryViewObject viewObj : allObjs) {
      Item item=viewObj.getProperty().getItem();
      ItemState state=item.getState();
      if (!state.isDeleted()) {
        IInteractiveHandler handler=InteractiveService.findHandler(viewObj.getRepositoryObjectType());
        if (handler != null) {
          handler.assertPropertyIsInited(item);
        }
        if (useRepositoryViewObject) {
          viewObjects.add(new RepositoryViewObject(viewObj.getProperty()));
        }
 else {
          viewObjects.add(viewObj);
        }
      }
    }
    return viewObjects;
  }
 catch (  PersistenceException e) {
    log.error(e.getMessage(),e);
  }
  return null;
}

Fixed version (ground truth):
public static List<IRepositoryViewObject> findAllViewObjects(ERepositoryObjectType type,boolean useRepositoryViewObject){
  IProxyRepositoryFactory factory=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
  try {
    List<IRepositoryViewObject> allObjs=factory.getAll(type);
    List<IRepositoryViewObject> viewObjects=new LinkedList<IRepositoryViewObject>();
    for (    IRepositoryViewObject viewObj : allObjs) {
      Item item=viewObj.getProperty().getItem();
      ItemState state=item.getState();
      if (!state.isDeleted()) {
        try {
          IInteractiveHandler handler=InteractiveService.findHandler(viewObj.getRepositoryObjectType());
          if (handler != null) {
            handler.assertPropertyIsInited(item);
          }
          if (useRepositoryViewObject) {
            viewObjects.add(new RepositoryViewObject(viewObj.getProperty()));
          }
 else {
            viewObjects.add(viewObj);
          }
        }
 catch (        Exception e) {
          log.error(e.getMessage(),e);
        }
      }
    }
    return viewObjects;
  }
 catch (  PersistenceException e) {
    log.error(e.getMessage(),e);
  }
  return null;
}
Program: 148050
Project: 148050
Buggy source:
public static IFile findReferenceFile(ERepositoryObjectType type,Item item,String fileExtension){
  IFolder folder=RepositoryResourceUtil.getFolder(type);
  String path=item.getState().getPath();
  if (path != null && path.length() > 0) {
    folder=folder.getFolder(path);
  }
  String name=null;
  Property property=item.getProperty();
  if (item instanceof MDMServerObjectItem) {
    MDMServerObject mdmServerObject=((MDMServerObjectItem)item).getMDMServerObject();
    name=mdmServerObject.getName();
  }
 else {
    name=property.getLabel();
  }
  String fileName=name + UNDERLINE + property.getVersion()+ DOT+ (fileExtension != null ? fileExtension : "String_Node_Str");
  IFile file=folder.getFile(fileName);
  return file;
}

Fixed version (ground truth):
public static IFile findReferenceFile(ERepositoryObjectType type,Item item,String fileExtension){
  IFolder folder=RepositoryResourceUtil.getFolder(type);
  String path=item.getState().getPath();
  if (path != null && path.length() > 0) {
    folder=folder.getFolder(path);
  }
  String name=null;
  Property property=item.getProperty();
  name=property.getLabel();
  String fileName=name + UNDERLINE + property.getVersion()+ DOT+ (fileExtension != null ? fileExtension : "String_Node_Str");
  IFile file=folder.getFile(fileName);
  return file;
}
Program: 148051
Project: 148051
Buggy source:
public static String getTextFileContent(IFile file,String encode){
  InputStream inputStream=null;
  ByteArrayOutputStream os=null;
  try {
    os=new ByteArrayOutputStream();
    inputStream=file.getContents();
    byte[] ba=new byte[inputStream.available()];
    inputStream.read(ba);
    os.write(ba);
    return os.toString(encode);
  }
 catch (  CoreException e) {
    log.error(e.getMessage(),e);
  }
catch (  IOException e) {
    log.error(e.getMessage(),e);
  }
 finally {
    if (inputStream != null) {
      try {
        inputStream.close();
      }
 catch (      IOException e) {
      }
    }
    if (os != null) {
      try {
        os.close();
      }
 catch (      IOException e) {
      }
    }
  }
  return null;
}

Fixed version (ground truth):
public static String getTextFileContent(IFile file,String encode){
  String filePath=file.getLocation().toOSString();
  File osfile=new File(filePath);
  if (!osfile.exists())   return null;
  InputStream inputStream=null;
  ByteArrayOutputStream os=null;
  try {
    os=new ByteArrayOutputStream();
    inputStream=file.getContents();
    byte[] ba=new byte[inputStream.available()];
    inputStream.read(ba);
    os.write(ba);
    return os.toString(encode);
  }
 catch (  CoreException e) {
    log.error(e.getMessage(),e);
  }
catch (  IOException e) {
    log.error(e.getMessage(),e);
  }
 finally {
    if (inputStream != null) {
      try {
        inputStream.close();
      }
 catch (      IOException e) {
      }
    }
    if (os != null) {
      try {
        os.close();
      }
 catch (      IOException e) {
      }
    }
  }
  return null;
}
Program: 148052
Project: 148052
Buggy source:
@Override public void run(){
  Set<IRepositoryViewObject> allChangedObjects=findAllChangedObjects();
  String name=getSameServerName();
  DeployAllDialog dialog=new DeployAllDialog(getShell(),commonViewer.getInput(),allChangedObjects,name);
  int retCode=dialog.open();
  IS_DEPLOYALL_FLAG=false;
  if (retCode == IDialogConstants.OK_ID) {
    List<IRepositoryViewObject> selectededViewObjs=dialog.getSelectededViewObjs();
    MDMServerDef def=dialog.getTheServerDef();
    if (selectededViewObjs.size() > 0) {
      IStatus status=deploy(def,selectededViewObjs);
      if (status.isMultiStatus()) {
        for (        IStatus childStatus : status.getChildren()) {
          DeployService.DeployStatus deployStatus=(DeployStatus)childStatus;
          if (deployStatus.isOK()) {
            if (deployStatus.getItem() instanceof MDMServerObjectItem)             saveLastServer((MDMServerObjectItem)deployStatus.getItem(),def,selectededViewObjs);
          }
        }
      }
      updateChangedStatus(status);
      if (status.isMultiStatus()) {
        showDeployStatus(status);
      }
    }
  }
  defNames.clear();
}

Fixed version (ground truth):
@Override public void run(){
  PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().saveAllEditors(true);
  Set<IRepositoryViewObject> allChangedObjects=findAllChangedObjects();
  String name=getSameServerName();
  DeployAllDialog dialog=new DeployAllDialog(getShell(),commonViewer.getInput(),allChangedObjects,name);
  int retCode=dialog.open();
  IS_DEPLOYALL_FLAG=false;
  if (retCode == IDialogConstants.OK_ID) {
    List<IRepositoryViewObject> selectededViewObjs=dialog.getSelectededViewObjs();
    MDMServerDef def=dialog.getTheServerDef();
    if (selectededViewObjs.size() > 0) {
      IStatus status=deploy(def,selectededViewObjs);
      if (status.isMultiStatus()) {
        for (        IStatus childStatus : status.getChildren()) {
          DeployService.DeployStatus deployStatus=(DeployStatus)childStatus;
          if (deployStatus.isOK()) {
            if (deployStatus.getItem() instanceof MDMServerObjectItem)             saveLastServer((MDMServerObjectItem)deployStatus.getItem(),def,selectededViewObjs);
          }
        }
      }
      updateChangedStatus(status);
      if (status.isMultiStatus()) {
        showDeployStatus(status);
      }
    }
  }
  defNames.clear();
}
Program: 148053
Project: 148053
Buggy source:
public void createInitialLayout(IPageLayout layout){
  IFolderLayout leftTopLayout=layout.createFolder("String_Node_Str",IPageLayout.LEFT,new Float(0.32),IPageLayout.ID_EDITOR_AREA);
  leftTopLayout.addView(ServerView.VIEW_ID);
  layout.addPlaceholder(VIEWID_PROPERTYVIEW,IPageLayout.BOTTOM,0.7f,IPageLayout.ID_EDITOR_AREA);
  layout.addPlaceholder(VIEWID_OUTLINE,IPageLayout.RIGHT,0.7f,IPageLayout.ID_EDITOR_AREA);
  layout.setEditorAreaVisible(true);
}

Fixed version (ground truth):
public void createInitialLayout(IPageLayout layout){
  layout.addPlaceholder(VIEWID_OUTLINE,IPageLayout.RIGHT,0.7f,IPageLayout.ID_EDITOR_AREA);
  layout.setEditorAreaVisible(true);
}
Program: 148054
Project: 148054
Buggy source:
public static List<MDMServerDef> getServers(){
  List<MDMServerDef> defs=new ArrayList<MDMServerDef>();
  Element rootElement=getRootElement();
  if (rootElement == null)   return defs;
  List<?> properties=rootElement.elements(PROPERTIES);
  for (Iterator<?> iterator=properties.iterator(); iterator.hasNext(); ) {
    Element serverElement=(Element)iterator.next();
    MDMServerDef def=getServer(serverElement);
    defs.add(def);
  }
  return defs;
}

Fixed version (ground truth):
public static List<MDMServerDef> getServers(){
  return getServersListFromSerExp();
}
Program: 148055
Project: 148055
Buggy source:
public IImage getIcon(ERepositoryObjectType type){
  if (type == TYPE_MENU)   return ServerObjectImage.MENU_ICON;
  if (type == TYPE_ROLE)   return ServerObjectImage.ROLE_ICON;
  return null;
}

Fixed version (ground truth):
public IImage getIcon(Item item){
  return null;
}
Program: 148056
Project: 148056
Buggy source:
private void synchronizeMDMServerView(){
  IWorkbenchPage page=getViewSite().getPage();
  ServerView serverView=(ServerView)page.findView(ServerView.VIEW_ID);
  if (serverView == null)   try {
    serverView=(ServerView)page.showView(ServerView.VIEW_ID);
  }
 catch (  PartInitException e) {
    log.error(e.getMessage(),e);
  }
  serverView.getServersListFromSerExp().clear();
  List<MDMServerDef> servers=ServerDefService.getAllServerDefs();
  for (  MDMServerDef server : servers) {
    addMDMServerViewDef(server,serverView);
  }
  if (serverView != null) {
    serverView.initView();
    (serverView).getViewer().collapseAll();
    (serverView).getViewer().refresh();
  }
}

Fixed version (ground truth):
private void synchronizeMDMServerView(){
  IWorkbenchPage page=getViewSite().getPage();
  ServerView serverView=(ServerView)page.findView(ServerView.VIEW_ID);
  MDMServerHelper.getServersListFromSerExp().clear();
  List<MDMServerDef> servers=ServerDefService.getAllServerDefs();
  for (  MDMServerDef server : servers) {
    addMDMServerViewDef(server);
  }
  if (serverView == null)   return;
  if (serverView != null) {
    serverView.initView();
    serverView.getViewer().collapseAll();
    serverView.getViewer().refresh();
  }
}
Program: 148057
Project: 148057
Buggy source:
public void run(){
  IRepositoryViewObject viewObject=getCurSelectedViewObject();
  if (viewObject != null) {
    MDMServerDefItem serverDefItem=getMDMItem(viewObject);
    if (MessageDialog.openQuestion(getViewSite().getShell(),Messages.ServerExplorer_RemoveServer,Messages.bind(Messages.ServerExplorer_RemoveConfirm,serverDefItem.getServerDef().getName()))) {
      boolean result=ServerDefService.deleteServerDef(viewObject);
      if (result) {
        refreshServerDefs();
      }
      deleteServerDefForSerView(serverDefItem.getServerDef().getName());
    }
  }
}

Fixed version (ground truth):
public void run(){
  IRepositoryViewObject viewObject=getCurSelectedViewObject();
  if (viewObject != null) {
    MDMServerDefItem serverDefItem=getMDMItem(viewObject);
    if (MessageDialog.openQuestion(getViewSite().getShell(),Messages.ServerExplorer_RemoveServer,Messages.bind(Messages.ServerExplorer_RemoveConfirm,serverDefItem.getServerDef().getName()))) {
      boolean result=ServerDefService.deleteServerDef(viewObject);
      if (result) {
        refreshServerDefs();
      }
      deleteServerDefForSerView(serverDefItem.getServerDef().getName());
      deleteServerDefInConfigXML(serverDefItem.getServerDef().getName());
    }
  }
}
Program: 148058
Project: 148058
Buggy source:
private void addMDMServerViewDef(MDMServerDef serverDef,ServerView serverView){
  com.amalto.workbench.utils.MDMServerDef serDef=com.amalto.workbench.utils.MDMServerDef.parse(serverDef.getUrl(),serverDef.getUser(),serverDef.getPasswd(),serverDef.getUniverse(),serverDef.getName());
  serverView.getServersListFromSerExp().add(serDef);
}

Fixed version (ground truth):
private void addMDMServerViewDef(MDMServerDef serverDef){
  com.amalto.workbench.utils.MDMServerDef serDef=com.amalto.workbench.utils.MDMServerDef.parse(serverDef.getUrl(),serverDef.getUser(),serverDef.getPasswd(),serverDef.getUniverse(),serverDef.getName());
  MDMServerHelper.getServersListFromSerExp().add(serDef);
  addServerDefInConfigXML(serverDef);
}
Program: 148059
Project: 148059
Buggy source:
@Override public Object getAdapter(Class adapter){
  if (adapter == AddBrowseItemsWizard.class) {
    return new AddBrowseItemsWizardR(this);
  }
  if (adapter == XSDSetAnnotationWriteAction.class) {
    return new XSDSetAnnotationWriteActionR(this);
  }
  if (adapter == XSDSetAnnotationNoAction.class) {
    return new XSDSetAnnotationNoActionR(this,dataModelName);
  }
  if (adapter == XSDSetAnnotationWrapWriteAction.class) {
    return new XSDSetAnnotationWrapWriteActionR(this);
  }
  if (adapter == XSDSetAnnotationWrapNoAction.class) {
    return new XSDSetAnnotationWrapNoActionR(this,dataModelName);
  }
  if (adapter == XSDSetAnnotationForeignKeyAction.class) {
    return new XSDSetAnnotationForeignKeyActionR(this,dataModelName);
  }
  if (adapter == XSDSetAnnotationForeignKeyInfoAction.class) {
    return new XSDSetAnnotationForeignKeyInfoActionR(this,dataModelName);
  }
  if (adapter == XSDSetAnnotationFKFilterAction.class) {
    return new XSDSetAnnotationFKFilterActionR(this,dataModelName);
  }
  return super.getAdapter(adapter);
}

Fixed version (ground truth):
@Override public Object getAdapter(Class adapter){
  if (adapter == AddBrowseItemsWizard.class) {
    return new AddBrowseItemsWizardR(this);
  }
  if (adapter == XSDSetAnnotationWriteAction.class) {
    return new XSDSetAnnotationWriteActionR(this);
  }
  if (adapter == XSDSetAnnotationNoAction.class) {
    return new XSDSetAnnotationNoActionR(this,dataModelName);
  }
  if (adapter == XSDSetAnnotationWrapWriteAction.class) {
    return new XSDSetAnnotationWrapWriteActionR(this);
  }
  if (adapter == XSDSetAnnotationWrapNoAction.class) {
    return new XSDSetAnnotationWrapNoActionR(this,dataModelName);
  }
  if (adapter == XSDSetAnnotationForeignKeyAction.class) {
    return new XSDSetAnnotationForeignKeyActionR(this,dataModelName);
  }
  if (adapter == XSDSetAnnotationForeignKeyInfoAction.class) {
    return new XSDSetAnnotationForeignKeyInfoActionR(this,dataModelName);
  }
  if (adapter == XSDSetAnnotationFKFilterAction.class) {
    return new XSDSetAnnotationFKFilterActionR(this,dataModelName);
  }
  if (adapter == XSDDeleteConceptAction.class) {
    return new XSDDeleteConceptActionR(this);
  }
  return super.getAdapter(adapter);
}
Program: 148060
Project: 148060
Buggy source:
public IStatus doAction(){
  try {
    XSDElementDeclaration decl=xsdElem;
    if (decl == null) {
      ISelection selection=page.getTreeViewer().getSelection();
      decl=(XSDElementDeclaration)((IStructuredSelection)selection).getFirstElement();
    }
    Set<String> list=Util.getForeignKeys();
    if (list == null) {
      XtentisPort port=null;
      try {
        port=Util.getPort(page.getXObject());
      }
 catch (      XtentisException e) {
        log.error(e.getMessage(),e);
        ;
      }
      list=new HashSet<String>();
      Util.getForeingKeyInDataModel(list,page.getXObject().getParent(),port);
      Util.setForeignKeys(list);
    }
    if (list.contains(decl.getName())) {
      boolean confirmed=MessageDialog.openConfirm(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + decl.getName() + "String_Node_Str"+ "String_Node_Str");
      if (!confirmed) {
        return Status.CANCEL_STATUS;
      }
    }
    ArrayList<Object> objList=new ArrayList<Object>();
    IStructuredContentProvider provider=(IStructuredContentProvider)page.getTreeViewer().getContentProvider();
    Object[] objs=Util.getAllObject(page.getSite(),objList,provider);
    Util.deleteReference(decl,objs);
    if (schema == null)     schema=((ISchemaContentProvider)page.getTreeViewer().getContentProvider()).getXsdSchema();
    schema.getContents().remove(decl);
    schema.update();
    xsdElem=null;
    page.refresh();
    page.markDirtyWithoutCommit();
  }
 catch (  Exception e) {
    log.error(e.getMessage(),e);
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
    return Status.CANCEL_STATUS;
  }
  return Status.OK_STATUS;
}

Fixed version (ground truth):
public IStatus doAction(){
  try {
    XSDElementDeclaration decl=xsdElem;
    if (decl == null) {
      ISelection selection=page.getTreeViewer().getSelection();
      decl=(XSDElementDeclaration)((IStructuredSelection)selection).getFirstElement();
    }
    if (checkContainFK(decl.getName())) {
      boolean confirmed=MessageDialog.openConfirm(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + decl.getName() + "String_Node_Str"+ "String_Node_Str");
      if (!confirmed) {
        return Status.CANCEL_STATUS;
      }
    }
    ArrayList<Object> objList=new ArrayList<Object>();
    IStructuredContentProvider provider=(IStructuredContentProvider)page.getTreeViewer().getContentProvider();
    Object[] objs=Util.getAllObject(page.getSite(),objList,provider);
    Util.deleteReference(decl,objs);
    if (schema == null)     schema=((ISchemaContentProvider)page.getTreeViewer().getContentProvider()).getXsdSchema();
    schema.getContents().remove(decl);
    schema.update();
    xsdElem=null;
    page.refresh();
    page.markDirtyWithoutCommit();
  }
 catch (  Exception e) {
    log.error(e.getMessage(),e);
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
    return Status.CANCEL_STATUS;
  }
  return Status.OK_STATUS;
}
Program: 148061
Project: 148061
Buggy source:
@Override public Object getAdapter(Class adapter){
  if (adapter == TreeParent.class) {
    return Util.getServerTreeParent(getXObject());
  }
  if (adapter == XSDSetAnnotationWriteAction.class) {
    return new XSDSetAnnotationWriteAction(this);
  }
  if (adapter == XSDSetAnnotationNoAction.class) {
    return new XSDSetAnnotationNoAction(this,dataModelName);
  }
  if (adapter == XSDSetAnnotationWrapWriteAction.class) {
    return new XSDSetAnnotationWrapWriteAction(this);
  }
  if (adapter == XSDSetAnnotationWrapNoAction.class) {
    return new XSDSetAnnotationWrapNoAction(this,dataModelName);
  }
  if (adapter == XSDSetAnnotationForeignKeyAction.class) {
    return new XSDSetAnnotationForeignKeyAction(this,dataModelName);
  }
  if (adapter == XSDSetAnnotationForeignKeyInfoAction.class) {
    return new XSDSetAnnotationForeignKeyInfoAction(this,dataModelName);
  }
  if (adapter == XSDSetAnnotationFKFilterAction.class) {
    return new XSDSetAnnotationFKFilterAction(this,dataModelName);
  }
  return super.getAdapter(adapter);
}

Fixed version (ground truth):
@Override public Object getAdapter(Class adapter){
  if (adapter == TreeParent.class) {
    return Util.getServerTreeParent(getXObject());
  }
  if (adapter == XSDSetAnnotationWriteAction.class) {
    return new XSDSetAnnotationWriteAction(this);
  }
  if (adapter == XSDSetAnnotationNoAction.class) {
    return new XSDSetAnnotationNoAction(this,dataModelName);
  }
  if (adapter == XSDSetAnnotationWrapWriteAction.class) {
    return new XSDSetAnnotationWrapWriteAction(this);
  }
  if (adapter == XSDSetAnnotationWrapNoAction.class) {
    return new XSDSetAnnotationWrapNoAction(this,dataModelName);
  }
  if (adapter == XSDSetAnnotationForeignKeyAction.class) {
    return new XSDSetAnnotationForeignKeyAction(this,dataModelName);
  }
  if (adapter == XSDSetAnnotationForeignKeyInfoAction.class) {
    return new XSDSetAnnotationForeignKeyInfoAction(this,dataModelName);
  }
  if (adapter == XSDSetAnnotationFKFilterAction.class) {
    return new XSDSetAnnotationFKFilterAction(this,dataModelName);
  }
  if (adapter == XSDDeleteConceptAction.class) {
    return new XSDDeleteConceptAction(this);
  }
  return super.getAdapter(adapter);
}
Program: 148063
Project: 148063
Buggy source:
public IFile getReferenceFile(){
  if (file == null) {
    Item item=getInputItem();
    String fileExtension=((WSCustomFormItem)item).getCustomForm().getFilename();
    file=RepositoryResourceUtil.findReferenceFile(IServerObjectRepositoryType.TYPE_RESOURCE,item,fileExtension);
  }
  return file;
}

Fixed version (ground truth):
public IFile getReferenceFile(){
  if (file == null) {
    Item item=getInputItem();
    file=RepositoryResourceUtil.findReferenceFile(IServerObjectRepositoryType.TYPE_CUSTOM_FORM,item,fileExtension);
  }
  return file;
}
Program: 148064
Project: 148064
Buggy source:
public static IFile findReferenceFile(ERepositoryObjectType type,Item item,String fileExtension){
  IFolder folder=RepositoryResourceUtil.getFolder(type);
  String path=item.getState().getPath();
  if (path != null && path.length() > 0) {
    folder=folder.getFolder(path);
  }
  String name=null;
  Property property=item.getProperty();
  if (item instanceof MDMServerObjectItem) {
    name=((MDMServerObjectItem)item).getMDMServerObject().getName();
  }
 else {
    name=property.getLabel();
  }
  String fileName=name + UNDERLINE + property.getVersion()+ DOT+ (fileExtension != null ? fileExtension : "String_Node_Str");
  IFile file=folder.getFile(fileName);
  return file;
}

Fixed version (ground truth):
public static IFile findReferenceFile(ERepositoryObjectType type,Item item,String fileExtension){
  IFolder folder=RepositoryResourceUtil.getFolder(type);
  String path=item.getState().getPath();
  if (path != null && path.length() > 0) {
    folder=folder.getFolder(path);
  }
  String name=null;
  Property property=item.getProperty();
  if (item instanceof MDMServerObjectItem) {
    MDMServerObject mdmServerObject=((MDMServerObjectItem)item).getMDMServerObject();
    name=mdmServerObject.getName();
  }
 else {
    name=property.getLabel();
  }
  String fileName=name + UNDERLINE + property.getVersion()+ DOT+ (fileExtension != null ? fileExtension : "String_Node_Str");
  IFile file=folder.getFile(fileName);
  return file;
}
Program: 148067
Project: 148067
Buggy source:
public void run(){
  parentItem=null;
  selectObj=getSelectedObject().get(0);
  if (selectObj instanceof IRepositoryViewObject) {
    Item pItem=((IRepositoryViewObject)selectObj).getProperty().getItem();
    if (pItem instanceof ContainerItem) {
      parentItem=(ContainerItem)pItem;
    }
  }
  IWorkbenchPartSite site=commonViewer.getCommonNavigator().getSite();
  ViewInputDialog2 vid=new ViewInputDialog2(site,getShell(),getDialogTitle(),Messages.Common_inputName,"String_Node_Str",new IInputValidator(){
    public String isValid(    String newText){
      if (newText == null || newText.trim().length() == 0)       return Messages.Common_nameCanNotBeEmpty;
      if (!Pattern.matches("String_Node_Str",newText)) {
        return Messages.Common_nameInvalid;
      }
      if (RepositoryResourceUtil.isExistByName(parentItem.getRepObjType(),newText.trim())) {
        return Messages.Common_nameIsUsed;
      }
      return null;
    }
  }
,true);
  vid.setBtnShow(false);
  vid.create();
  vid.getShell().setSize(new Point(500,300));
  vid.setBlockOnOpen(true);
  if (vid.open() == Window.CANCEL)   return;
  String key=vid.getValue();
  createServerObject(key);
  commonViewer.refresh(selectObj);
  commonViewer.expandToLevel(selectObj,1);
}

Fixed version (ground truth):
public void run(){
  parentItem=null;
  selectObj=getSelectedObject().get(0);
  if (selectObj instanceof IRepositoryViewObject) {
    Item pItem=((IRepositoryViewObject)selectObj).getProperty().getItem();
    if (pItem instanceof ContainerItem) {
      parentItem=(ContainerItem)pItem;
    }
  }
  IWorkbenchPartSite site=commonViewer.getCommonNavigator().getSite();
  ViewInputDialog2 vid=new ViewInputDialog2(site,getShell(),getDialogTitle(),Messages.Common_inputName,"String_Node_Str",new IInputValidator(){
    public String isValid(    String newText){
      if (newText == null || newText.trim().length() == 0)       return Messages.Common_nameCanNotBeEmpty;
      if (!Pattern.matches("String_Node_Str",newText)) {
        return Messages.Common_nameInvalid;
      }
      if (RepositoryResourceUtil.isExistByName(parentItem.getRepObjType(),newText.trim())) {
        return Messages.Common_nameIsUsed;
      }
      return null;
    }
  }
,true);
  vid.setBtnShow(false);
  vid.create();
  vid.getShell().setSize(new Point(500,400));
  vid.setBlockOnOpen(true);
  if (vid.open() == Window.CANCEL)   return;
  String key=vid.getValue();
  createServerObject(key);
  commonViewer.refresh(selectObj);
  commonViewer.expandToLevel(selectObj,1);
}
Program: 148070
Project: 148070
Buggy source:
public void checkStateChanged(CheckStateChangedEvent event){
  IRepositoryNodeConfiguration config=(IRepositoryNodeConfiguration)event.getElement();
  if (event.getChecked()) {
    enabledConfigs.add(config);
  }
 else {
    enabledConfigs.remove(config);
  }
  enableAllBun.setSelection(enabledConfigs.size() == allConfigs.size());
}

Fixed version (ground truth):
public void checkStateChanged(CheckStateChangedEvent event){
  IRepositoryNodeConfiguration config=(IRepositoryNodeConfiguration)event.getElement();
  if (event.getChecked()) {
    enabledConfigs.add(config);
  }
 else {
    enabledConfigs.remove(config);
  }
  solveProcTriCase();
  enableAllBun.setSelection(enabledConfigs.size() == allConfigs.size());
}
Program: 148071
Project: 148071
Buggy source:
private void findFromContainer(IRepositoryViewObject viewObj,Set<IRepositoryViewObject> viewObjs){
  if (viewObj instanceof ContainerRepositoryObject) {
    for (    IRepositoryViewObject child : ((ContainerRepositoryObject)viewObj).getChildren()) {
      if (child instanceof ContainerRepositoryObject) {
        findFromContainer(child,viewObjs);
      }
 else {
        Item item=child.getProperty().getItem();
        List<Object> selectedObject=getSelectedObject();
        boolean exist=false;
        for (        Object obj : selectedObject) {
          if (obj instanceof IRepositoryViewObject) {
            IRepositoryViewObject vobject=(IRepositoryViewObject)obj;
            if (child == vobject) {
              exist=true;
            }
          }
        }
        if (!exist)         return;
        if (item instanceof MDMServerObjectItem) {
          MDMServerObject serverObject=((MDMServerObjectItem)item).getMDMServerObject();
          if (serverObject.isChanged()) {
            if (serverObject.getLastServerDef() != null) {
              defNames.add(serverObject.getLastServerDef().getName());
            }
            viewObjs.add(child);
          }
        }
      }
    }
  }
  IS_DEPLOYALL_FLAG=true;
}

Fixed version (ground truth):
private void findFromContainer(IRepositoryViewObject viewObj,Set<IRepositoryViewObject> viewObjs){
  if (viewObj instanceof ContainerRepositoryObject) {
    for (    IRepositoryViewObject child : ((ContainerRepositoryObject)viewObj).getChildren()) {
      if (child instanceof ContainerRepositoryObject) {
        findFromContainer(child,viewObjs);
      }
 else {
        Item item=child.getProperty().getItem();
        List<Object> selectedObject=getSelectedObject();
        boolean exist=false;
        for (        Object obj : selectedObject) {
          if (obj instanceof IRepositoryViewObject) {
            IRepositoryViewObject vobject=(IRepositoryViewObject)obj;
            if (child == vobject) {
              exist=true;
            }
          }
        }
        if (!exist)         continue;
        if (item instanceof MDMServerObjectItem) {
          MDMServerObject serverObject=((MDMServerObjectItem)item).getMDMServerObject();
          if (serverObject.isChanged() || serverObject.isCreated()) {
            if (serverObject.getLastServerDef() != null) {
              defNames.add(serverObject.getLastServerDef().getName());
            }
            viewObjs.add(child);
          }
        }
      }
    }
  }
  IS_DEPLOYALL_FLAG=true;
}
Program: 148072
Project: 148072
Buggy source:
private void saveLastServer(MDMServerObjectItem item,MDMServerDef serverDef){
  MDMServerObject mdmServerObject=item.getMDMServerObject();
  mdmServerObject.setChanged(false);
  mdmServerObject.setLastServerDef(serverDef);
  try {
    factory.save(item);
    refreshParent();
  }
 catch (  PersistenceException e) {
    log.error(e.getMessage(),e);
  }
}

Fixed version (ground truth):
private void saveLastServer(MDMServerObjectItem item,MDMServerDef serverDef){
  MDMServerObject mdmServerObject=item.getMDMServerObject();
  mdmServerObject.setChanged(false);
  mdmServerObject.setCreated(false);
  mdmServerObject.setLastServerDef(serverDef);
  try {
    factory.save(item);
    refreshParent();
  }
 catch (  PersistenceException e) {
    log.error(e.getMessage(),e);
  }
}
Program: 148073
Project: 148073
Buggy source:
private void saveLastServer(MDMServerObjectItem item,MDMServerDef serverDef){
  MDMServerObject mdmServerObject=item.getMDMServerObject();
  mdmServerObject.setChanged(false);
  mdmServerObject.setLastServerDef(serverDef);
  try {
    factory.save(item);
    refreshParent();
  }
 catch (  PersistenceException e) {
    log.error(e.getMessage(),e);
  }
}

Fixed version (ground truth):
private void saveLastServer(MDMServerObjectItem item,MDMServerDef serverDef){
  MDMServerObject mdmServerObject=item.getMDMServerObject();
  mdmServerObject.setChanged(false);
  mdmServerObject.setCreated(false);
  mdmServerObject.setLastServerDef(serverDef);
  try {
    factory.save(item);
    refreshParent();
  }
 catch (  PersistenceException e) {
    log.error(e.getMessage(),e);
  }
}
Program: 148074
Project: 148074
Buggy source:
protected boolean createServerObject(String key){
  WSDataClusterItem item=MdmpropertiesFactory.eINSTANCE.createWSDataClusterItem();
  ItemState itemState=PropertiesFactory.eINSTANCE.createItemState();
  item.setState(itemState);
  WSDataClusterE datacontainer=newDataContainer(key);
  item.setWsDataCluster(datacontainer);
  if (parentItem != null) {
    item.getState().setPath(parentItem.getState().getPath());
    return RepositoryResourceUtil.createItem(item,key);
  }
  return true;
}

Fixed version (ground truth):
protected boolean createServerObject(String key){
  WSDataClusterItem item=MdmpropertiesFactory.eINSTANCE.createWSDataClusterItem();
  ItemState itemState=PropertiesFactory.eINSTANCE.createItemState();
  item.setState(itemState);
  WSDataClusterE datacontainer=newDataContainer(key);
  datacontainer.setCreated(true);
  item.setWsDataCluster(datacontainer);
  if (parentItem != null) {
    item.getState().setPath(parentItem.getState().getPath());
    return RepositoryResourceUtil.createItem(item,key);
  }
  return true;
}
Program: 148075
Project: 148075
Buggy source:
protected boolean createServerObject(String key){
  WSDataModelItem item=MdmpropertiesFactory.eINSTANCE.createWSDataModelItem();
  ItemState itemState=PropertiesFactory.eINSTANCE.createItemState();
  item.setState(itemState);
  WSDataModelE dataModel=newBlankDataModel(key);
  item.setWsDataModel(dataModel);
  if (parentItem != null) {
    item.getState().setPath(parentItem.getState().getPath());
    return RepositoryResourceUtil.createItem(item,key);
  }
  return false;
}

Fixed version (ground truth):
protected boolean createServerObject(String key){
  WSDataModelItem item=MdmpropertiesFactory.eINSTANCE.createWSDataModelItem();
  ItemState itemState=PropertiesFactory.eINSTANCE.createItemState();
  item.setState(itemState);
  WSDataModelE dataModel=newBlankDataModel(key);
  dataModel.setCreated(true);
  item.setWsDataModel(dataModel);
  if (parentItem != null) {
    item.getState().setPath(parentItem.getState().getPath());
    return RepositoryResourceUtil.createItem(item,key);
  }
  return false;
}
Program: 148076
Project: 148076
Buggy source:
protected boolean createServerObject(String key){
  WSMenuItem item=MdmpropertiesFactory.eINSTANCE.createWSMenuItem();
  ItemState itemState=PropertiesFactory.eINSTANCE.createItemState();
  item.setState(itemState);
  WSMenuE menu=newBlankMenu(key);
  item.setWsMenu(menu);
  if (parentItem != null) {
    item.getState().setPath(parentItem.getState().getPath());
    return RepositoryResourceUtil.createItem(item,key);
  }
  return false;
}

Fixed version (ground truth):
protected boolean createServerObject(String key){
  WSMenuItem item=MdmpropertiesFactory.eINSTANCE.createWSMenuItem();
  ItemState itemState=PropertiesFactory.eINSTANCE.createItemState();
  item.setState(itemState);
  WSMenuE menu=newBlankMenu(key);
  menu.setCreated(true);
  item.setWsMenu(menu);
  if (parentItem != null) {
    item.getState().setPath(parentItem.getState().getPath());
    return RepositoryResourceUtil.createItem(item,key);
  }
  return false;
}
Program: 148077
Project: 148077
Buggy source:
protected boolean createServerObject(String key){
  WSTransformerV2Item item=MdmpropertiesFactory.eINSTANCE.createWSTransformerV2Item();
  ItemState itemState=PropertiesFactory.eINSTANCE.createItemState();
  item.setState(itemState);
  WSTransformerV2E process=newProcess(key);
  item.setWsTransformerV2(process);
  if (parentItem != null) {
    item.getState().setPath(parentItem.getState().getPath());
    return RepositoryResourceUtil.createItem(item,key);
  }
  return false;
}

Fixed version (ground truth):
protected boolean createServerObject(String key){
  WSTransformerV2Item item=MdmpropertiesFactory.eINSTANCE.createWSTransformerV2Item();
  ItemState itemState=PropertiesFactory.eINSTANCE.createItemState();
  item.setState(itemState);
  WSTransformerV2E process=newProcess(key);
  process.setCreated(true);
  item.setWsTransformerV2(process);
  if (parentItem != null) {
    item.getState().setPath(parentItem.getState().getPath());
    return RepositoryResourceUtil.createItem(item,key);
  }
  return false;
}
Program: 148078
Project: 148078
Buggy source:
protected boolean createServerObject(IFile file){
  WSResourceItem item=MdmpropertiesFactory.eINSTANCE.createWSResourceItem();
  ItemState itemState=PropertiesFactory.eINSTANCE.createItemState();
  item.setState(itemState);
  WSResourceE resource=newResource(file);
  item.setResource(resource);
  item.getState().setPath(parentItem != null ? parentItem.getState().getPath() : "String_Node_Str");
  boolean result=RepositoryResourceUtil.createItem(item,resource.getName(),VersionUtils.DEFAULT_VERSION);
  if (result) {
    refreshRepositoryRoot(IServerObjectRepositoryType.TYPE_RESOURCE);
  }
  return result;
}

Fixed version (ground truth):
protected boolean createServerObject(IFile file){
  WSResourceItem item=MdmpropertiesFactory.eINSTANCE.createWSResourceItem();
  ItemState itemState=PropertiesFactory.eINSTANCE.createItemState();
  item.setState(itemState);
  WSResourceE resource=newResource(file);
  resource.setCreated(true);
  item.setResource(resource);
  item.getState().setPath(parentItem != null ? parentItem.getState().getPath() : "String_Node_Str");
  boolean result=RepositoryResourceUtil.createItem(item,resource.getName(),VersionUtils.DEFAULT_VERSION);
  if (result) {
    refreshRepositoryRoot(IServerObjectRepositoryType.TYPE_RESOURCE);
  }
  return result;
}
Program: 148079
Project: 148079
Buggy source:
protected boolean createServerObject(String key){
  WSRoleItem item=MdmpropertiesFactory.eINSTANCE.createWSRoleItem();
  ItemState itemState=PropertiesFactory.eINSTANCE.createItemState();
  item.setState(itemState);
  WSRoleE role=newRole(key);
  item.setWsRole(role);
  if (parentItem != null) {
    item.getState().setPath(parentItem.getState().getPath());
    return RepositoryResourceUtil.createItem(item,key);
  }
  return true;
}

Fixed version (ground truth):
protected boolean createServerObject(String key){
  WSRoleItem item=MdmpropertiesFactory.eINSTANCE.createWSRoleItem();
  ItemState itemState=PropertiesFactory.eINSTANCE.createItemState();
  item.setState(itemState);
  WSRoleE role=newRole(key);
  role.setCreated(true);
  item.setWsRole(role);
  if (parentItem != null) {
    item.getState().setPath(parentItem.getState().getPath());
    return RepositoryResourceUtil.createItem(item,key);
  }
  return true;
}
Program: 148080
Project: 148080
Buggy source:
protected boolean createServerObject(String key){
  WSServiceConfigurationItem item=MdmpropertiesFactory.eINSTANCE.createWSServiceConfigurationItem();
  ItemState itemState=PropertiesFactory.eINSTANCE.createItemState();
  item.setState(itemState);
  WSServiceConfigurationE serConfig=newServiceConfiguration(key);
  item.setWsServiceConfiguration(serConfig);
  if (parentItem != null) {
    item.getState().setPath(parentItem.getState().getPath());
    return RepositoryResourceUtil.createItem(item,key);
  }
  return false;
}

Fixed version (ground truth):
protected boolean createServerObject(String key){
  WSServiceConfigurationItem item=MdmpropertiesFactory.eINSTANCE.createWSServiceConfigurationItem();
  ItemState itemState=PropertiesFactory.eINSTANCE.createItemState();
  item.setState(itemState);
  WSServiceConfigurationE serConfig=newServiceConfiguration(key);
  serConfig.setCreated(true);
  item.setWsServiceConfiguration(serConfig);
  if (parentItem != null) {
    item.getState().setPath(parentItem.getState().getPath());
    return RepositoryResourceUtil.createItem(item,key);
  }
  return false;
}
Program: 148081
Project: 148081
Buggy source:
protected boolean createServerObject(String key){
  WSStoredProcedureItem item=MdmpropertiesFactory.eINSTANCE.createWSStoredProcedureItem();
  ItemState itemState=PropertiesFactory.eINSTANCE.createItemState();
  item.setState(itemState);
  WSStoredProcedureE storedProcedure=newStoredProcedure(key);
  item.setWsStoredProcedure(storedProcedure);
  if (parentItem != null) {
    item.getState().setPath(parentItem.getState().getPath());
    return RepositoryResourceUtil.createItem(item,key);
  }
  return true;
}

Fixed version (ground truth):
protected boolean createServerObject(String key){
  WSStoredProcedureItem item=MdmpropertiesFactory.eINSTANCE.createWSStoredProcedureItem();
  ItemState itemState=PropertiesFactory.eINSTANCE.createItemState();
  item.setState(itemState);
  WSStoredProcedureE storedProcedure=newStoredProcedure(key);
  storedProcedure.setCreated(true);
  item.setWsStoredProcedure(storedProcedure);
  if (parentItem != null) {
    item.getState().setPath(parentItem.getState().getPath());
    return RepositoryResourceUtil.createItem(item,key);
  }
  return true;
}
Program: 148082
Project: 148082
Buggy source:
protected boolean createServerObject(String key){
  WSSynchronizationPlanItem item=MdmpropertiesFactory.eINSTANCE.createWSSynchronizationPlanItem();
  ItemState itemState=PropertiesFactory.eINSTANCE.createItemState();
  item.setState(itemState);
  WSSynchronizationPlanE synchronizationplan=newSynchronizationPlan(key);
  item.setWsSynchronizationPlan(synchronizationplan);
  if (parentItem != null) {
    item.getState().setPath(parentItem.getState().getPath());
    return RepositoryResourceUtil.createItem(item,key);
  }
  return true;
}

Fixed version (ground truth):
protected boolean createServerObject(String key){
  WSSynchronizationPlanItem item=MdmpropertiesFactory.eINSTANCE.createWSSynchronizationPlanItem();
  ItemState itemState=PropertiesFactory.eINSTANCE.createItemState();
  item.setState(itemState);
  WSSynchronizationPlanE synchronizationplan=newSynchronizationPlan(key);
  synchronizationplan.setCreated(true);
  item.setWsSynchronizationPlan(synchronizationplan);
  if (parentItem != null) {
    item.getState().setPath(parentItem.getState().getPath());
    return RepositoryResourceUtil.createItem(item,key);
  }
  return true;
}
Program: 148083
Project: 148083
Buggy source:
protected boolean createServerObject(String key){
  WSRoutingRuleItem item=MdmpropertiesFactory.eINSTANCE.createWSRoutingRuleItem();
  ItemState itemState=PropertiesFactory.eINSTANCE.createItemState();
  item.setState(itemState);
  WSRoutingRuleE routingRule=newRoutingRule(key);
  item.setWsRoutingRule(routingRule);
  if (parentItem != null) {
    item.getState().setPath(parentItem.getState().getPath());
    return RepositoryResourceUtil.createItem(item,key);
  }
  return true;
}

Fixed version (ground truth):
protected boolean createServerObject(String key){
  WSRoutingRuleItem item=MdmpropertiesFactory.eINSTANCE.createWSRoutingRuleItem();
  ItemState itemState=PropertiesFactory.eINSTANCE.createItemState();
  item.setState(itemState);
  WSRoutingRuleE routingRule=newRoutingRule(key);
  routingRule.setCreated(true);
  item.setWsRoutingRule(routingRule);
  if (parentItem != null) {
    item.getState().setPath(parentItem.getState().getPath());
    return RepositoryResourceUtil.createItem(item,key);
  }
  return true;
}
Program: 148084
Project: 148084
Buggy source:
protected boolean createServerObject(String key){
  WSUniverseItem item=MdmpropertiesFactory.eINSTANCE.createWSUniverseItem();
  ItemState itemState=PropertiesFactory.eINSTANCE.createItemState();
  item.setState(itemState);
  WSUniverseE universe=newWSUniverse(key);
  item.setWsUniverse(universe);
  if (parentItem != null) {
    item.getState().setPath(parentItem.getState().getPath());
    return RepositoryResourceUtil.createItem(item,key);
  }
  return true;
}

Fixed version (ground truth):
protected boolean createServerObject(String key){
  WSUniverseItem item=MdmpropertiesFactory.eINSTANCE.createWSUniverseItem();
  ItemState itemState=PropertiesFactory.eINSTANCE.createItemState();
  item.setState(itemState);
  WSUniverseE universe=newWSUniverse(key);
  universe.setCreated(true);
  item.setWsUniverse(universe);
  if (parentItem != null) {
    item.getState().setPath(parentItem.getState().getPath());
    return RepositoryResourceUtil.createItem(item,key);
  }
  return true;
}
Program: 148085
Project: 148085
Buggy source:
protected boolean createServerObject(String key){
  WSViewItem item=MdmpropertiesFactory.eINSTANCE.createWSViewItem();
  ItemState itemState=PropertiesFactory.eINSTANCE.createItemState();
  item.setState(itemState);
  WSViewE view=newView(key);
  item.setWsView(view);
  if (parentItem != null) {
    item.getState().setPath(parentItem.getState().getPath());
  }
 else {
    item.getState().setPath("String_Node_Str");
  }
  return RepositoryResourceUtil.createItem(item,key);
}

Fixed version (ground truth):
protected boolean createServerObject(String key){
  WSViewItem item=MdmpropertiesFactory.eINSTANCE.createWSViewItem();
  ItemState itemState=PropertiesFactory.eINSTANCE.createItemState();
  item.setState(itemState);
  WSViewE view=newView(key);
  view.setCreated(true);
  item.setWsView(view);
  if (parentItem != null) {
    item.getState().setPath(parentItem.getState().getPath());
  }
 else {
    item.getState().setPath("String_Node_Str");
  }
  return RepositoryResourceUtil.createItem(item,key);
}
Program: 148086
Project: 148086
Buggy source:
protected boolean createServerObject(String key){
  WSWorkflowItem item=MdmpropertiesFactory.eINSTANCE.createWSWorkflowItem();
  ItemState itemState=PropertiesFactory.eINSTANCE.createItemState();
  item.setState(itemState);
  WSWorkflowE workflow=newWorkflow(workflowName);
  item.setWsWorkflow(workflow);
  item.getState().setPath("String_Node_Str");
  boolean result=RepositoryResourceUtil.createItem(item,workflowName,version);
  if (result) {
    refreshRepositoryRoot(IServerObjectRepositoryType.TYPE_WORKFLOW);
  }
  return result;
}

Fixed version (ground truth):
protected boolean createServerObject(String key){
  WSWorkflowItem item=MdmpropertiesFactory.eINSTANCE.createWSWorkflowItem();
  ItemState itemState=PropertiesFactory.eINSTANCE.createItemState();
  item.setState(itemState);
  WSWorkflowE workflow=newWorkflow(workflowName);
  workflow.setCreated(true);
  item.setWsWorkflow(workflow);
  item.getState().setPath("String_Node_Str");
  boolean result=RepositoryResourceUtil.createItem(item,workflowName,version);
  if (result) {
    refreshRepositoryRoot(IServerObjectRepositoryType.TYPE_WORKFLOW);
  }
  return result;
}
Program: 148087
Project: 148087
Buggy source:
private void createMDMServerViewDef(MDMServerDef serverDef){
  com.amalto.workbench.utils.MDMServerDef serDef=com.amalto.workbench.utils.MDMServerDef.parse(serverDef.getUrl(),serverDef.getUser(),serverDef.getPasswd(),serverDef.getUniverse(),serverDef.getName());
  boolean saved=MDMServerHelper.saveServer(serDef);
  if (!saved) {
    MessageDialog.openError(null,"String_Node_Str","String_Node_Str");
  }
  IWorkbenchPage page=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
  ServerView viewPart=(ServerView)page.findView(ServerView.VIEW_ID);
  if (viewPart != null) {
    (viewPart).getViewer().refresh();
    ((ServerView)viewPart).initView();
  }
}

Fixed version (ground truth):
private void createMDMServerViewDef(MDMServerDef serverDef){
  com.amalto.workbench.utils.MDMServerDef serDef=com.amalto.workbench.utils.MDMServerDef.parse(serverDef.getUrl(),serverDef.getUser(),serverDef.getPasswd(),serverDef.getUniverse(),serverDef.getName());
  boolean saved=MDMServerHelper.saveServer(serDef);
  if (!saved) {
    MessageDialog.openError(null,"String_Node_Str","String_Node_Str");
  }
  IWorkbenchPage page=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
  ServerView viewPart=(ServerView)page.findView(ServerView.VIEW_ID);
  if (viewPart != null) {
    ((ServerView)viewPart).initView();
    (viewPart).getViewer().collapseAll();
    (viewPart).getViewer().refresh();
  }
}
Program: 148088
Project: 148088
Buggy source:
public ImportServerObjectWizard(CommonViewer commonViewer){
  setNeedsProgressMonitor(true);
  this.commonViewer=commonViewer;
}

Fixed version (ground truth):
public ImportServerObjectWizard(CommonViewer commonViewer){
  setNeedsProgressMonitor(true);
  this.commonViewer=commonViewer;
  IWorkbenchPage page=commonViewer.getCommonNavigator().getSite().getPage();
  IViewPart viewPart=page.findView(ServerView.VIEW_ID);
  if (viewPart != null) {
    hideView=false;
  }
  view=ServerView.show();
}
Program: 148089
Project: 148089
Buggy source:
@Override public boolean performCancel(){
  hideServerView(view);
  return super.performCancel();
}

Fixed version (ground truth):
@Override public boolean performCancel(){
  if (hideView) {
    hideServerView(view);
  }
  return super.performCancel();
}
Program: 148090
Project: 148090
Buggy source:
@Override public boolean performFinish(){
  try {
    doImport();
    hideServerView(view);
  }
 catch (  InvocationTargetException e) {
    log.error(e);
    return false;
  }
catch (  InterruptedException e) {
    log.error(e);
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  try {
    doImport();
    if (hideView) {
      hideServerView(view);
    }
  }
 catch (  InvocationTargetException e) {
    log.error(e);
    return false;
  }
catch (  InterruptedException e) {
    log.error(e);
    return false;
  }
  return true;
}
Program: 148092
Project: 148092
Buggy source:
protected SelectItemsPage(){
  super("String_Node_Str");
  setTitle(Messages.ImportServerObject);
  setPageComplete(false);
}

Fixed version (ground truth):
protected SelectItemsPage(){
  super("String_Node_Str");
  setTitle(Messages.ImportServerObject);
}
Program: 148093
Project: 148093
Buggy source:
@Override public Object getAdapter(Class adapter){
  if (adapter == GenerateWorkflowWizard.class) {
    return new GenerateWorkflowWizardR(this);
  }
  if (adapter == AddBrowseItemsWizard.class) {
    return new AddBrowseItemsWizardR(this);
  }
  if (adapter == XSDSetAnnotationWriteAction.class) {
    return new XSDSetAnnotationWriteActionR(this);
  }
  if (adapter == XSDSetAnnotationNoAction.class) {
    return new XSDSetAnnotationNoActionR(this,dataModelName);
  }
  return super.getAdapter(adapter);
}

Fixed version (ground truth):
@Override public Object getAdapter(Class adapter){
  if (adapter == GenerateWorkflowWizard.class) {
    return new GenerateWorkflowWizardR(this);
  }
  if (adapter == AddBrowseItemsWizard.class) {
    return new AddBrowseItemsWizardR(this);
  }
  if (adapter == XSDSetAnnotationWriteAction.class) {
    return new XSDSetAnnotationWriteActionR(this);
  }
  if (adapter == XSDSetAnnotationNoAction.class) {
    return new XSDSetAnnotationNoActionR(this,dataModelName);
  }
  if (adapter == XSDSetAnnotationWrapWriteAction.class) {
    return new XSDSetAnnotationWrapWriteActionR(this);
  }
  return super.getAdapter(adapter);
}