nus-yam/ex-repair huggingface dataset:
Program: 147803
Project: 147803
Buggy source:
public static List<Object> getTopParent(Object son){
  if (!((son instanceof XSDElementDeclaration) || (son instanceof XSDParticle))) {
    return null;
  }
  XSDElementDeclaration elem=null;
  elem=(XSDElementDeclaration)son;
  EList<XSDSchemaContent> parentList=elem.getSchema().getContents();
  ArrayList<Object> list=new ArrayList<Object>();
  for (  XSDSchemaContent top : parentList) {
    list.clear();
    if (!(top instanceof XSDElementDeclaration)) {
      continue;
    }
    if (top instanceof XSDElementDeclaration) {
      XSDElementDeclaration decl=(XSDElementDeclaration)top;
      if (decl.getTypeDefinition() instanceof XSDComplexTypeDefinition) {
        String primaryKey=getTopElement(decl,elem,(XSDComplexTypeDefinition)decl.getTypeDefinition());
        if (!"String_Node_Str".equalsIgnoreCase(primaryKey)) {
          EList<XSDIdentityConstraintDefinition> idtylist=decl.getIdentityConstraintDefinitions();
          for (          XSDIdentityConstraintDefinition idty : idtylist) {
            EList<XSDXPathDefinition> fields=idty.getFields();
            for (            XSDXPathDefinition path : fields) {
              if ((path.getValue()).equals(primaryKey)) {
                list.add(idty);
                list.add(path);
                return list;
              }
            }
          }
        }
      }
    }
  }
  return null;
}

Fixed version (ground truth):
public static List<Object> getTopParent(Object son){
  if (!((son instanceof XSDElementDeclaration) || (son instanceof XSDParticle))) {
    return null;
  }
  XSDElementDeclaration elem=null;
  elem=(XSDElementDeclaration)son;
  if (elem.getSchema() == null)   return null;
  EList<XSDSchemaContent> parentList=elem.getSchema().getContents();
  ArrayList<Object> list=new ArrayList<Object>();
  for (  XSDSchemaContent top : parentList) {
    list.clear();
    if (!(top instanceof XSDElementDeclaration)) {
      continue;
    }
    if (top instanceof XSDElementDeclaration) {
      XSDElementDeclaration decl=(XSDElementDeclaration)top;
      if (decl.getTypeDefinition() instanceof XSDComplexTypeDefinition) {
        String primaryKey=getTopElement(decl,elem,(XSDComplexTypeDefinition)decl.getTypeDefinition());
        if (!"String_Node_Str".equalsIgnoreCase(primaryKey)) {
          EList<XSDIdentityConstraintDefinition> idtylist=decl.getIdentityConstraintDefinitions();
          for (          XSDIdentityConstraintDefinition idty : idtylist) {
            EList<XSDXPathDefinition> fields=idty.getFields();
            for (            XSDXPathDefinition path : fields) {
              if ((path.getValue()).equals(primaryKey)) {
                list.add(idty);
                list.add(path);
                return list;
              }
            }
          }
        }
      }
    }
  }
  return null;
}
Program: 147806
Project: 147806
Buggy source:
public static boolean createServerDef(MDMServerDef serverDef){
  IProxyRepositoryFactory factory=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
  RepositoryContext context=factory.getRepositoryContext();
  MDMServerDefItem item=MdmpropertiesFactory.eINSTANCE.createMDMServerDefItem();
  item.setServerDef(serverDef);
  Property prop=PropertiesFactory.eINSTANCE.createProperty();
  item.setProperty(prop);
  try {
    String nextId=factory.getNextId();
    Property property=item.getProperty();
    property.setId(nextId);
    property.setVersion(VersionUtils.DEFAULT_VERSION);
    property.setAuthor(context.getUser());
    property.setLabel(item.getServerDef().getName());
    factory.create(item,new Path("String_Node_Str"));
    return true;
  }
 catch (  PersistenceException e) {
    log.error(e.getMessage(),e);
  }
  return false;
}

Fixed version (ground truth):
public static String createServerDef(MDMServerDef serverDef){
  IProxyRepositoryFactory factory=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
  RepositoryContext context=factory.getRepositoryContext();
  MDMServerDefItem item=MdmpropertiesFactory.eINSTANCE.createMDMServerDefItem();
  item.setServerDef(serverDef);
  Property prop=PropertiesFactory.eINSTANCE.createProperty();
  item.setProperty(prop);
  try {
    String nextId=factory.getNextId();
    Property property=item.getProperty();
    property.setId(nextId);
    property.setVersion(VersionUtils.DEFAULT_VERSION);
    property.setAuthor(context.getUser());
    property.setLabel(item.getServerDef().getName());
    factory.create(item,new Path("String_Node_Str"));
    return nextId;
  }
 catch (  PersistenceException e) {
    log.error(e.getMessage(),e);
  }
  return null;
}
Program: 147807
Project: 147807
Buggy source:
/** 
 * Warning: the return result is a encrypted List
 * @return
 */
public static List<IRepositoryViewObject> getAllServerDefViewObjects(){
  IProxyRepositoryFactory factory=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
  try {
    return factory.getAll(REPOSITORY_TYPE_SERVER_DEF);
  }
 catch (  PersistenceException e) {
    log.error(e.getMessage(),e);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Warning: the return result is a encrypted List
 * @return
 */
public static List<IRepositoryViewObject> getAllServerDefViewObjects(){
  IProxyRepositoryFactory factory=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
  try {
    List<IRepositoryViewObject> viewObjects=factory.getAll(REPOSITORY_TYPE_SERVER_DEF);
    if (viewObjects != null) {
      for (      IRepositoryViewObject viewObj : viewObjects) {
        if (tmpPasswordCache.containsKey(viewObj.getId())) {
          String tmpPasswd=tmpPasswordCache.get(viewObj.getId());
          Item item=viewObj.getProperty().getItem();
          MDMServerDef serverDef=((MDMServerDefItem)item).getServerDef();
          if (serverDef != null) {
            serverDef.setTempPasswd(tmpPasswd);
          }
        }
      }
      return viewObjects;
    }
    return null;
  }
 catch (  PersistenceException e) {
    log.error(e.getMessage(),e);
  }
  return null;
}
Program: 147808
Project: 147808
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  passwordText.setText("String_Node_Str");
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
}
Program: 147809
Project: 147809
Buggy source:
public ServerDefDialog(Shell parentShell,MDMServerDef serverDef,boolean needDecrypted){
  this(parentShell,serverDef);
  this.needDecrypted=needDecrypted;
}

Fixed version (ground truth):
/** 
 * Create the dialog.
 * @param parentShell
 */
public ServerDefDialog(Shell parentShell,MDMServerDef serverDef){
  super(parentShell);
  this.serverDef=serverDef;
  isUpdateServerDef=serverDef != null;
  if (isUpdateServerDef) {
    newName=serverDef.getName();
  }
 else {
    this.serverDef=MdmmetadataFactory.eINSTANCE.createMDMServerDef();
  }
  isEnterprise=Util.IsEnterPrise();
}
Program: 147811
Project: 147811
Buggy source:
public void modifyText(ModifyEvent e){
  serverDef.setUniverse(universeCombo.getText().trim());
}

Fixed version (ground truth):
public void modifyText(ModifyEvent e){
  newUniverse=universeCombo.getText().trim();
}
Program: 147812
Project: 147812
Buggy source:
private boolean validateInput(){
  if (newName.length() == 0) {
    setErrorMessage(Messages.ServerDefDialog_NameCanNotBeEmpty);
    nameText.setFocus();
    return false;
  }
  if (ServerDefService.isExistServerDefName(newName)) {
    if ((!isUpdateServerDef) || (isUpdateServerDef() && (!serverDef.getName().equalsIgnoreCase(newName)))) {
      setErrorMessage(Messages.ServerDefDialog_SameName);
      nameText.setFocus();
      return false;
    }
  }
  if (urlText.getText().trim().length() == 0) {
    setErrorMessage(Messages.ServerDefDialog_ServerCanNotBeEmpty);
    urlText.setFocus();
    return false;
  }
  if (!serverDef.validate(serverDef.getUrl())) {
    setErrorMessage(Messages.ServerDefDialog_ServerInvalid);
    urlText.setFocus();
    return false;
  }
  if (serverDef.getUser().length() == 0) {
    setErrorMessage(Messages.ServerDefDialog_UsernameCanNotBeEmpty);
    userNameText.setFocus();
    return false;
  }
  if (serverDef.getPasswd().length() == 0 && (serverDef.getTempPasswd() != null && serverDef.getTempPasswd().length() == 0)) {
    setErrorMessage(Messages.ServerDefDialog_PasswordCanNotBeEmpty);
    passwordText.setFocus();
    return false;
  }
  setErrorMessage(null);
  return true;
}

Fixed version (ground truth):
private boolean validateInput(){
  if (newName.length() == 0) {
    setErrorMessage(Messages.ServerDefDialog_NameCanNotBeEmpty);
    nameText.setFocus();
    return false;
  }
  if (ServerDefService.isExistServerDefName(newName)) {
    if ((!isUpdateServerDef) || (isUpdateServerDef() && (!serverDef.getName().equalsIgnoreCase(newName)))) {
      setErrorMessage(Messages.ServerDefDialog_SameName);
      nameText.setFocus();
      return false;
    }
  }
  if (newUrl == null || newUrl.length() == 0) {
    setErrorMessage(Messages.ServerDefDialog_ServerCanNotBeEmpty);
    urlText.setFocus();
    return false;
  }
  if (!serverDef.validate(newUrl)) {
    setErrorMessage(Messages.ServerDefDialog_ServerInvalid);
    urlText.setFocus();
    return false;
  }
  if (newUserName == null || newUserName.length() == 0) {
    setErrorMessage(Messages.ServerDefDialog_UsernameCanNotBeEmpty);
    userNameText.setFocus();
    return false;
  }
  if (newPassword == null || newPassword.length() == 0) {
    setErrorMessage(Messages.ServerDefDialog_PasswordCanNotBeEmpty);
    passwordText.setFocus();
    return false;
  }
  setErrorMessage(null);
  return true;
}
Program: 147813
Project: 147813
Buggy source:
private void initValue(){
  nameText.setText(serverDef.getName());
  urlText.setText(serverDef.getUrl());
  userNameText.setText(serverDef.getUser());
  if (isLocalMode() && !(serverDef.getName().equals("String_Node_Str"))) {
    String decryptedPassword=PasswordUtil.decryptPassword(serverDef.getPasswd());
    passwordText.setText(decryptedPassword);
  }
 else {
    passwordText.setText(serverDef.getPasswd());
  }
  if (!isLocalMode() && (!serverDef.getPasswd().equals("String_Node_Str"))) {
    String decryptedPassword=PasswordUtil.decryptPassword(serverDef.getPasswd());
    passwordText.setText(decryptedPassword);
  }
  if (serverDef.getPasswd().equals("String_Node_Str") && serverDef.getTempPasswd() != null) {
    passwordText.setText(serverDef.getTempPasswd());
  }
  sharePwdBtn.setSelection(!serverDef.getPasswd().equals("String_Node_Str"));
  if (serverDef.getName().equals("String_Node_Str")) {
    sharePwdBtn.setSelection(true);
  }
  if (Util.IsEnterPrise()) {
    universeCombo.setText(serverDef.getUniverse());
  }
}

Fixed version (ground truth):
private void initValue(){
  newName=serverDef.getName();
  nameText.setText(newName);
  newUrl=serverDef.getUrl();
  urlText.setText(newUrl);
  newUserName=serverDef.getUser();
  userNameText.setText(newUserName);
  String passwd=serverDef.getPasswd();
  if (passwd != null && passwd.length() > 0) {
    passwordText.setText(PasswordUtil.decryptPassword(passwd));
    sharePwdBtn.setSelection(true);
  }
 else {
    if (isLocalMode()) {
      passwordText.setText("String_Node_Str");
      sharePwdBtn.setSelection(true);
    }
 else {
      passwd=serverDef.getTempPasswd();
      if (passwd != null && passwd.length() > 0) {
        passwordText.setText(passwd);
      }
 else {
        passwordText.setText("String_Node_Str");
      }
      sharePwdBtn.setSelection(false);
    }
  }
  newPassword=passwordText.getText().trim();
  if (Util.IsEnterPrise()) {
    newUniverse=serverDef.getUniverse();
    universeCombo.setText(newUniverse);
  }
  if (!isUpdateServerDef) {
    sharePwdBtn.setSelection(true);
  }
}
Program: 147814
Project: 147814
Buggy source:
private void initListener(){
  nameText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      newName=nameText.getText().trim();
    }
  }
);
  urlText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      serverDef.setUrl(urlText.getText().trim());
    }
  }
);
  userNameText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      serverDef.setUser(userNameText.getText().trim());
    }
  }
);
  passwordText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      serverDef.setPasswd(passwordText.getText().trim());
      needDecrypted=false;
    }
  }
);
  if (isEnterprise) {
    universeCombo.addModifyListener(new ModifyListener(){
      public void modifyText(      ModifyEvent e){
        serverDef.setUniverse(universeCombo.getText().trim());
      }
    }
);
    FocusListener listener=new FocusAdapter(){
      @Override public void focusLost(      FocusEvent e){
        updateUniverseValues();
      }
    }
;
    urlText.addFocusListener(listener);
    userNameText.addFocusListener(listener);
    passwordText.addFocusListener(listener);
  }
}

Fixed version (ground truth):
private void initListener(){
  nameText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      newName=nameText.getText().trim();
    }
  }
);
  urlText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      newUrl=urlText.getText().trim();
    }
  }
);
  userNameText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      newUserName=userNameText.getText().trim();
    }
  }
);
  passwordText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      newPassword=passwordText.getText().trim();
    }
  }
);
  if (isEnterprise) {
    universeCombo.addModifyListener(new ModifyListener(){
      public void modifyText(      ModifyEvent e){
        newUniverse=universeCombo.getText().trim();
      }
    }
);
    FocusListener listener=new FocusAdapter(){
      @Override public void focusLost(      FocusEvent e){
        updateUniverseValues();
      }
    }
;
    urlText.addFocusListener(listener);
    userNameText.addFocusListener(listener);
    passwordText.addFocusListener(listener);
  }
}
Program: 147815
Project: 147815
Buggy source:
@Override protected void buttonPressed(int buttonId){
  if (buttonId == IDialogConstants.OK_ID) {
    if (!validateInput())     return;
    serverDef.parse(urlText.getText());
    serverDef.setName(nameText.getText());
    String encryptedPassword=PasswordUtil.encryptPassword(passwordText.getText());
    serverDef.setPasswd(encryptedPassword);
    if (!isLocalMode() && (!sharePwdBtn.getSelection())) {
      serverDef.setPasswd("String_Node_Str");
      serverDef.setTempPasswd(passwordText.getText());
    }
  }
  if (buttonId == CHECK_CONNECTION_ID) {
    if (!validateInput())     return;
    boolean check=false;
    String msg=null;
    if (needDecrypted) {
      MDMServerDef serverDefinition=serverDef.getDecryptedServerDef();
      check=ServerDefService.checkMDMConnection(serverDefinition);
      msg=check ? Messages.ServerExplorer_ConnectSuccessful : Messages.ServerExplorer_ConnectFailed;
    }
 else {
      check=ServerDefService.checkMDMConnection(serverDef);
      msg=check ? Messages.ServerExplorer_ConnectSuccessful : Messages.ServerExplorer_ConnectFailed;
    }
    if (check) {
      setMessage(msg);
    }
 else {
      setErrorMessage(msg);
    }
  }
  super.buttonPressed(buttonId);
}

Fixed version (ground truth):
@Override protected void buttonPressed(int buttonId){
  if (buttonId == IDialogConstants.OK_ID) {
    if (!validateInput())     return;
    updateUI2Model(serverDef);
  }
  if (buttonId == CHECK_CONNECTION_ID) {
    if (!validateInput())     return;
    boolean check=false;
    String msg=null;
    MDMServerDef tmpServerDef=MdmmetadataFactory.eINSTANCE.createMDMServerDef();
    updateUI2Model(tmpServerDef);
    check=ServerDefService.checkMDMConnection(tmpServerDef.getDecryptedServerDef());
    msg=check ? Messages.ServerExplorer_ConnectSuccessful : Messages.ServerExplorer_ConnectFailed;
    if (check) {
      setMessage(msg);
    }
 else {
      setErrorMessage(msg);
    }
  }
  super.buttonPressed(buttonId);
}
Program: 147816
Project: 147816
Buggy source:
private void multiCopy(){
  StringBuilder result=new StringBuilder();
  List<Object> selectedObject=getSelectedObject();
  for (  Object obj : selectedObject) {
    IRepositoryViewObject viewObject=(IRepositoryViewObject)obj;
    Item item=viewObject.getProperty().getItem();
    String fileExtension=((WSResourceItem)item).getResource().getFileExtension();
    String fileName=viewObject.getLabel();
    String version=viewObject.getVersion();
    String repositoryName=fileName + "String_Node_Str" + version+ "String_Node_Str"+ fileExtension;
    MDMServerDef serverDef=RepositoryResourceUtil.getLastServerDef(viewObject);
    if (serverDef == null)     continue;
    String uripre="String_Node_Str" + serverDef.getHost() + "String_Node_Str"+ serverDef.getPort();
    result.append(uripre);
    result.append("String_Node_Str" + repositoryName);
    result.append("String_Node_Str");
  }
  Clipboard clipboard=Toolkit.getDefaultToolkit().getSystemClipboard();
  StringSelection text=new StringSelection(result.toString());
  clipboard.setContents(text,null);
}

Fixed version (ground truth):
private void multiCopy(){
  StringBuilder result=new StringBuilder();
  List<Object> selectedObject=getSelectedObject();
  for (  Object obj : selectedObject) {
    IRepositoryViewObject viewObject=(IRepositoryViewObject)obj;
    Item item=viewObject.getProperty().getItem();
    WSResourceE wsItem=null;
    if (!(item instanceof WSResourceItem)) {
      continue;
    }
    wsItem=((WSResourceItem)item).getResource();
    String catalog=wsItem.getImageCatalog();
    if (catalog == null)     continue;
    String fileName=viewObject.getLabel() + '.' + wsItem.getFileExtension();
    MDMServerDef serverDef=RepositoryResourceUtil.getLastServerDef(viewObject);
    if (serverDef == null)     continue;
    String uripre="String_Node_Str" + serverDef.getHost() + ':'+ serverDef.getPort();
    result.append(uripre);
    result.append("String_Node_Str" + catalog + '/'+ fileName);
    result.append('\n');
  }
  Clipboard clipboard=Toolkit.getDefaultToolkit().getSystemClipboard();
  StringSelection text=new StringSelection(result.toString());
  clipboard.setContents(text,null);
}
Program: 147817
Project: 147817
Buggy source:
/** 
 * DOC hbhong Comment method "getUniqueName".
 * @param treeObj
 * @return
 */
private String getUniqueName(TreeObject treeObj,String name){
  int type=treeObj.getType();
  if (type == TreeObject.PICTURES_RESOURCE) {
    if (name == null) {
      name=treeObj.getName();
    }
    String[] fileInfo=getPicResourceFileInfo(name);
    if (fileInfo != null) {
      return fileInfo[3] + "String_Node_Str" + fileInfo[2];
    }
  }
  if (type == TreeObject.WORKFLOW_PROCESS) {
    WSWorkflowProcessDefinitionUUID wsKey=(WSWorkflowProcessDefinitionUUID)treeObj.getWsKey();
    return wsKey.getProcessName();
  }
  return treeObj.getName();
}

Fixed version (ground truth):
/** 
 * DOC hbhong Comment method "getUniqueName".
 * @param treeObj
 * @return
 */
private String getUniqueName(TreeObject treeObj,String name){
  int type=treeObj.getType();
  if (type == TreeObject.PICTURES_RESOURCE) {
    if (name == null) {
      name=treeObj.getName();
    }
    String[] fileInfo=getPicResourceFileInfo(name);
    if (fileInfo != null) {
      return fileInfo[3];
    }
  }
  if (type == TreeObject.WORKFLOW_PROCESS) {
    WSWorkflowProcessDefinitionUUID wsKey=(WSWorkflowProcessDefinitionUUID)treeObj.getWsKey();
    return wsKey.getProcessName();
  }
  return treeObj.getName();
}
Program: 147818
Project: 147818
Buggy source:
protected void okPressed(){
  typeName=conceptPanel.getText();
  superTypeName=conceptPanel.getSuperName();
  isAbstract=conceptPanel.isAbstract();
  setReturnCode(OK);
}

Fixed version (ground truth):
protected void okPressed(){
  typeName=conceptPanel.getText();
  superTypeName=conceptPanel.getSuperName();
  isAbstract=conceptPanel.isAbstract();
  if (superTypeName.equals(typeName)) {
    MessageDialog.openError(null,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    setReturnCode(CANCEL);
    return;
  }
  setReturnCode(OK);
}
Program: 147819
Project: 147819
Buggy source:
protected void okPressed(){
  typeName=conceptPanel.getText();
  superTypeName=conceptPanel.getSuperName();
  isAbstract=conceptPanel.isAbstract();
  setReturnCode(OK);
}

Fixed version (ground truth):
protected void okPressed(){
  typeName=conceptPanel.getText();
  superTypeName=conceptPanel.getSuperName();
  isAbstract=conceptPanel.isAbstract();
  if (superTypeName.equals(typeName)) {
    MessageDialog.openError(null,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    setReturnCode(CANCEL);
    return;
  }
  setReturnCode(OK);
}
Program: 147820
Project: 147820
Buggy source:
private static List<XSDTypeDefinition> getParentTypes(XSDTypeDefinition type,List<XSDTypeDefinition> results){
  XSDTypeDefinition baseType=type.getBaseType();
  if (!results.contains(baseType))   results.add(baseType);
  if (baseType == null || baseType.equals(type.getSchema().resolveTypeDefinition(type.getSchema().getSchemaForSchemaNamespace(),"String_Node_Str")))   return results;
  return getParentTypes(baseType,results);
}

Fixed version (ground truth):
private static List<XSDTypeDefinition> getParentTypes(XSDTypeDefinition type,List<XSDTypeDefinition> results){
  XSDTypeDefinition baseType=type.getBaseType();
  if (baseType == type.getBaseType()) {
    return results;
  }
  if (!results.contains(baseType))   results.add(baseType);
  if (baseType == null || baseType.equals(type.getSchema().resolveTypeDefinition(type.getSchema().getSchemaForSchemaNamespace(),"String_Node_Str")))   return results;
  return getParentTypes(baseType,results);
}
Program: 147821
Project: 147821
Buggy source:
/** 
 * DOC hcw Comment method "removeSelectedText".
 */
private void removeSelectedText(){
  if (control instanceof Text) {
    Text text=((Text)control);
    if (text.getSelectionCount() > 0) {
      Point selection=text.getSelection();
      String content=text.getText().substring(0,selection.x) + text.getText().substring(selection.y);
      insertionPos=text.getSelection().x;
    }
  }
 else   if (control instanceof StyledText) {
    StyledText text=((StyledText)control);
    if (text.getSelectionCount() > 0) {
      Point selection=text.getSelection();
      String content=text.getText().substring(0,selection.x) + text.getText().substring(selection.y);
      insertionPos=text.getSelection().x;
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC hcw Comment method "removeSelectedText".
 */
private void removeSelectedText(){
  if (control instanceof Text) {
    Text text=((Text)control);
    if (text.getSelectionCount() > 0) {
      Point selection=text.getSelection();
      String content=text.getText().substring(0,selection.x) + text.getText().substring(selection.y);
    }
  }
 else   if (control instanceof StyledText) {
    StyledText text=((StyledText)control);
    if (text.getSelectionCount() > 0) {
      Point selection=text.getSelection();
      String content=text.getText().substring(0,selection.x) + text.getText().substring(selection.y);
    }
  }
}
Program: 147822
Project: 147822
Buggy source:
private void proposalAccepted(IContentProposal proposal){
  final Object[] listenerArray=proposalListeners.getListeners();
  for (int i=0; i < listenerArray.length; i++) {
    if (listenerArray[i] instanceof IContentProposalExtendedListener) {
      ((IContentProposalExtendedListener)listenerArray[i]).proposalBeforeModifyControl(proposal);
    }
  }
  if (controlContentAdapter instanceof IControlContentAdapterExtended) {
    ((IControlContentAdapterExtended)controlContentAdapter).setUsedFilterValue(filterText);
  }
  removeSelectedText();
switch (proposalAcceptanceStyle) {
case (PROPOSAL_REPLACE):
    setControlContent(proposal.getContent(),proposal.getCursorPosition());
  break;
case (PROPOSAL_INSERT):
insertControlContent(proposal.getContent(),proposal.getCursorPosition());
break;
default :
break;
}
for (int i=0; i < listenerArray.length; i++) {
((IContentProposalListener)listenerArray[i]).proposalAccepted(proposal);
}
}

Fixed version (ground truth):
private void proposalAccepted(IContentProposal proposal){
  final Object[] listenerArray=proposalListeners.getListeners();
  for (int i=0; i < listenerArray.length; i++) {
    if (listenerArray[i] instanceof IContentProposalExtendedListener) {
      ((IContentProposalExtendedListener)listenerArray[i]).proposalBeforeModifyControl(proposal);
    }
  }
  if (controlContentAdapter instanceof IControlContentAdapterExtended) {
    ((IControlContentAdapterExtended)controlContentAdapter).setUsedFilterValue(filterText);
  }
switch (proposalAcceptanceStyle) {
case (PROPOSAL_REPLACE):
    setControlContent(proposal.getContent(),proposal.getCursorPosition());
  break;
case (PROPOSAL_INSERT):
insertControlContent(proposal.getContent(),proposal.getCursorPosition());
break;
default :
break;
}
for (int i=0; i < listenerArray.length; i++) {
((IContentProposalListener)listenerArray[i]).proposalAccepted(proposal);
}
}
Program: 147824
Project: 147824
Buggy source:
public AddBrowseItemsWizard(DataModelMainPage launchPage){
  super();
  setWindowTitle("String_Node_Str");
  page=launchPage;
}

Fixed version (ground truth):
public AddBrowseItemsWizard(DataModelMainPage launchPage){
  super();
  setWindowTitle(Messages.getString("String_Node_Str"));
  page=launchPage;
}
Program: 147825
Project: 147825
Buggy source:
private boolean saveConfiguration(){
  Iterator<String> browseIterator=browseItemToRoles.keySet().iterator();
  while (browseIterator.hasNext()) {
    String browse=browseIterator.next();
    List<Line> roles=browseItemToRoles.get(browse);
    try {
      newBrowseItemView(browse);
      modifyRolesWithAttachedBrowseItem(browse,roles);
    }
 catch (    RemoteException e) {
      MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean saveConfiguration(){
  Iterator<String> browseIterator=browseItemToRoles.keySet().iterator();
  while (browseIterator.hasNext()) {
    String browse=browseIterator.next();
    List<Line> roles=browseItemToRoles.get(browse);
    try {
      newBrowseItemView(browse);
      modifyRolesWithAttachedBrowseItem(browse,roles);
    }
 catch (    RemoteException e) {
      MessageDialog.openError(page.getSite().getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str") + e.getLocalizedMessage());
      return false;
    }
  }
  return true;
}
Program: 147826
Project: 147826
Buggy source:
public void modify(Object element,String property,Object value){
  TableItem item=(TableItem)element;
  String tValue=value.toString().trim();
  if (Pattern.compile("String_Node_Str").matcher(value.toString()).matches() || tValue.replaceAll("String_Node_Str","String_Node_Str").length() != tValue.length()) {
    MessageDialog.openInformation(null,"String_Node_Str","String_Node_Str");
    return;
  }
  XSDElementDeclaration elem=(XSDElementDeclaration)item.getData();
  if (!(BROWSE_ITEMS + elem.getName()).equals(tValue)) {
    for (    XSDElementDeclaration theElem : declList) {
      if (theElem == elem)       continue;
      if ((BROWSE_ITEMS + theElem.getName()).equals(tValue)) {
        MessageDialog.openInformation(null,"String_Node_Str","String_Node_Str");
        return;
      }
    }
    List<Line> lines=browseItemToRoles.get(BROWSE_ITEMS + elem.getName());
    browseItemToRoles.remove(BROWSE_ITEMS + elem.getName());
    int prex=tValue.indexOf(BROWSE_ITEMS);
    if (prex != -1 && (prex + BROWSE_ITEMS.length()) <= tValue.length()) {
      elem.setName(tValue.substring(prex + BROWSE_ITEMS.length()));
    }
    browseItemToRoles.put(tValue,lines);
    refreshRoleView(BROWSE_ITEMS + elem.getName());
    browseViewer.update(elem,null);
  }
}

Fixed version (ground truth):
public void modify(Object element,String property,Object value){
  TableItem item=(TableItem)element;
  String tValue=value.toString().trim();
  if (Pattern.compile("String_Node_Str").matcher(value.toString()).matches() || tValue.replaceAll("String_Node_Str","String_Node_Str").length() != tValue.length()) {
    MessageDialog.openInformation(null,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    return;
  }
  if (!value.toString().startsWith(BROWSE_ITEMS)) {
    MessageDialog.openInformation(null,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str") + BROWSE_ITEMS);
    return;
  }
  XSDElementDeclaration elem=(XSDElementDeclaration)item.getData();
  if (!(BROWSE_ITEMS + elem.getName()).equals(tValue)) {
    for (    XSDElementDeclaration theElem : declList) {
      if (theElem == elem)       continue;
      if ((BROWSE_ITEMS + theElem.getName()).equals(tValue)) {
        MessageDialog.openInformation(null,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
        return;
      }
    }
    List<Line> lines=browseItemToRoles.get(BROWSE_ITEMS + elem.getName());
    browseItemToRoles.remove(BROWSE_ITEMS + elem.getName());
    int prex=tValue.indexOf(BROWSE_ITEMS);
    if (prex != -1 && (prex + BROWSE_ITEMS.length()) <= tValue.length()) {
      elem.setName(tValue.substring(prex + BROWSE_ITEMS.length()));
    }
    browseItemToRoles.put(tValue,lines);
    refreshRoleView(BROWSE_ITEMS + elem.getName());
    browseViewer.update(elem,null);
  }
}
Program: 147827
Project: 147827
Buggy source:
public ConfigureRolePage(){
  super("String_Node_Str");
  setTitle("String_Node_Str");
  setDescription("String_Node_Str");
  setPageComplete(true);
}

Fixed version (ground truth):
public ConfigureRolePage(){
  super(Messages.getString("String_Node_Str"));
  setTitle(Messages.getString("String_Node_Str"));
  setDescription(Messages.getString("String_Node_Str"));
  setPageComplete(true);
}
Program: 147828
Project: 147828
Buggy source:
public void resourceChanged(IResourceChangeEvent event){
  if (!ProxyRepositoryFactory.getInstance().isFullLogonFinished())   return;
  IResourceDelta delta=event.getDelta();
  try {
    delta.accept(visitor);
  }
 catch (  CoreException e) {
    log.error(e.getMessage(),e);
  }
}

Fixed version (ground truth):
public void resourceChanged(IResourceChangeEvent event){
  if (!ProxyRepositoryFactory.getInstance().isFullLogonFinished())   return;
  IResourceDelta delta=event.getDelta();
  try {
    if (delta != null) {
      delta.accept(visitor);
    }
  }
 catch (  CoreException e) {
    log.error(e.getMessage(),e);
  }
}
Program: 147829
Project: 147829
Buggy source:
public void run(){
  if (viewObj != null) {
    try {
      IViewPart viewPart=RepositoryPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(getContentService().getViewerId());
      if (viewPart != null && viewPart instanceof CommonNavigator) {
        ((CommonNavigator)viewPart).getCommonViewer().refresh(viewObj);
      }
    }
 catch (    Exception e) {
      log.error(e.getMessage(),e);
    }
  }
}

Fixed version (ground truth):
public void run(){
  if (viewObj != null) {
    try {
      IViewPart viewPart=RepositoryPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(getContentService().getViewerId());
      if (viewPart != null && viewPart instanceof CommonNavigator) {
        ((CommonNavigator)viewPart).getCommonViewer().refresh(viewObj);
      }
      Item item=viewObj.getProperty().getItem();
      if (item instanceof ContainerItem) {
        ERepositoryObjectType repObjType=((ContainerItem)item).getRepObjType();
        if (repObjType == IServerObjectRepositoryType.TYPE_TRANSFORMERV2) {
          ContainerCacheService.refreshRepositoryRoot(IServerObjectRepositoryType.TYPE_EVENTMANAGER,((CommonNavigator)viewPart).getCommonViewer());
        }
      }
    }
 catch (    Exception e) {
      log.error(e.getMessage(),e);
    }
  }
}
Program: 147830
Project: 147830
Buggy source:
private void refreshContainer(final IRepositoryViewObject viewObj){
  Display.getDefault().asyncExec(new Runnable(){
    public void run(){
      if (viewObj != null) {
        try {
          IViewPart viewPart=RepositoryPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(getContentService().getViewerId());
          if (viewPart != null && viewPart instanceof CommonNavigator) {
            ((CommonNavigator)viewPart).getCommonViewer().refresh(viewObj);
          }
        }
 catch (        Exception e) {
          log.error(e.getMessage(),e);
        }
      }
    }
  }
);
}

Fixed version (ground truth):
private void refreshContainer(final IRepositoryViewObject viewObj){
  Display.getDefault().asyncExec(new Runnable(){
    public void run(){
      if (viewObj != null) {
        try {
          IViewPart viewPart=RepositoryPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(getContentService().getViewerId());
          if (viewPart != null && viewPart instanceof CommonNavigator) {
            ((CommonNavigator)viewPart).getCommonViewer().refresh(viewObj);
          }
          Item item=viewObj.getProperty().getItem();
          if (item instanceof ContainerItem) {
            ERepositoryObjectType repObjType=((ContainerItem)item).getRepObjType();
            if (repObjType == IServerObjectRepositoryType.TYPE_TRANSFORMERV2) {
              ContainerCacheService.refreshRepositoryRoot(IServerObjectRepositoryType.TYPE_EVENTMANAGER,((CommonNavigator)viewPart).getCommonViewer());
            }
          }
        }
 catch (        Exception e) {
          log.error(e.getMessage(),e);
        }
      }
    }
  }
);
}
Program: 147831
Project: 147831
Buggy source:
public XpathSelectDialog(Shell parentShell,TreeParent parent,String title,IWorkbenchPartSite site,boolean isMulti,String dataModelName,boolean isAbsolutePath){
  super(parentShell);
  this.title=title;
  this.parent=parent;
  this.site=site;
  this.isMulti=isMulti;
  this.isAbsolutePath=isAbsolutePath;
  if (dataModelName != null)   this.dataModelName=dataModelName;
  if (this.site == null && this.parent != null)   this.site=ServerView.show().getSite();
 else {
    this.site=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getSite();
  }
}

Fixed version (ground truth):
public XpathSelectDialog(Shell parentShell,TreeParent parent,String title,IWorkbenchPartSite site,boolean isMulti,String dataModelName,boolean isAbsolutePath){
  super(parentShell);
  this.title=title;
  this.parent=parent;
  this.site=site;
  this.isMulti=isMulti;
  this.isAbsolutePath=isAbsolutePath;
  if (dataModelName != null)   this.dataModelName=dataModelName;
  if (this.site == null && this.parent != null)   this.site=ServerView.show().getSite();
 else {
    this.site=MDMRepositoryViewExtensionService.getMDMRepositoryViewSite();
  }
}
Program: 147832
Project: 147832
Buggy source:
protected ValidationRuleExcpressDialog getExpressDialog(){
  return new ValidationRuleExcpressDialog(page.getSite().getShell(),getTreeParent(),Messages.getMessage("String_Node_Str"),struc.getDefaultValueRule(),conceptName,false,false);
}

Fixed version (ground truth):
protected ValidationRuleExcpressDialog getExpressDialog(){
  return new ValidationRuleExcpressDialog(page.getSite().getShell(),getTreeParent(),Messages.getString("String_Node_Str"),struc.getDefaultValueRule(),conceptName,false,false);
}
Program: 147834
Project: 147834
Buggy source:
public XSDDefaultValueRuleAction(DataModelMainPage page,String dataModelName,boolean isDelete){
  super(page);
  setImageDescriptor(ImageCache.getImage(EImage.DELETE_OBJ.getPath()));
  setText("String_Node_Str");
  setToolTipText("String_Node_Str");
  this.dataModelName=dataModelName;
  this.isDelete=isDelete;
}

Fixed version (ground truth):
public XSDDefaultValueRuleAction(DataModelMainPage page,String dataModelName,boolean isDelete){
  super(page);
  setImageDescriptor(ImageCache.getImage(EImage.DELETE_OBJ.getPath()));
  setText(Messages.getString("String_Node_Str"));
  setToolTipText(Messages.getString("String_Node_Str"));
  this.dataModelName=dataModelName;
  this.isDelete=isDelete;
}
Program: 147835
Project: 147835
Buggy source:
protected FKFilterDialog getNewFKFilterDialog(Shell shell,String filter,DataModelMainPage page,String conceptName){
  return new FKFilterDialog(shell,"String_Node_Str",filter,page,conceptName);
}

Fixed version (ground truth):
protected FKFilterDialog getNewFKFilterDialog(Shell shell,String filter,DataModelMainPage page,String conceptName){
  return new FKFilterDialog(shell,Messages.getString("String_Node_Str"),filter,page,conceptName);
}
Program: 147836
Project: 147836
Buggy source:
public XSDSetAnnotationFKFilterAction(DataModelMainPage page,String dataModelName){
  super(page);
  setImageDescriptor(ImageCache.getImage(EImage.FILTER_PS.getPath()));
  setText("String_Node_Str");
  setToolTipText("String_Node_Str");
  this.dataModelName=dataModelName;
}

Fixed version (ground truth):
public XSDSetAnnotationFKFilterAction(DataModelMainPage page,String dataModelName){
  super(page);
  setImageDescriptor(ImageCache.getImage(EImage.FILTER_PS.getPath()));
  setText(Messages.getString("String_Node_Str"));
  setToolTipText(Messages.getString("String_Node_Str"));
  this.dataModelName=dataModelName;
}
Program: 147838
Project: 147838
Buggy source:
public XSDSetAnnotationForeignKeyAction(DataModelMainPage page,String dataModelName){
  super(page);
  setImageDescriptor(ImageCache.getImage(EImage.PRIMARYKEY.getPath()));
  setText("String_Node_Str");
  setToolTipText("String_Node_Str");
  this.dataModelName=dataModelName;
}

Fixed version (ground truth):
public XSDSetAnnotationForeignKeyAction(DataModelMainPage page,String dataModelName){
  super(page);
  setImageDescriptor(ImageCache.getImage(EImage.PRIMARYKEY.getPath()));
  setText(Messages.getString("String_Node_Str"));
  setToolTipText(Messages.getString("String_Node_Str"));
  this.dataModelName=dataModelName;
}
Program: 147840
Project: 147840
Buggy source:
protected SimpleXpathInputDialog getNewSimpleXpathInputDlg(String foreignKey){
  return new SimpleXpathInputDialog(page,"String_Node_Str","String_Node_Str",foreignKey,new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      sxid.close();
    }
  }
,dataModelName);
}

Fixed version (ground truth):
protected SimpleXpathInputDialog getNewSimpleXpathInputDlg(String foreignKey){
  return new SimpleXpathInputDialog(page,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),foreignKey,new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      sxid.close();
    }
  }
,dataModelName);
}
Program: 147841
Project: 147841
Buggy source:
public XSDSetAnnotationForeignKeyInfoAction(DataModelMainPage page,String dataModelName){
  super(page);
  setImageDescriptor(ImageCache.getImage(EImage.KEYINFO.getPath()));
  setText("String_Node_Str");
  setToolTipText("String_Node_Str");
  this.dataModelName=dataModelName;
}

Fixed version (ground truth):
public XSDSetAnnotationForeignKeyInfoAction(DataModelMainPage page,String dataModelName){
  super(page);
  setImageDescriptor(ImageCache.getImage(EImage.KEYINFO.getPath()));
  setText(Messages.getString("String_Node_Str"));
  setToolTipText(Messages.getString("String_Node_Str"));
  this.dataModelName=dataModelName;
}
Program: 147842
Project: 147842
Buggy source:
protected AnnotationOrderedListsDialog getNewAnnotaionOrderedListsDialog(Collection<String> values){
  return new AnnotationOrderedListsDialog(new ArrayList<String>(values),new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      dlg.close();
    }
  }
,page.getSite().getShell(),"String_Node_Str","String_Node_Str",page,AnnotationOrderedListsDialog.AnnotationForeignKeyInfo_ActionType,dataModelName);
}

Fixed version (ground truth):
protected AnnotationOrderedListsDialog getNewAnnotaionOrderedListsDialog(Collection<String> values){
  return new AnnotationOrderedListsDialog(new ArrayList<String>(values),new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      dlg.close();
    }
  }
,page.getSite().getShell(),Messages.getString("String_Node_Str"),"String_Node_Str",page,AnnotationOrderedListsDialog.AnnotationForeignKeyInfo_ActionType,dataModelName);
}
Program: 147844
Project: 147844
Buggy source:
private void importSchemaFromFile(String fileName) throws Exception {
  InputSource source=null;
  Pattern httpUrl=Pattern.compile("String_Node_Str");
  Matcher match=httpUrl.matcher(fileName);
  if (match.matches()) {
    URL url=new URL(fileName);
    String urlContent=IOUtils.toString(url.openConnection().getInputStream());
    urlContent=urlContent.replaceAll("String_Node_Str","String_Node_Str");
    source=new InputSource(IOUtils.toInputStream(urlContent));
    importSchema(source,fileName);
  }
 else {
    String inputType=fileName.substring(fileName.lastIndexOf("String_Node_Str"));
    if (!inputType.equals("String_Node_Str"))     return;
    File file=new File(fileName);
    source=new InputSource(new FileInputStream(file));
    importSchema(source,file.getAbsolutePath());
  }
}

Fixed version (ground truth):
private void importSchemaFromFile(String fileName) throws Exception {
  InputSource source=null;
  Pattern httpUrl=Pattern.compile("String_Node_Str");
  Matcher match=httpUrl.matcher(fileName);
  if (match.matches()) {
    URL url=new URL(fileName);
    String urlContent=IOUtils.toString(url.openConnection().getInputStream());
    urlContent=urlContent.replaceAll("String_Node_Str","String_Node_Str");
    source=new InputSource(IOUtils.toInputStream(urlContent));
    importSchema(source,fileName);
  }
 else {
    String inputType="String_Node_Str";
    if (fileName.lastIndexOf("String_Node_Str") != -1) {
      inputType=fileName.substring(fileName.lastIndexOf("String_Node_Str"));
    }
    if (!inputType.equals("String_Node_Str"))     return;
    File file=new File(fileName);
    source=new InputSource(new FileInputStream(file));
    importSchema(source,file.getAbsolutePath());
  }
}
Program: 147845
Project: 147845
Buggy source:
@Override protected XpathSelectDialog getXPathSelectDialog(){
  return new XpathSelectDialog2(parent.getShell(),Messages.SchematronExpressBuilder_selectXPath,ServerView.show().getSite(),false,null,isAbsoluteXPath);
}

Fixed version (ground truth):
@Override protected XpathSelectDialog getXPathSelectDialog(){
  return new XpathSelectDialog2(parent.getShell(),Messages.SchematronExpressBuilder_selectXPath,MDMRepositoryView.show().getSite(),false,null,isAbsoluteXPath);
}
Program: 147846
Project: 147846
Buggy source:
@Override public void fillContextMenu(IMenuManager menu){
  IStructuredSelection selection=(IStructuredSelection)getContext().getSelection();
  List<AbstractRepositoryAction> finalActions=null;
  for (Iterator il=selection.iterator(); il.hasNext(); ) {
    Object obj=il.next();
    if (obj instanceof IRepositoryViewObject) {
      IRepositoryViewObject viewObj=(IRepositoryViewObject)obj;
      IRepositoryNodeConfiguration conf=RepositoryNodeConfigurationManager.getConfiguration(viewObj);
      IRepositoryNodeActionProvider actionProvider=conf.getActionProvider();
      if (conf != null && actionProvider != null) {
        actionProvider.updateSelection(selection);
        List<AbstractRepositoryAction> actions=actionProvider.getActions(viewObj);
        if (actions != null) {
          if (finalActions == null) {
            finalActions=actions;
          }
          finalActions=combineActions(finalActions,actions);
          if (finalActions.size() == 0) {
            return;
          }
        }
      }
    }
  }
  for (  IAction action : finalActions) {
    if (action instanceof AbstractRepositoryAction) {
      AbstractRepositoryAction groupAction=(AbstractRepositoryAction)action;
      groupAction.selectionChanged(selection);
      if (groupAction.getGroupName() != null) {
        menu.appendToGroup(groupAction.getGroupName(),action);
      }
 else {
        menu.add(action);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void fillContextMenu(IMenuManager menu){
  if (ProxyRepositoryFactory.getInstance().isUserReadOnlyOnCurrentProject()) {
    return;
  }
  IStructuredSelection selection=(IStructuredSelection)getContext().getSelection();
  List<AbstractRepositoryAction> finalActions=null;
  for (Iterator il=selection.iterator(); il.hasNext(); ) {
    Object obj=il.next();
    if (obj instanceof IRepositoryViewObject) {
      IRepositoryViewObject viewObj=(IRepositoryViewObject)obj;
      IRepositoryNodeConfiguration conf=RepositoryNodeConfigurationManager.getConfiguration(viewObj);
      IRepositoryNodeActionProvider actionProvider=conf.getActionProvider();
      if (conf != null && actionProvider != null) {
        actionProvider.updateSelection(selection);
        List<AbstractRepositoryAction> actions=actionProvider.getActions(viewObj);
        if (actions != null) {
          if (finalActions == null) {
            finalActions=actions;
          }
          finalActions=combineActions(finalActions,actions);
          if (finalActions.size() == 0) {
            return;
          }
        }
      }
    }
  }
  for (  IAction action : finalActions) {
    if (action instanceof AbstractRepositoryAction) {
      AbstractRepositoryAction groupAction=(AbstractRepositoryAction)action;
      groupAction.selectionChanged(selection);
      if (groupAction.getGroupName() != null) {
        menu.appendToGroup(groupAction.getGroupName(),action);
      }
 else {
        menu.add(action);
      }
    }
  }
}
Program: 147847
Project: 147847
Buggy source:
public static List<String> findAllDataModelNames(){
  IMDMRepositoryViewServiceExt service=getRepositoryViewService();
  if (service != null)   return service.findAllWorkflowNames();
 else   return null;
}

Fixed version (ground truth):
public static List<String> findAllDataModelNames(){
  IMDMRepositoryViewServiceExt service=getRepositoryViewService();
  if (service != null)   return service.findAllDataModelNames();
 else   return null;
}
Program: 147848
Project: 147848
Buggy source:
public XpathSelectDialog(Shell parentShell,TreeParent parent,String title,IWorkbenchPartSite site,boolean isMulti,String dataModelName,boolean isAbsolutePath){
  super(parentShell);
  this.title=title;
  this.parent=parent;
  this.site=site;
  this.isMulti=isMulti;
  this.isAbsolutePath=isAbsolutePath;
  if (dataModelName != null)   this.dataModelName=dataModelName;
  if (this.site == null)   this.site=ServerView.show().getSite();
}

Fixed version (ground truth):
public XpathSelectDialog(Shell parentShell,TreeParent parent,String title,IWorkbenchPartSite site,boolean isMulti,String dataModelName,boolean isAbsolutePath){
  super(parentShell);
  this.title=title;
  this.parent=parent;
  this.site=site;
  this.isMulti=isMulti;
  this.isAbsolutePath=isAbsolutePath;
  if (dataModelName != null)   this.dataModelName=dataModelName;
  if (this.site == null && this.parent != null)   this.site=ServerView.show().getSite();
 else {
    this.site=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getSite();
  }
}