nus-yam/ex-repair huggingface dataset:
Program: 147668
Project: 147668
Buggy source:
public List<Change> getChanges(){
  List<Change> changes=new LinkedList<ModelImpactAnalyseService.Change>();
  for (  Severity severity : getSeverities()) {
    if (severity.getChanges() != null) {
      for (      Change change : severity.getChanges()) {
        int s=0;
        if (severity instanceof SeverityHigh) {
          s=HIGH;
        }
 else         if (severity instanceof SeverityMedium) {
          s=MEDIUM;
        }
 else         if (severity instanceof SeverityLow) {
          s=LOW;
        }
        change.setSeverity(s);
        changes.add(change);
      }
    }
  }
  return changes;
}

Fixed version (ground truth):
public List<Change> getChanges(){
  List<Change> changes=new LinkedList<ModelImpactAnalyseService.Change>();
  if (getSeverities() != null) {
    for (    Severity severity : getSeverities()) {
      if (severity.getChanges() != null) {
        for (        Change change : severity.getChanges()) {
          int s=0;
          if (severity instanceof SeverityHigh) {
            s=HIGH;
          }
 else           if (severity instanceof SeverityMedium) {
            s=MEDIUM;
          }
 else           if (severity instanceof SeverityLow) {
            s=LOW;
          }
          change.setSeverity(s);
          changes.add(change);
        }
      }
    }
  }
  return changes;
}
Program: 147669
Project: 147669
Buggy source:
public List<Severity> getSeverities(){
  return this.severities;
}

Fixed version (ground truth):
public List<Severity> getSeverities(){
  return severities;
}
Program: 147670
Project: 147670
Buggy source:
@Override protected void openAnotherVersion(RepositoryNode node,boolean readonly){
  IRepositoryViewObject viewObject=node.getObject();
  Item item=viewObject.getProperty().getItem();
  IRepositoryNodeConfiguration configuration=RepositoryNodeConfigurationManager.getConfiguration(item);
  if (configuration != null) {
    IRepositoryNodeActionProvider actionProvider=configuration.getActionProvider();
    if (actionProvider != null) {
      IRepositoryViewEditorInput editorInput=actionProvider.getOpenEditorInput(viewObject);
      editorInput.setReadOnly(readonly);
      if (editorInput != null) {
        IWorkbenchPage page=MDMRepositoryView.show().getCommonViewer().getCommonNavigator().getSite().getWorkbenchWindow().getActivePage();
        try {
          updateEditorInputVersionInfo(editorInput,viewObject);
          page.openEditor(editorInput,editorInput.getEditorId(),readonly);
          this.viewObject=viewObject;
        }
 catch (        PartInitException e) {
          log.error(e.getMessage(),e);
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override protected void openAnotherVersion(final RepositoryNode node,boolean readonly){
  Display.getCurrent().asyncExec(new Runnable(){
    public void run(){
      IRepositoryViewObject viewObject=node.getObject();
      Item item=viewObject.getProperty().getItem();
      boolean latestVersion=isLatestVersion(viewObject);
      IRepositoryNodeConfiguration configuration=RepositoryNodeConfigurationManager.getConfiguration(item);
      if (configuration != null) {
        IRepositoryNodeActionProvider actionProvider=configuration.getActionProvider();
        if (actionProvider != null) {
          IRepositoryViewEditorInput editorInput=actionProvider.getOpenEditorInput(viewObject);
          editorInput.setReadOnly(latestVersion);
          if (editorInput != null) {
            IWorkbenchPage page=MDMRepositoryView.show().getCommonViewer().getCommonNavigator().getSite().getWorkbenchWindow().getActivePage();
            try {
              updateEditorInputVersionInfo(editorInput,viewObject);
              page.openEditor(editorInput,editorInput.getEditorId(),!latestVersion);
              setViewObj(viewObject);
            }
 catch (            PartInitException e) {
              log.error(e.getMessage(),e);
            }
          }
        }
      }
    }
    private boolean isLatestVersion(    final IRepositoryViewObject viewObj){
      String selectedVersion=viewObj.getProperty().getVersion();
      int compare=VersionUtils.compareTo(selectedVersion,getOriginVersion());
      return compare >= 0;
    }
  }
);
}
Program: 147671
Project: 147671
Buggy source:
private void callModelService(AbstractDeployCommand cmd){
  ICommandParameter parameter=cmd.getParameter();
  if (parameter != null) {
    ImpactOperation operation=(ImpactOperation)parameter.getParameter();
    Boolean force=null;
    if (operation == ImpactOperation.APPLY_LOW_CHANGE) {
      force=false;
    }
 else     if (operation == ImpactOperation.RECREATE_TABLE) {
      force=true;
    }
    try {
      ModelImpactAnalyseService.updateModel(cmd.getServerDef(),cmd.getViewObject(),force);
    }
 catch (    XtentisException e) {
      log.error(e.getMessage(),e);
    }
  }
}

Fixed version (ground truth):
private void callModelService(AbstractDeployCommand cmd) throws XtentisException {
  ICommandParameter parameter=cmd.getParameter();
  if (parameter != null) {
    ImpactOperation operation=(ImpactOperation)parameter.getParameter();
    Boolean force=null;
    if (operation == ImpactOperation.APPLY_LOW_CHANGE) {
      force=false;
    }
 else     if (operation == ImpactOperation.RECREATE_TABLE) {
      force=true;
    }
    ModelImpactAnalyseService.updateModel(cmd.getServerDef(),cmd.getViewObject(),force);
  }
}
Program: 147673
Project: 147673
Buggy source:
@Override public void run(){
  try {
    final XtentisPort port=Util.getPort(new URL(oldServerDef.getUrl()),oldServerDef.getUniverse(),oldServerDef.getUser(),oldServerDef.getPasswd());
    NewItemHandler.createItemRecord(port,log,shell,new WSDataClusterPK(getDataContainer()));
    clusterComposite.doSearch();
  }
 catch (  MalformedURLException e) {
    log.error(e.getMessage(),e);
  }
catch (  XtentisException e) {
    log.error(e.getMessage(),e);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    final XtentisPort port=Util.getPort(new URL(oldServerDef.getUrl()),oldServerDef.getUniverse(),oldServerDef.getUser(),oldServerDef.getPasswd());
    NewItemHandler.createItemRecord(port,shell,new WSDataClusterPK(getDataContainer()));
    clusterComposite.doSearch();
  }
 catch (  MalformedURLException e) {
    log.error(e.getMessage(),e);
  }
catch (  XtentisException e) {
    log.error(e.getMessage(),e);
  }
}
Program: 147674
Project: 147674
Buggy source:
private List<MDMServerDef> getAllServerDefs(){
  if (allServerDefs == null) {
    ILegendServerDefService serverDefService=(ILegendServerDefService)GlobalServiceRegister.getDefault().getService(ILegendServerDefService.class);
    allServerDefs=serverDefService.getLegendServerDefs();
  }
  return allServerDefs;
}

Fixed version (ground truth):
private List<MDMServerDef> getAllServerDefs(){
  if (allServerDefs == null) {
    if (GlobalServiceRegister.getDefault().isServiceRegistered(ILegendServerDefService.class)) {
      ILegendServerDefService serverDefService=(ILegendServerDefService)GlobalServiceRegister.getDefault().getService(ILegendServerDefService.class);
      allServerDefs=serverDefService.getLegendServerDefs();
    }
  }
  return allServerDefs;
}
Program: 147675
Project: 147675
Buggy source:
public void handleEvent(Event event){
  if (event.button == DOMViewDialog.BUTTON_SAVE) {
    try {
      WSPutItem putItem=new WSPutItem(dataClusterPk,d.getXML(),"String_Node_Str".equals(d.getDataModelName()) ? null : new WSDataModelPK(d.getDataModelName()),false);
      WSPutItemWithReport item=new WSPutItemWithReport(putItem,"String_Node_Str",d.isBeforeVerification());
      if (d.isTriggerProcess()) {
        port.putItemWithReport(item);
      }
 else {
        port.putItem(putItem);
      }
    }
 catch (    Exception e) {
      if (log != null) {
        log.error(e.getMessage(),e);
      }
      MessageDialog.openError(shell,Messages.DataClusterBrowserMainPage_100,Messages.bind(Messages.DataClusterBrowserMainPage_101,Util.formatErrorMessage(e.getLocalizedMessage())));
      return;
    }
  }
  d.close();
}

Fixed version (ground truth):
public void handleEvent(Event event){
  if (event.button == DOMViewDialog.BUTTON_SAVE) {
    try {
      WSPutItem putItem=new WSPutItem(dataClusterPk,d.getXML(),"String_Node_Str".equals(d.getDataModelName()) ? null : new WSDataModelPK(d.getDataModelName()),false);
      WSPutItemWithReport item=new WSPutItemWithReport(putItem,"String_Node_Str",d.isBeforeVerification());
      if (d.isTriggerProcess()) {
        port.putItemWithReport(item);
      }
 else {
        port.putItem(putItem);
      }
    }
 catch (    Exception e) {
      log.error(e.getMessage(),e);
      MessageDialog.openError(shell,Messages.DataClusterBrowserMainPage_100,Messages.bind(Messages.DataClusterBrowserMainPage_101,Util.formatErrorMessage(e.getLocalizedMessage())));
      return;
    }
  }
  d.close();
}
Program: 147678
Project: 147678
Buggy source:
public String getSelectedBaseTypeName(){
  if (radCustomTypes.getSelection())   return comboCustomTypes.getCombo().getText();
  return comboBuildInTypes.getCombo().getText();
}

Fixed version (ground truth):
public String getSelectedBaseTypeName(){
  if (radCustomTypes.getSelection()) {
    return comboCustomTypes.getCombo().getText();
  }
  return comboBuildInTypes.getCombo().getText();
}
Program: 147679
Project: 147679
Buggy source:
@Override public int compare(Viewer viewer,Object e1,Object e2){
  String typeName1=getTypeName(e1);
  String typeName2=getTypeName(e2);
  if ("String_Node_Str".equals(typeName1) || "String_Node_Str".equals(typeName2))   return super.compare(viewer,e1,e2);
  int typeCode1=getTypeCode(typeName1);
  int typeCode2=getTypeCode(typeName2);
  if (typeCode1 != typeCode2)   return (typeCode1 - typeCode2);
  return typeName1.compareTo(typeName2);
}

Fixed version (ground truth):
@Override public int compare(Viewer viewer,Object e1,Object e2){
  String typeName1=getTypeName(e1);
  String typeName2=getTypeName(e2);
  if ("String_Node_Str".equals(typeName1) || "String_Node_Str".equals(typeName2)) {
    return super.compare(viewer,e1,e2);
  }
  int typeCode1=getTypeCode(typeName1);
  int typeCode2=getTypeCode(typeName2);
  if (typeCode1 != typeCode2) {
    return (typeCode1 - typeCode2);
  }
  return typeName1.compareTo(typeName2);
}
Program: 147680
Project: 147680
Buggy source:
private void initUIContentForCompFacet(XSDSimpleTypeDefinition baseTypeDef){
  if (baseTypeDef == null) {
    compProperty.setPropertySources(new IPropertySource<?>[0]);
    return;
  }
  List<IPropertySource<?>> propertySources=new ArrayList<IPropertySource<?>>();
  for (  String eachFacetName : baseTypeDef.getValidFacets()) {
    IPropertySource<?> propSource=SimpleTypeFacetPropSourceBuilder.createFacetPropSource(xsdSimpleType,baseTypeDef,eachFacetName,compProperty.getPropertyViewer().getTree());
    if (propSource == null)     continue;
    propertySources.add(propSource);
  }
  compProperty.setPropertySources(propertySources.toArray(new IPropertySource<?>[0]));
}

Fixed version (ground truth):
private void initUIContentForCompFacet(XSDSimpleTypeDefinition baseTypeDef){
  if (baseTypeDef == null) {
    compProperty.setPropertySources(new IPropertySource<?>[0]);
    return;
  }
  List<IPropertySource<?>> propertySources=new ArrayList<IPropertySource<?>>();
  for (  String eachFacetName : baseTypeDef.getValidFacets()) {
    IPropertySource<?> propSource=SimpleTypeFacetPropSourceBuilder.createFacetPropSource(xsdSimpleType,baseTypeDef,eachFacetName,compProperty.getPropertyViewer().getTree());
    if (propSource == null) {
      continue;
    }
    propertySources.add(propSource);
  }
  compProperty.setPropertySources(propertySources.toArray(new IPropertySource<?>[0]));
}
Program: 147681
Project: 147681
Buggy source:
private XSDSimpleTypeDefinition getCurSelectedBuildInBaseType(){
  IStructuredSelection selection=(IStructuredSelection)comboBuildInTypes.getSelection();
  if (selection == null || selection.isEmpty())   return null;
  return (XSDSimpleTypeDefinition)selection.getFirstElement();
}

Fixed version (ground truth):
private XSDSimpleTypeDefinition getCurSelectedBuildInBaseType(){
  IStructuredSelection selection=(IStructuredSelection)comboBuildInTypes.getSelection();
  if (selection == null || selection.isEmpty()) {
    return null;
  }
  return (XSDSimpleTypeDefinition)selection.getFirstElement();
}
Program: 147682
Project: 147682
Buggy source:
private void initUIContentsForComboCustomTypes(){
  comboCustomTypes.removeSelectionChangedListener(customChangedListener);
  List<String> allCustomTypeNames=null;
  if (xsdSimpleType.getSchema() != null) {
    allCustomTypeNames=Util.getAllCustomTypeNames(xsdSimpleType.getSchema());
  }
  if (xsdSimpleType.getName() != null && allCustomTypeNames != null) {
    allCustomTypeNames.remove(xsdSimpleType.getName());
  }
  if (allCustomTypeNames != null)   comboCustomTypes.setInput(allCustomTypeNames);
  if (xsdSimpleType.getBaseType() != null && xsdSimpleType.getBaseType().getName() != null) {
    comboCustomTypes.setSelection(new StructuredSelection(xsdSimpleType.getBaseType().getName()));
  }
  radCustomTypes.setSelection(!comboCustomTypes.getSelection().isEmpty());
  comboCustomTypes.addSelectionChangedListener(customChangedListener);
}

Fixed version (ground truth):
private void initUIContentsForComboCustomTypes(){
  comboCustomTypes.removeSelectionChangedListener(customChangedListener);
  List<String> allCustomTypeNames=null;
  if (xsdSimpleType.getSchema() != null) {
    allCustomTypeNames=Util.getAllCustomTypeNames(xsdSimpleType.getSchema());
  }
  if (xsdSimpleType.getName() != null && allCustomTypeNames != null) {
    allCustomTypeNames.remove(xsdSimpleType.getName());
  }
  if (allCustomTypeNames != null) {
    comboCustomTypes.setInput(allCustomTypeNames);
  }
  if (xsdSimpleType.getBaseType() != null && xsdSimpleType.getBaseType().getName() != null) {
    comboCustomTypes.setSelection(new StructuredSelection(xsdSimpleType.getBaseType().getName()));
  }
  radCustomTypes.setSelection(!comboCustomTypes.getSelection().isEmpty());
  comboCustomTypes.addSelectionChangedListener(customChangedListener);
}
Program: 147683
Project: 147683
Buggy source:
public void mouseDown(MouseEvent e){
  ISelection oldSelection=comboBuildInTypes.getSelection();
  comboBuildInTypes.setInput(Util.getAllBuildInTypes(xsdSimpleType.getSchema()));
  comboBuildInTypes.setSelection(oldSelection);
}

Fixed version (ground truth):
@Override public void mouseDown(MouseEvent e){
  ISelection oldSelection=comboBuildInTypes.getSelection();
  comboBuildInTypes.setInput(Util.getAllBuildInTypes(xsdSimpleType.getSchema()));
  comboBuildInTypes.setSelection(oldSelection);
}
Program: 147684
Project: 147684
Buggy source:
private XSDSimpleTypeDefinition getCurSelectedCustomBaseType(){
  IStructuredSelection selection=(IStructuredSelection)comboCustomTypes.getSelection();
  if (selection == null || selection.isEmpty())   return null;
  XSDSimpleTypeDefinition curSelectedCustomBaseType=xsdSimpleType.getSchema().resolveSimpleTypeDefinition(xsdSimpleType.getSchema().getSchemaForSchemaNamespace(),(String)selection.getFirstElement());
  if (!xsdSimpleType.getSchema().getTypeDefinitions().contains(curSelectedCustomBaseType))   return xsdSimpleType.getSchema().resolveSimpleTypeDefinition(xsdSimpleType.getSchema().getSchemaForSchemaNamespace(),"String_Node_Str");
  return curSelectedCustomBaseType;
}

Fixed version (ground truth):
private XSDSimpleTypeDefinition getCurSelectedCustomBaseType(){
  IStructuredSelection selection=(IStructuredSelection)comboCustomTypes.getSelection();
  if (selection == null || selection.isEmpty()) {
    return null;
  }
  XSDSimpleTypeDefinition curSelectedCustomBaseType=xsdSimpleType.getSchema().resolveSimpleTypeDefinition(xsdSimpleType.getSchema().getSchemaForSchemaNamespace(),(String)selection.getFirstElement());
  if (!xsdSimpleType.getSchema().getTypeDefinitions().contains(curSelectedCustomBaseType)) {
    return xsdSimpleType.getSchema().resolveSimpleTypeDefinition(xsdSimpleType.getSchema().getSchemaForSchemaNamespace(),"String_Node_Str");
  }
  return curSelectedCustomBaseType;
}
Program: 147685
Project: 147685
Buggy source:
private String getTypeName(Object typeObj){
  if (typeObj instanceof XSDSimpleTypeDefinition)   return ((XSDSimpleTypeDefinition)typeObj).getName();
  if (typeObj instanceof String)   return (String)typeObj;
  return "String_Node_Str";
}

Fixed version (ground truth):
private String getTypeName(Object typeObj){
  if (typeObj instanceof XSDSimpleTypeDefinition) {
    return ((XSDSimpleTypeDefinition)typeObj).getName();
  }
  if (typeObj instanceof String) {
    return (String)typeObj;
  }
  return "String_Node_Str";
}
Program: 147686
Project: 147686
Buggy source:
public void setSimpleType(XSDSimpleTypeDefinition xsdSimpleType){
  if (xsdSimpleType == null)   return;
  this.xsdSimpleType=xsdSimpleType;
  initUIContent();
}

Fixed version (ground truth):
public void setSimpleType(XSDSimpleTypeDefinition xsdSimpleType){
  if (xsdSimpleType == null) {
    return;
  }
  this.xsdSimpleType=xsdSimpleType;
  initUIContent();
}
Program: 147687
Project: 147687
Buggy source:
public XSDSimpleTypeDefinition getSelectedBaseType(){
  if (radCustomTypes.getSelection())   return getCurSelectedCustomBaseType();
  return getCurSelectedBuildInBaseType();
}

Fixed version (ground truth):
public XSDSimpleTypeDefinition getSelectedBaseType(){
  if (radCustomTypes.getSelection()) {
    return getCurSelectedCustomBaseType();
  }
  return getCurSelectedBuildInBaseType();
}
Program: 147688
Project: 147688
Buggy source:
private void initUIListenerForBaseTypeCombos(){
  customChangedListener=new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent event){
      if (section != null && getSelectedBaseTypeName().length() > 0) {
        section.autoCommit();
      }
    }
  }
;
  comboCustomTypes.getCombo().addMouseListener(new MouseAdapter(){
    @Override public void mouseDown(    MouseEvent e){
      ISelection oldSelection=comboCustomTypes.getSelection();
      List<String> allCustomTypeNames=Util.getAllCustomTypeNames(xsdSimpleType.getSchema());
      allCustomTypeNames.remove(xsdSimpleType.getName());
      comboCustomTypes.setInput(allCustomTypeNames);
      comboCustomTypes.setSelection(oldSelection);
    }
  }
);
  buildInChangedListener=new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent event){
      if (section != null && getSelectedBaseTypeName().length() > 0) {
        section.autoCommit();
      }
    }
  }
;
  comboBuildInTypes.getCombo().addMouseListener(new MouseAdapter(){
    public void mouseDown(    MouseEvent e){
      ISelection oldSelection=comboBuildInTypes.getSelection();
      comboBuildInTypes.setInput(Util.getAllBuildInTypes(xsdSimpleType.getSchema()));
      comboBuildInTypes.setSelection(oldSelection);
    }
  }
);
}

Fixed version (ground truth):
private void initUIListenerForBaseTypeCombos(){
  customChangedListener=new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent event){
      if (section != null && getSelectedBaseTypeName().length() > 0) {
        section.autoCommit();
      }
    }
  }
;
  comboCustomTypes.getCombo().addMouseListener(new MouseAdapter(){
    @Override public void mouseDown(    MouseEvent e){
      ISelection oldSelection=comboCustomTypes.getSelection();
      List<String> allCustomTypeNames=Util.getAllCustomTypeNames(xsdSimpleType.getSchema());
      allCustomTypeNames.remove(xsdSimpleType.getName());
      comboCustomTypes.setInput(allCustomTypeNames);
      comboCustomTypes.setSelection(oldSelection);
    }
  }
);
  buildInChangedListener=new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent event){
      if (section != null && getSelectedBaseTypeName().length() > 0) {
        section.autoCommit();
      }
    }
  }
;
  comboBuildInTypes.getCombo().addMouseListener(new MouseAdapter(){
    @Override public void mouseDown(    MouseEvent e){
      ISelection oldSelection=comboBuildInTypes.getSelection();
      comboBuildInTypes.setInput(Util.getAllBuildInTypes(xsdSimpleType.getSchema()));
      comboBuildInTypes.setSelection(oldSelection);
    }
  }
);
}
Program: 147689
Project: 147689
Buggy source:
private void initUIContentForTxtName(){
  removeNameTxtListener();
  String name=xsdSimpleType.getName() == null ? "String_Node_Str" : xsdSimpleType.getName();
  txtName.setText(name);
  Set<String> uuidtypes=EUUIDCustomType.allTypes();
  if (uuidtypes.contains(name)) {
    txtName.setEditable(false);
  }
  if (name != null) {
    int length=name.length();
    if (length >= caretOffset) {
      txtName.setSelection(caretOffset,caretOffset);
    }
 else {
      txtName.setSelection(length,length);
    }
  }
  addNameTxtListener();
}

Fixed version (ground truth):
private void initUIContentForTxtName(){
  removeNameTxtListener();
  String name=xsdSimpleType.getName() == null ? "String_Node_Str" : xsdSimpleType.getName();
  txtName.setText(name);
  Set<String> uuidTypes=new HashSet<String>();
  for (  EUUIDCustomType current : EUUIDCustomType.values()) {
    uuidTypes.add(current.getName());
  }
  if (uuidTypes.contains(name)) {
    txtName.setEditable(false);
  }
  if (name != null) {
    int length=name.length();
    if (length >= caretOffset) {
      txtName.setSelection(caretOffset,caretOffset);
    }
 else {
      txtName.setSelection(length,length);
    }
  }
  addNameTxtListener();
}
Program: 147690
Project: 147690
Buggy source:
public Map<String,Object> getPropertyName2Values(){
  Map<String,Object> results=new HashMap<String,Object>();
  for (  Entry<String,IPropertySource<?>> eachPropName2PropSource : getPropertySources().entrySet())   results.put(eachPropName2PropSource.getKey(),eachPropName2PropSource.getValue().getPropertyValue());
  return results;
}

Fixed version (ground truth):
public Map<String,Object> getPropertyName2Values(){
  Map<String,Object> results=new HashMap<String,Object>();
  for (  Entry<String,IPropertySource<?>> eachPropName2PropSource : getPropertySources().entrySet()) {
    results.put(eachPropName2PropSource.getKey(),eachPropName2PropSource.getValue().getPropertyValue());
  }
  return results;
}
Program: 147691
Project: 147691
Buggy source:
public Map<String,IPropertySource<?>> getPropertySources(){
  Map<String,IPropertySource<?>> results=new HashMap<String,IPropertySource<?>>();
  for (  IPropertySource<?> eachPropSource : compProperty.getProperySources())   results.put(eachPropSource.getPropertyName(),eachPropSource);
  return results;
}

Fixed version (ground truth):
public Map<String,IPropertySource<?>> getPropertySources(){
  Map<String,IPropertySource<?>> results=new HashMap<String,IPropertySource<?>>();
  for (  IPropertySource<?> eachPropSource : compProperty.getProperySources()) {
    results.put(eachPropSource.getPropertyName(),eachPropSource);
  }
  return results;
}
Program: 147692
Project: 147692
Buggy source:
private int getTypeCode(String typeName){
  if (EUUIDCustomType.allTypes().contains(typeName))   return 0;
  return 1;
}

Fixed version (ground truth):
private int getTypeCode(String typeName){
  Set<String> uuidTypes=new HashSet<String>();
  for (  EUUIDCustomType current : EUUIDCustomType.values()) {
    uuidTypes.add(current.getName());
  }
  if (uuidTypes.contains(typeName)) {
    return 0;
  }
  return 1;
}
Program: 147693
Project: 147693
Buggy source:
/** 
 * DOC hbhong Comment method "getFileInfo".
 * @param input
 * @return // dirName result[0] // fileQName result[1] // fileExtension result[2] // fileName result[3] // versionresult[4]
 */
private String[] getPicResourceFileInfo(String input){
  Matcher m=picFileNamePattern.matcher(input);
  if (m.matches()) {
    String[] result=new String[5];
    result[0]=m.group(1);
    result[1]=m.group(2);
    result[2]=m.group(3);
    result[3]=result[1];
    result[4]=VersionUtils.DEFAULT_VERSION;
    Matcher versionM=picFileVersionPattern.matcher(result[1]);
    if (versionM.matches()) {
      result[3]=versionM.group(1);
      result[4]=versionM.group(2);
    }
    return result;
  }
 else {
    log.error("String_Node_Str" + input);
    return null;
  }
}

Fixed version (ground truth):
/** 
 * DOC hbhong Comment method "getFileInfo".
 * @param input
 * @return // dirName result[0] // fileQName result[1] // fileExtension result[2] // fileName result[3] // versionresult[4]
 */
private String[] getPicResourceFileInfo(String input){
  Matcher m=picFileNamePattern.matcher(input);
  if (m.matches()) {
    String[] result=new String[5];
    result[0]=m.group(1);
    result[1]=m.group(2);
    result[2]=m.group(3);
    result[3]=result[1];
    result[4]=VersionUtils.DEFAULT_VERSION;
    Matcher versionM=picFileVersionPattern.matcher(result[1]);
    if (versionM.matches()) {
      result[3]=versionM.group(1);
      result[4]=versionM.group(2);
    }
    return result;
  }
 else {
    return null;
  }
}
Program: 147694
Project: 147694
Buggy source:
/** 
 * DOC hbhong Comment method "handlePictureResourceObject".
 * @param treeObj
 * @throws IOException
 */
private WSResourceE handlePictureResourceObject(TreeObject treeObj) throws IOException {
  String[] fileInfo=getPicResourceFileInfo(treeObj.getName());
  if (fileInfo != null) {
    String dirName=fileInfo[0];
    String fileQName=fileInfo[1];
    String fileExtension=fileInfo[2];
    String fileName=fileInfo[3];
    String encodedDirName=URLEncoder.encode(dirName,UTF8);
    fileQName=URLEncoder.encode(fileQName,UTF8);
    WSResourceE resource=MdmserverobjectFactory.eINSTANCE.createWSResourceE();
    resource.setName(fileName);
    resource.setFileExtension(fileExtension);
    StringBuffer strBuf=new StringBuffer();
    strBuf.append(serverDef.getProtocol()).append(serverDef.getHost()).append("String_Node_Str").append(serverDef.getPort()).append("String_Node_Str").append(encodedDirName).append("String_Node_Str").append(fileQName).append("String_Node_Str").append(fileExtension);
    String url=strBuf.toString();
    byte[] bytes=HttpClientUtil.downloadFile(url,serverDef.getUser(),serverDef.getPasswd());
    resource.setFileContent(bytes);
    resource.setImageCatalog(dirName);
    treeObj.setName(fileName);
    return resource;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * DOC hbhong Comment method "handlePictureResourceObject".
 * @param treeObj
 * @throws IOException
 */
private WSResourceE handlePictureResourceObject(TreeObject treeObj) throws IOException {
  if (treeObj != null) {
    if (treeObj instanceof TreeParent) {
      return null;
    }
    String[] fileInfo=getPicResourceFileInfo(treeObj.getName());
    if (fileInfo != null) {
      String dirName=fileInfo[0];
      String fileQName=fileInfo[1];
      String fileExtension=fileInfo[2];
      String fileName=fileInfo[3];
      String encodedDirName=URLEncoder.encode(dirName,UTF8);
      fileQName=URLEncoder.encode(fileQName,UTF8);
      WSResourceE resource=MdmserverobjectFactory.eINSTANCE.createWSResourceE();
      resource.setName(fileName);
      resource.setFileExtension(fileExtension);
      StringBuffer strBuf=new StringBuffer();
      strBuf.append(serverDef.getProtocol()).append(serverDef.getHost()).append("String_Node_Str").append(serverDef.getPort()).append("String_Node_Str").append(encodedDirName).append("String_Node_Str").append(fileQName).append("String_Node_Str").append(fileExtension);
      String url=strBuf.toString();
      byte[] bytes=HttpClientUtil.downloadFile(url,serverDef.getUser(),serverDef.getPasswd());
      resource.setFileContent(bytes);
      resource.setImageCatalog(dirName);
      treeObj.setName(fileName);
      return resource;
    }
  }
  return null;
}
Program: 147695
Project: 147695
Buggy source:
private boolean showLockedObjDialog(Object[] objs){
  if (objs == null) {
    return true;
  }
  List<IRepositoryViewObject> viewObjs=new LinkedList<IRepositoryViewObject>();
  for (  Object obj : objs) {
    TreeObject treeObj=(TreeObject)obj;
    String treeObjName=treeObj.getName();
    ERepositoryObjectType type=RepositoryQueryService.getRepositoryObjectType(treeObj.getType());
    if (type != null && treeObjName != null) {
      String uniqueName=getUniqueName(treeObj,treeObjName);
      IRepositoryViewObject viewObject=RepositoryResourceUtil.findViewObjectByName(type,uniqueName);
      if (viewObject != null) {
        viewObjs.add(viewObject);
      }
    }
  }
  LockedObjectDialog lockDialog=new LockedObjectDialog(getShell(),Messages.ImportServerObjectWizard_lockedObjectMessage,viewObjs);
  if (lockDialog.needShowDialog() && lockDialog.open() == IDialogConstants.CANCEL_ID) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
private boolean showLockedObjDialog(Object[] objs){
  if (objs == null) {
    return true;
  }
  List<IRepositoryViewObject> viewObjs=new LinkedList<IRepositoryViewObject>();
  for (  Object obj : objs) {
    TreeObject treeObj=(TreeObject)obj;
    if (treeObj != null && treeObj instanceof TreeParent) {
      continue;
    }
    String treeObjName=treeObj.getName();
    ERepositoryObjectType type=RepositoryQueryService.getRepositoryObjectType(treeObj.getType());
    if (type != null && treeObjName != null) {
      String uniqueName=getUniqueName(treeObj,treeObjName);
      IRepositoryViewObject viewObject=RepositoryResourceUtil.findViewObjectByName(type,uniqueName);
      if (viewObject != null) {
        viewObjs.add(viewObject);
      }
    }
  }
  LockedObjectDialog lockDialog=new LockedObjectDialog(getShell(),Messages.ImportServerObjectWizard_lockedObjectMessage,viewObjs);
  if (lockDialog.needShowDialog() && lockDialog.open() == IDialogConstants.CANCEL_ID) {
    return false;
  }
  return true;
}
Program: 147696
Project: 147696
Buggy source:
/** 
 * DOC hbhong Comment method "getFileInfo".
 * @param input
 * @return // dirName result[0] // fileQName result[1] // fileExtension result[2] // fileName result[3] // versionresult[4]
 */
private String[] getPicResourceFileInfo(String input){
  Matcher m=picFileNamePattern.matcher(input);
  if (m.matches()) {
    String[] result=new String[5];
    result[0]=m.group(1);
    result[1]=m.group(2);
    result[2]=m.group(3);
    result[3]=result[1];
    result[4]=VersionUtils.DEFAULT_VERSION;
    Matcher versionM=picFileVersionPattern.matcher(result[1]);
    if (versionM.matches()) {
      result[3]=versionM.group(1);
      result[4]=versionM.group(2);
    }
    return result;
  }
 else {
    log.error("String_Node_Str" + input);
    return null;
  }
}

Fixed version (ground truth):
/** 
 * DOC hbhong Comment method "getFileInfo".
 * @param input
 * @return // dirName result[0] // fileQName result[1] // fileExtension result[2] // fileName result[3] // versionresult[4]
 */
private String[] getPicResourceFileInfo(String input){
  Matcher m=picFileNamePattern.matcher(input);
  if (m.matches()) {
    String[] result=new String[5];
    result[0]=m.group(1);
    result[1]=m.group(2);
    result[2]=m.group(3);
    result[3]=result[1];
    result[4]=VersionUtils.DEFAULT_VERSION;
    Matcher versionM=picFileVersionPattern.matcher(result[1]);
    if (versionM.matches()) {
      result[3]=versionM.group(1);
      result[4]=versionM.group(2);
    }
    return result;
  }
 else {
    return null;
  }
}
Program: 147697
Project: 147697
Buggy source:
/** 
 * DOC hbhong Comment method "handlePictureResourceObject".
 * @param treeObj
 * @throws IOException
 */
private WSResourceE handlePictureResourceObject(TreeObject treeObj) throws IOException {
  String[] fileInfo=getPicResourceFileInfo(treeObj.getName());
  if (fileInfo != null) {
    String dirName=fileInfo[0];
    String fileQName=fileInfo[1];
    String fileExtension=fileInfo[2];
    String fileName=fileInfo[3];
    String encodedDirName=URLEncoder.encode(dirName,UTF8);
    fileQName=URLEncoder.encode(fileQName,UTF8);
    WSResourceE resource=MdmserverobjectFactory.eINSTANCE.createWSResourceE();
    resource.setName(fileName);
    resource.setFileExtension(fileExtension);
    StringBuffer strBuf=new StringBuffer();
    strBuf.append(serverDef.getProtocol()).append(serverDef.getHost()).append("String_Node_Str").append(serverDef.getPort()).append("String_Node_Str").append(encodedDirName).append("String_Node_Str").append(fileQName).append("String_Node_Str").append(fileExtension);
    String url=strBuf.toString();
    byte[] bytes=Util.downloadFile(url,serverDef.getUser(),serverDef.getPasswd());
    resource.setFileContent(bytes);
    resource.setImageCatalog(dirName);
    treeObj.setName(fileName);
    return resource;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * DOC hbhong Comment method "handlePictureResourceObject".
 * @param treeObj
 * @throws IOException
 */
private WSResourceE handlePictureResourceObject(TreeObject treeObj) throws IOException {
  if (treeObj != null) {
    if (treeObj instanceof TreeParent) {
      return null;
    }
    String[] fileInfo=getPicResourceFileInfo(treeObj.getName());
    if (fileInfo != null) {
      String dirName=fileInfo[0];
      String fileQName=fileInfo[1];
      String fileExtension=fileInfo[2];
      String fileName=fileInfo[3];
      String encodedDirName=URLEncoder.encode(dirName,UTF8);
      fileQName=URLEncoder.encode(fileQName,UTF8);
      WSResourceE resource=MdmserverobjectFactory.eINSTANCE.createWSResourceE();
      resource.setName(fileName);
      resource.setFileExtension(fileExtension);
      StringBuffer strBuf=new StringBuffer();
      strBuf.append(serverDef.getProtocol()).append(serverDef.getHost()).append("String_Node_Str").append(serverDef.getPort()).append("String_Node_Str").append(encodedDirName).append("String_Node_Str").append(fileQName).append("String_Node_Str").append(fileExtension);
      String url=strBuf.toString();
      byte[] bytes=Util.downloadFile(url,serverDef.getUser(),serverDef.getPasswd());
      resource.setFileContent(bytes);
      resource.setImageCatalog(dirName);
      treeObj.setName(fileName);
      return resource;
    }
  }
  return null;
}
Program: 147698
Project: 147698
Buggy source:
private boolean showLockedObjDialog(Object[] objs){
  if (objs == null) {
    return true;
  }
  List<IRepositoryViewObject> viewObjs=new LinkedList<IRepositoryViewObject>();
  for (  Object obj : objs) {
    TreeObject treeObj=(TreeObject)obj;
    String treeObjName=treeObj.getName();
    ERepositoryObjectType type=RepositoryQueryService.getRepositoryObjectType(treeObj.getType());
    if (type != null && treeObjName != null) {
      String uniqueName=getUniqueName(treeObj,treeObjName);
      IRepositoryViewObject viewObject=RepositoryResourceUtil.findViewObjectByName(type,uniqueName);
      if (viewObject != null) {
        viewObjs.add(viewObject);
      }
    }
  }
  LockedObjectDialog lockDialog=new LockedObjectDialog(getShell(),Messages.ImportServerObjectWizard_lockedObjectMessage,viewObjs);
  if (lockDialog.needShowDialog() && lockDialog.open() == IDialogConstants.CANCEL_ID) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
private boolean showLockedObjDialog(Object[] objs){
  if (objs == null) {
    return true;
  }
  List<IRepositoryViewObject> viewObjs=new LinkedList<IRepositoryViewObject>();
  for (  Object obj : objs) {
    TreeObject treeObj=(TreeObject)obj;
    if (treeObj != null && treeObj instanceof TreeParent) {
      continue;
    }
    String treeObjName=treeObj.getName();
    ERepositoryObjectType type=RepositoryQueryService.getRepositoryObjectType(treeObj.getType());
    if (type != null && treeObjName != null) {
      String uniqueName=getUniqueName(treeObj,treeObjName);
      IRepositoryViewObject viewObject=RepositoryResourceUtil.findViewObjectByName(type,uniqueName);
      if (viewObject != null) {
        viewObjs.add(viewObject);
      }
    }
  }
  LockedObjectDialog lockDialog=new LockedObjectDialog(getShell(),Messages.ImportServerObjectWizard_lockedObjectMessage,viewObjs);
  if (lockDialog.needShowDialog() && lockDialog.open() == IDialogConstants.CANCEL_ID) {
    return false;
  }
  return true;
}
Program: 147699
Project: 147699
Buggy source:
private boolean saveResourceToRepository(){
  XObjectEditorInput2 editorInput=(XObjectEditorInput2)this.getEditorInput();
  TreeObject xobject=(TreeObject)editorInput.getModel();
  MDMServerObjectItem serverObjectItem=(MDMServerObjectItem)editorInput.getInputItem();
  MDMServerObject serverObject=serverObjectItem.getMDMServerObject();
  EObject eObj=Bean2EObjUtil.getInstance().convertFromBean2EObj(xobject.getWsObject(),serverObject);
  if (eObj != null) {
    IProxyRepositoryFactory factory=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
    try {
      factory.save(serverObjectItem);
      editorDirtyStateChanged();
      refreshDirtyCue();
      DeployService deployService=DeployService.getInstance();
      if (deployService.isAutoDeploy()) {
        autoDeployProcess(deployService);
      }
 else       if (serverObject.getLastServerDef() != null) {
        CommandManager.getInstance().pushCommand(ICommand.CMD_MODIFY,editorInput.getViewObject());
      }
      return true;
    }
 catch (    PersistenceException e) {
      log.error(e.getMessage(),e);
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean saveResourceToRepository(){
  XObjectEditorInput2 editorInput=(XObjectEditorInput2)this.getEditorInput();
  TreeObject xobject=(TreeObject)editorInput.getModel();
  MDMServerObjectItem serverObjectItem=(MDMServerObjectItem)editorInput.getInputItem();
  MDMServerObject serverObject=serverObjectItem.getMDMServerObject();
  EObject eObj=Bean2EObjUtil.getInstance().convertFromBean2EObj(xobject.getWsObject(),serverObject);
  if (eObj != null) {
    IProxyRepositoryFactory factory=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
    try {
      Item newItem=RepositoryResourceUtil.assertItem(serverObjectItem);
      if (newItem != serverObjectItem) {
        editorInput.updateViewObject(ContainerCacheService.get(newItem.getProperty()));
        serverObjectItem=(MDMServerObjectItem)newItem;
      }
      factory.save(serverObjectItem);
      editorDirtyStateChanged();
      refreshDirtyCue();
      DeployService deployService=DeployService.getInstance();
      if (deployService.isAutoDeploy()) {
        autoDeployProcess(deployService);
      }
 else       if (serverObject.getLastServerDef() != null) {
        CommandManager.getInstance().pushCommand(ICommand.CMD_MODIFY,editorInput.getViewObject());
      }
      return true;
    }
 catch (    PersistenceException e) {
      log.error(e.getMessage(),e);
    }
  }
  return false;
}
Program: 147702
Project: 147702
Buggy source:
@Test public void testRemoveViewObjectPhysically() throws PersistenceException {
  String name="String_Node_Str";
  String version=VersionUtils.DEFAULT_VERSION;
  String path="String_Node_Str";
  ERepositoryObjectType mockType=mock(ERepositoryObjectType.class);
  try {
    RepositoryResourceUtil.removeViewObjectPhysically(null,name,version,path);
    fail("String_Node_Str");
  }
 catch (  Exception e) {
    if (e instanceof IllegalArgumentException)     assertTrue(true);
 else     assertTrue("String_Node_Str",false);
  }
  try {
    RepositoryResourceUtil.removeViewObjectPhysically(mockType,null,version,path);
    fail("String_Node_Str");
  }
 catch (  Exception e) {
    if (e instanceof IllegalArgumentException)     assertTrue(true);
 else     assertTrue("String_Node_Str",false);
  }
  IProxyRepositoryFactory mockFactory=mock(IProxyRepositoryFactory.class);
  when(CoreRuntimePlugin.getInstance().getProxyRepositoryFactory()).thenReturn(mockFactory);
  List<IRepositoryViewObject> viewObjects=new ArrayList<IRepositoryViewObject>();
  for (int i=0; i < 3; i++) {
    IRepositoryViewObject mockViewObject=createMockedViewObject(name,version,path);
    viewObjects.add(mockViewObject);
  }
  when(mockFactory.getAll(mockType)).thenReturn(viewObjects);
  RepositoryResourceUtil.removeViewObjectPhysically(mockType,name,version,path);
  verify(mockFactory,Mockito.atLeastOnce()).deleteObjectPhysical(Mockito.any(IRepositoryViewObject.class),eq(version));
}

Fixed version (ground truth):
@Test public void testRemoveViewObjectPhysically() throws PersistenceException {
  String name="String_Node_Str";
  String version=VersionUtils.DEFAULT_VERSION;
  String path="String_Node_Str";
  ERepositoryObjectType mockType=mock(ERepositoryObjectType.class);
  try {
    RepositoryResourceUtil.removeViewObjectPhysically(null,name,version,path);
    fail("String_Node_Str");
  }
 catch (  Exception e) {
    if (e instanceof IllegalArgumentException) {
      assertTrue(true);
    }
 else {
      assertTrue("String_Node_Str",false);
    }
  }
  try {
    RepositoryResourceUtil.removeViewObjectPhysically(mockType,null,version,path);
    fail("String_Node_Str");
  }
 catch (  Exception e) {
    if (e instanceof IllegalArgumentException) {
      assertTrue(true);
    }
 else {
      assertTrue("String_Node_Str",false);
    }
  }
  IProxyRepositoryFactory mockFactory=mock(IProxyRepositoryFactory.class);
  when(CoreRuntimePlugin.getInstance().getProxyRepositoryFactory()).thenReturn(mockFactory);
  List<IRepositoryViewObject> viewObjects=new ArrayList<IRepositoryViewObject>();
  for (int i=0; i < 3; i++) {
    IRepositoryViewObject mockViewObject=createMockedViewObject(name,version,path);
    viewObjects.add(mockViewObject);
  }
  when(mockFactory.getAll(mockType)).thenReturn(viewObjects);
  RepositoryResourceUtil.removeViewObjectPhysically(mockType,name,version,path);
  verify(mockFactory,Mockito.atLeastOnce()).deleteObjectPhysical(Mockito.any(IRepositoryViewObject.class),eq(version));
}
Program: 147703
Project: 147703
Buggy source:
private void updateButtons(){
  try {
    WSRoutingEngineV2Status status=getServerRoutingStatus();
    startButton.setEnabled(status != WSRoutingEngineV2Status.RUNNING);
    suspendButton.setEnabled(status != WSRoutingEngineV2Status.SUSPENDED);
    stopButton.setEnabled(status != WSRoutingEngineV2Status.STOPPED);
    statusLabel.setText(status.getValue());
  }
 catch (  RemoteException e) {
    startButton.setEnabled(true);
    suspendButton.setEnabled(false);
    stopButton.setEnabled(false);
    statusLabel.setText("String_Node_Str");
    log.debug(e.getMessage(),e);
  }
}

Fixed version (ground truth):
protected void updateButtons(){
  try {
    WSRoutingEngineV2Status status=getServerRoutingStatus();
    startButton.setEnabled(status != WSRoutingEngineV2Status.RUNNING);
    suspendButton.setEnabled(status != WSRoutingEngineV2Status.SUSPENDED);
    stopButton.setEnabled(status != WSRoutingEngineV2Status.STOPPED);
    statusLabel.setText(status.getValue());
  }
 catch (  RemoteException e) {
    startButton.setEnabled(true);
    suspendButton.setEnabled(false);
    stopButton.setEnabled(false);
    statusLabel.setText("String_Node_Str");
    log.debug(e.getMessage(),e);
  }
}
Program: 147704
Project: 147704
Buggy source:
private WSRoutingEngineV2Status getServerRoutingStatus() throws RemoteException {
  XtentisPort port=getPort();
  WSRoutingEngineV2Status status=port.routingEngineV2Action(new WSRoutingEngineV2Action(WSRoutingEngineV2ActionCode.STATUS));
  return status;
}

Fixed version (ground truth):
protected WSRoutingEngineV2Status getServerRoutingStatus() throws RemoteException {
  XtentisPort port=getPort();
  WSRoutingEngineV2Status status=port.routingEngineV2Action(new WSRoutingEngineV2Action(WSRoutingEngineV2ActionCode.STATUS));
  return status;
}
Program: 147705
Project: 147705
Buggy source:
@Override protected URL getSourceURL(String path){
  if (null == path) {
    return null;
  }
  if (path.startsWith("String_Node_Str")) {
    String modelName=path.substring(5);
    IRepositoryViewObject rvobject=RepositoryResourceUtil.findViewObjectByName(IServerObjectRepositoryType.TYPE_DATAMODEL,modelName);
    if (null == rvobject) {
      return null;
    }
    String prjLabel=rvobject.getProjectLabel();
    String parentPath=buildParentPath(rvobject);
    String sep="String_Node_Str" + IPath.SEPARATOR;
    String fileName="String_Node_Str" + ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString() + sep+ prjLabel.toUpperCase()+ sep+ "String_Node_Str"+ sep+ "String_Node_Str"+ parentPath+ rvobject.getLabel()+ "String_Node_Str"+ rvobject.getVersion()+ "String_Node_Str";
    return super.getSourceURL(fileName);
  }
 else {
    return super.getSourceURL(path);
  }
}

Fixed version (ground truth):
@Override protected URL getSourceURL(String path){
  if (null == path) {
    return null;
  }
  if (path.startsWith("String_Node_Str")) {
    String modelName=path.substring(5);
    IRepositoryViewObject rvobject=RepositoryResourceUtil.findViewObjectByName(IServerObjectRepositoryType.TYPE_DATAMODEL,modelName);
    if (null == rvobject) {
      return null;
    }
    String prjLabel=rvobject.getProjectLabel();
    String parentPath=buildParentPath(rvobject);
    if (!parentPath.startsWith("String_Node_Str")) {
      parentPath="String_Node_Str" + parentPath;
    }
    String sep="String_Node_Str" + IPath.SEPARATOR;
    String fileName="String_Node_Str" + ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString() + sep+ prjLabel.toUpperCase()+ sep+ "String_Node_Str"+ sep+ "String_Node_Str"+ parentPath+ rvobject.getLabel()+ "String_Node_Str"+ rvobject.getVersion()+ "String_Node_Str";
    return super.getSourceURL(fileName);
  }
 else {
    return super.getSourceURL(path);
  }
}
Program: 147706
Project: 147706
Buggy source:
/** 
 * Create the dialog.
 * @param parentShell
 * @param conflictCount
 */
public ConsistencyConflictDialog(Shell parentShell,int conflictCount,Map<IRepositoryViewObject,WSDigest> viewObjMap){
  super(parentShell);
  this.conflictCount=conflictCount;
  this.viewObjMap=viewObjMap;
  setShellStyle(getShellStyle() | SWT.RESIZE);
}

Fixed version (ground truth):
/** 
 * Create the dialog.
 * @param parentShell
 * @param conflictCount
 */
public ConsistencyConflictDialog(Shell parentShell,int conflictCount,Map<IRepositoryViewObject,WSDigest> viewObjMap){
  super(parentShell);
  this.conflictCount=conflictCount;
  this.viewObjMap=viewObjMap;
  setShellStyle(SWT.TITLE | SWT.RESIZE);
}
Program: 147707
Project: 147707
Buggy source:
/** 
 * Getter for result.
 * @return the result
 */
public ConsistencyCheckResult getResult(){
  return this.result;
}

Fixed version (ground truth):
/** 
 * Getter for result.
 * @return the result
 */
public ConsistencyCheckResult getResult(){
  if (result == null) {
    result=new ConsistencyService.ConsistencyCheckResult();
  }
  return this.result;
}
Program: 147708
Project: 147708
Buggy source:
@Override public String getText(Object element){
  if (element instanceof IRepositoryViewObject && curServerDef != null && !(element instanceof FolderRepositoryObject)) {
    ConsistencyData consistencyData=getConsistencyData(curServerDef,(IRepositoryViewObject)element);
    if (consistencyData != null) {
      CompareResultEnum compareResult=consistencyData.getCompareResult();
switch (compareResult) {
case NOT_EXIST_IN_SERVER:
        return Messages.ConsistencyConflictt_NotDeployed;
case SAME:
case CONFLICT:
case MODIFIED_LOCALLY:
      return Messages.ConsistencyConflictt_Deployed;
case NOT_SUPPORT:
    return Messages.ConsistencyConflict_undefined;
}
}
}
return "String_Node_Str";
}

Fixed version (ground truth):
@Override public String getText(Object element){
  if (element instanceof IRepositoryViewObject && curServerDef != null && !(element instanceof FolderRepositoryObject)) {
    ConsistencyData consistencyData=getConsistencyData(curServerDef,(IRepositoryViewObject)element);
    if (consistencyData != null) {
      CompareResultEnum compareResult=consistencyData.getCompareResult();
      if (compareResult != null) {
switch (compareResult) {
case NOT_EXIST_IN_SERVER:
          return Messages.ConsistencyConflictt_NotDeployed;
case SAME:
case CONFLICT:
case MODIFIED_LOCALLY:
        return Messages.ConsistencyConflictt_Deployed;
case NOT_SUPPORT:
      return Messages.ConsistencyConflict_undefined;
  }
}
}
}
return "String_Node_Str";
}