nus-yam/ex-repair huggingface dataset:
Program: 147620
Project: 147620
Buggy source:
@Override protected IEditorPart getCorrespondingEditor(RepositoryNode node){
  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);
      if (editorInput != null) {
        IWorkbenchPage page=MDMRepositoryView.show().getCommonViewer().getCommonNavigator().getSite().getWorkbenchWindow().getActivePage();
        try {
          return page.openEditor(editorInput,editorInput.getEditorId());
        }
 catch (        PartInitException e) {
          log.error(e.getMessage(),e);
        }
      }
    }
  }
  return null;
}

Fixed version (ground truth):
@Override protected IEditorPart getCorrespondingEditor(IRepositoryNode node){
  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);
      if (editorInput != null) {
        IWorkbenchPage page=MDMRepositoryView.show().getCommonViewer().getCommonNavigator().getSite().getWorkbenchWindow().getActivePage();
        try {
          return page.openEditor(editorInput,editorInput.getEditorId());
        }
 catch (        PartInitException e) {
          log.error(e.getMessage(),e);
        }
      }
    }
  }
  return null;
}
Program: 147623
Project: 147623
Buggy source:
public static void addStudioToken(HttpMessage httpMessage,String userName){
  if (httpMessage != null && userName != null) {
    String[] studioToken=getStudioToken(userName);
    httpMessage.addHeader(studioToken[0],studioToken[1]);
  }
}

Fixed version (ground truth):
public static void addStudioToken(HttpMessage httpMessage,String userName){
  if (httpMessage != null && userName != null) {
    String[] studioToken=getStudioToken(userName);
    if (studioToken != null && studioToken.length == 2) {
      httpMessage.addHeader(studioToken[0],studioToken[1]);
    }
  }
}
Program: 147624
Project: 147624
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();
    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 contextPath=Util.getContextPath(serverDef.getPath());
    String uripre=serverDef.getProtocol() + serverDef.getHost() + ':'+ serverDef.getPort()+ contextPath;
    result.append(uripre);
    result.append("String_Node_Str" + catalog + '/'+ fileName);
    result.append('\n');
  }
  Clipboard cb=new Clipboard(Display.getCurrent());
  String textData=result.toString();
  TextTransfer transfer=TextTransfer.getInstance();
  cb.setContents(new Object[]{textData},new Transfer[]{transfer});
  cb.dispose();
}

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 contextPath=Util.getContextPath(serverDef.getPath());
    String uripre=serverDef.getProtocol() + serverDef.getHost() + ':'+ serverDef.getPort()+ contextPath;
    result.append(uripre);
    result.append("String_Node_Str" + catalog + '/'+ fileName);
    result.append('\n');
  }
  if (result.length() != 0) {
    Clipboard cb=new Clipboard(Display.getCurrent());
    String textData=result.toString();
    TextTransfer transfer=TextTransfer.getInstance();
    cb.setContents(new Object[]{textData},new Transfer[]{transfer});
    cb.dispose();
  }
}
Program: 147625
Project: 147625
Buggy source:
private ConsistencyService(){
}

Fixed version (ground truth):
private ConsistencyService(){
  exAdapter=ExAdapterManager.getAdapter(this,IConsistencyServiceExAdapter.class);
}
Program: 147626
Project: 147626
Buggy source:
private String getObjectName(TreeObject treeObj){
  int type=treeObj.getType();
  String objectName=treeObj.getDisplayName();
  ;
  if (type == TreeObject.CUSTOM_FORM) {
    WSCustomForm customForm=(WSCustomForm)treeObj.getWsObject();
    objectName=customForm.getDatamodel() + OBJ_NAME_DIVIDE + customForm.getEntity()+ OBJ_NAME_DIVIDE+ objectName;
  }
  return objectName;
}

Fixed version (ground truth):
private String getObjectName(TreeObject treeObj){
  String objectName=treeObj.getDisplayName();
  if (exAdapter != null) {
    objectName=exAdapter.getObjectNameForDigest(treeObj);
  }
  return objectName;
}
Program: 147627
Project: 147627
Buggy source:
/** 
 * 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;
}

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(Util.getContextPath(serverDef.getPath())).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: 147628
Project: 147628
Buggy source:
/** 
 * if using XML DB and the return records exceed limit, it will return null;
 * @param port
 * @param dataClusterName
 * @return
 */
public static DataProcessRule createProcessRouterFromRemote(TMDMService service,String dataClusterName){
  WsGetConceptsInDataCluster param=new WsGetConceptsInDataCluster(new WsDataClusterPK(dataClusterName));
  WsStringArray concepts=service.getConceptsInDataCluster(param);
  if (concepts != null) {
    DataProcessRule rule=new DataProcessRule();
    for (    String concept : concepts.getStrings()) {
      rule.addNewEnityUnit(concept);
    }
    return rule;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * if using XML DB and the return records exceed limit, it will return null;
 * @param port
 * @param dataClusterName
 * @return
 */
public static DataProcessRule createProcessRouterFromRemote(TMDMService service,String dataClusterName){
  WSGetConceptsInDataCluster param=new WSGetConceptsInDataCluster(new WSDataClusterPK(dataClusterName));
  WSStringArray concepts=service.getConceptsInDataCluster(param);
  if (concepts != null) {
    DataProcessRule rule=new DataProcessRule();
    for (    String concept : concepts.getStrings()) {
      rule.addNewEnityUnit(concept);
    }
    return rule;
  }
  return null;
}
Program: 147629
Project: 147629
Buggy source:
protected Mapping getWSItemMapping() throws IOException, MappingException {
  URL mappingUrl=this.getClass().getResource("String_Node_Str");
  Mapping mapping=new Mapping(WsItem.class.getClassLoader());
  mapping.loadMapping(mappingUrl);
  return mapping;
}

Fixed version (ground truth):
protected Mapping getWSItemMapping() throws IOException, MappingException {
  URL mappingUrl=this.getClass().getResource("String_Node_Str");
  Mapping mapping=new Mapping(WSItem.class.getClassLoader());
  mapping.loadMapping(mappingUrl);
  return mapping;
}
Program: 147632
Project: 147632
Buggy source:
@Override public Object[] getPropertys(Object obj){
  if (obj == null || !(obj instanceof WsRoutingRuleOperator)) {
    throw new IllegalArgumentException();
  }
  WsRoutingRuleOperator operator=(WsRoutingRuleOperator)obj;
  return new Object[]{operator.value()};
}

Fixed version (ground truth):
@Override public Object[] getPropertys(Object obj){
  if (obj == null || !(obj instanceof WSRoutingRuleOperator)) {
    throw new IllegalArgumentException();
  }
  WSRoutingRuleOperator operator=(WSRoutingRuleOperator)obj;
  return new Object[]{operator.value()};
}
Program: 147633
Project: 147633
Buggy source:
public Class getWSObjectClass(){
  return WsDataCluster.class;
}

Fixed version (ground truth):
public Class getWSObjectClass(){
  return WSDataCluster.class;
}
Program: 147634
Project: 147634
Buggy source:
public Class<?> getWSObjectClass(){
  return WsDataModel.class;
}

Fixed version (ground truth):
public Class<?> getWSObjectClass(){
  return WSDataModel.class;
}
Program: 147635
Project: 147635
Buggy source:
public Class<?> getWSObjectClass(){
  return WsMenu.class;
}

Fixed version (ground truth):
public Class<?> getWSObjectClass(){
  return WSMenu.class;
}
Program: 147636
Project: 147636
Buggy source:
public Class getWSObjectClass(){
  return WsRoutingRule.class;
}

Fixed version (ground truth):
public Class getWSObjectClass(){
  return WSRoutingRule.class;
}
Program: 147637
Project: 147637
Buggy source:
public Class getWSObjectClass(){
  return WsStoredProcedure.class;
}

Fixed version (ground truth):
public Class getWSObjectClass(){
  return WSStoredProcedure.class;
}
Program: 147638
Project: 147638
Buggy source:
public Class getWSObjectClass(){
  return WsTransformerV2.class;
}

Fixed version (ground truth):
public Class getWSObjectClass(){
  return WSTransformerV2.class;
}
Program: 147639
Project: 147639
Buggy source:
public Class<?> getWSObjectClass(){
  return WsView.class;
}

Fixed version (ground truth):
public Class<?> getWSObjectClass(){
  return WSView.class;
}
Program: 147641
Project: 147641
Buggy source:
private boolean addAppInfo(String type,String value){
  if (declaration != null) {
    if (declaration.getAnnotation() == null) {
      declaration.setAnnotation(annotation);
    }
  }
 else   if (complexTypeDef != null) {
    if (complexTypeDef.getAnnotation() == null) {
      complexTypeDef.setAnnotation(annotation);
    }
  }
 else {
    return true;
  }
  Element appinfo=annotation.createApplicationInformation(type);
  Node text=appinfo.getOwnerDocument().createTextNode(value);
  appinfo.appendChild(text);
  annotation.getElement().appendChild(appinfo);
  hasChanged=true;
  return true;
}

Fixed version (ground truth):
private boolean addAppInfo(String type,String value){
  if (declaration != null) {
    if (declaration.getAnnotation() == null) {
      declaration.setAnnotation(annotation);
    }
  }
 else   if (complexTypeDef != null && type.startsWith("String_Node_Str")) {
    if (complexTypeDef.getAnnotation() == null) {
      complexTypeDef.setAnnotation(annotation);
    }
  }
 else {
    return true;
  }
  Element appinfo=annotation.createApplicationInformation(type);
  Node text=appinfo.getOwnerDocument().createTextNode(value);
  appinfo.appendChild(text);
  annotation.getElement().appendChild(appinfo);
  hasChanged=true;
  return true;
}
Program: 147642
Project: 147642
Buggy source:
@Override public void focusLost(FocusEvent e){
  boolean isComboSelected=false;
  CCombo comboBox=getComboBox();
  int selectionIndex=comboBox.getSelectionIndex();
  if (selectionIndex != -1 && selectionIndex < comboBox.getItemCount()) {
    if (comboBox.getItem(selectionIndex).equals(user_var)) {
      isComboSelected=true;
    }
  }
  if (!getButton().isFocusControl() && !isComboSelected) {
    UserSecurityComboBoxDialogCellEditor.this.focusLost();
  }
}

Fixed version (ground truth):
@Override public void focusLost(FocusEvent e){
}
Program: 147643
Project: 147643
Buggy source:
@Override protected FocusListener getComboFocusListener(){
  return new FocusAdapter(){
    @Override public void focusLost(    FocusEvent e){
      boolean isComboSelected=false;
      CCombo comboBox=getComboBox();
      int selectionIndex=comboBox.getSelectionIndex();
      if (selectionIndex != -1 && selectionIndex < comboBox.getItemCount()) {
        if (comboBox.getItem(selectionIndex).equals(user_var)) {
          isComboSelected=true;
        }
      }
      if (!getButton().isFocusControl() && !isComboSelected) {
        UserSecurityComboBoxDialogCellEditor.this.focusLost();
      }
    }
  }
;
}

Fixed version (ground truth):
@Override protected FocusListener getComboFocusListener(){
  return new FocusAdapter(){
    @Override public void focusLost(    FocusEvent e){
    }
  }
;
}
Program: 147644
Project: 147644
Buggy source:
@Override protected Control createControl(Composite parent){
  Font font=parent.getFont();
  Color bg=parent.getBackground();
  editor=new Composite(parent,getStyle());
  editor.setFont(font);
  editor.setBackground(bg);
  editor.setLayout(new DialogCellLayout());
  contents=createContents(editor);
  updateContents(value);
  button=createButton(editor);
  button.setFont(font);
  button.addKeyListener(new KeyAdapter(){
    @Override public void keyReleased(    KeyEvent e){
      if (e.character == '\u001b') {
        fireCancelEditor();
      }
    }
  }
);
  button.addFocusListener(getButtonFocusListener());
  button.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent event){
      button.removeFocusListener(getButtonFocusListener());
      Object newValue=openDialogBox(editor);
      button.addFocusListener(getButtonFocusListener());
      if (newValue != null) {
        boolean newValidState=isCorrect(newValue);
        if (newValidState) {
          markDirty();
          doSetValue(newValue);
        }
 else {
          setErrorMessage(MessageFormat.format(getErrorMessage(),new Object[]{newValue.toString()}));
        }
        fireApplyEditorValue();
      }
    }
  }
);
  setValueValid(true);
  return editor;
}

Fixed version (ground truth):
@Override protected Control createControl(Composite parent){
  Font font=parent.getFont();
  Color bg=parent.getBackground();
  editor=new Composite(parent,getStyle());
  editor.setFont(font);
  editor.setBackground(bg);
  editor.setLayout(new DialogCellLayout());
  contents=createContents(editor);
  updateContents(value);
  button=createButton(editor);
  button.setFont(font);
  button.addKeyListener(new KeyAdapter(){
    @Override public void keyReleased(    KeyEvent e){
      if (e.character == '\u001b') {
        fireCancelEditor();
      }
    }
  }
);
  button.addFocusListener(getButtonFocusListener());
  button.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent event){
      button.removeFocusListener(getButtonFocusListener());
      Object newValue=openDialogBox(editor);
      button.addFocusListener(getButtonFocusListener());
      if (newValue != null) {
        boolean newValidState=isCorrect(newValue);
        if (newValidState) {
          markDirty();
          doSetValue(newValue);
        }
 else {
          setErrorMessage(MessageFormat.format(getErrorMessage(),new Object[]{newValue.toString()}));
        }
      }
    }
  }
);
  if (parent instanceof Table) {
    ((Table)parent).addMouseListener(new MouseAdapter(){
      @Override public void mouseUp(      MouseEvent e){
        if (!isMouseInControl(e)) {
          focusLost();
        }
      }
    }
);
  }
  setValueValid(true);
  return editor;
}
Program: 147645
Project: 147645
Buggy source:
@Override public void focusLost(FocusEvent e){
  boolean isComboSelected=false;
  CCombo comboBox=getComboBox();
  int selectionIndex=comboBox.getSelectionIndex();
  if (selectionIndex != -1 && selectionIndex < comboBox.getItemCount()) {
    if (comboBox.getItem(selectionIndex).equals(user_var)) {
      isComboSelected=true;
    }
  }
  if (!getButton().isFocusControl() && !isComboSelected) {
    UserSecurityComboBoxDialogCellEditor.this.focusLost();
  }
}

Fixed version (ground truth):
@Override public void focusLost(FocusEvent e){
}
Program: 147646
Project: 147646
Buggy source:
@Override protected FocusListener getComboFocusListener(){
  return new FocusAdapter(){
    @Override public void focusLost(    FocusEvent e){
      boolean isComboSelected=false;
      CCombo comboBox=getComboBox();
      int selectionIndex=comboBox.getSelectionIndex();
      if (selectionIndex != -1 && selectionIndex < comboBox.getItemCount()) {
        if (comboBox.getItem(selectionIndex).equals(user_var)) {
          isComboSelected=true;
        }
      }
      if (!getButton().isFocusControl() && !isComboSelected) {
        UserSecurityComboBoxDialogCellEditor.this.focusLost();
      }
    }
  }
;
}

Fixed version (ground truth):
@Override protected FocusListener getComboFocusListener(){
  return new FocusAdapter(){
    @Override public void focusLost(    FocusEvent e){
    }
  }
;
}
Program: 147647
Project: 147647
Buggy source:
@Override protected Control createControl(Composite parent){
  Font font=parent.getFont();
  Color bg=parent.getBackground();
  editor=new Composite(parent,getStyle());
  editor.setFont(font);
  editor.setBackground(bg);
  editor.setLayout(new DialogCellLayout());
  contents=createContents(editor);
  updateContents(value);
  button=createButton(editor);
  button.setFont(font);
  button.addKeyListener(new KeyAdapter(){
    @Override public void keyReleased(    KeyEvent e){
      if (e.character == '\u001b') {
        fireCancelEditor();
      }
    }
  }
);
  button.addFocusListener(getButtonFocusListener());
  button.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent event){
      button.removeFocusListener(getButtonFocusListener());
      Object newValue=openDialogBox(editor);
      button.addFocusListener(getButtonFocusListener());
      if (newValue != null) {
        boolean newValidState=isCorrect(newValue);
        if (newValidState) {
          markDirty();
          doSetValue(newValue);
        }
 else {
          setErrorMessage(MessageFormat.format(getErrorMessage(),new Object[]{newValue.toString()}));
        }
        fireApplyEditorValue();
      }
    }
  }
);
  setValueValid(true);
  return editor;
}

Fixed version (ground truth):
@Override protected Control createControl(Composite parent){
  Font font=parent.getFont();
  Color bg=parent.getBackground();
  editor=new Composite(parent,getStyle());
  editor.setFont(font);
  editor.setBackground(bg);
  editor.setLayout(new DialogCellLayout());
  contents=createContents(editor);
  updateContents(value);
  button=createButton(editor);
  button.setFont(font);
  button.addKeyListener(new KeyAdapter(){
    @Override public void keyReleased(    KeyEvent e){
      if (e.character == '\u001b') {
        fireCancelEditor();
      }
    }
  }
);
  button.addFocusListener(getButtonFocusListener());
  button.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent event){
      button.removeFocusListener(getButtonFocusListener());
      Object newValue=openDialogBox(editor);
      button.addFocusListener(getButtonFocusListener());
      if (newValue != null) {
        boolean newValidState=isCorrect(newValue);
        if (newValidState) {
          markDirty();
          doSetValue(newValue);
        }
 else {
          setErrorMessage(MessageFormat.format(getErrorMessage(),new Object[]{newValue.toString()}));
        }
      }
    }
  }
);
  if (parent instanceof Table) {
    ((Table)parent).addMouseListener(new MouseAdapter(){
      @Override public void mouseUp(      MouseEvent e){
        if (!isMouseInControl(e)) {
          focusLost();
        }
      }
    }
);
  }
  setValueValid(true);
  return editor;
}
Program: 147648
Project: 147648
Buggy source:
public List<URL> getTalendRoutines(){
  return FilesUtils.getFilesFromFolder(Activator.getDefault().getBundle(),"String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public List<URL> getTalendRoutines(){
  return Collections.emptyList();
}
Program: 147650
Project: 147650
Buggy source:
private void removeLastServerInfo(Item item){
  Property property=item.getProperty();
  EMap additionalProperties=property.getAdditionalProperties();
  if (additionalProperties != null) {
    RepositoryResourceUtil.setLastServerDef(item,null);
    ProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
    try {
      item=RepositoryResourceUtil.assertItem(item);
      factory.save(item,true);
    }
 catch (    PersistenceException e) {
      log.error(e.getMessage(),e);
    }
  }
}

Fixed version (ground truth):
private void removeLastServerInfo(Item item){
  Property property=item.getProperty();
  EMap additionalProperties=property.getAdditionalProperties();
  if (additionalProperties != null && additionalProperties.containsKey(RepositoryResourceUtil.PROP_LAST_SERVER_DEF)) {
    RepositoryResourceUtil.setLastServerDef(item,null);
    ProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
    try {
      item=RepositoryResourceUtil.assertItem(item);
      factory.save(item,true);
    }
 catch (    PersistenceException e) {
      log.error(e.getMessage(),e);
    }
  }
}
Program: 147651
Project: 147651
Buggy source:
public static List<IRepositoryViewObject> findViewObjectsByNamePattern(ERepositoryObjectType type,String namePattern,boolean withDeleted){
  if (type == null || namePattern == null) {
    throw new IllegalArgumentException();
  }
  List<IRepositoryViewObject> viewObjects=findAllViewObjects(type,true,withDeleted);
  if (viewObjects != null) {
    List<IRepositoryViewObject> foundViewObjs=new LinkedList<IRepositoryViewObject>();
    Pattern pattern=Pattern.compile(namePattern);
    for (    IRepositoryViewObject viewObj : viewObjects) {
      String label=viewObj.getProperty().getLabel();
      if (pattern.matcher(label).matches()) {
        foundViewObjs.add(viewObj);
      }
    }
    if (!foundViewObjs.isEmpty()) {
      return foundViewObjs;
    }
  }
  return null;
}

Fixed version (ground truth):
public static List<IRepositoryViewObject> findViewObjectsByNamePattern(ERepositoryObjectType type,String namePattern,boolean withDeleted){
  if (type == null || namePattern == null) {
    throw new IllegalArgumentException();
  }
  List<IRepositoryViewObject> viewObjects=findAllViewObjects(type,true,withDeleted);
  if (viewObjects != null) {
    List<IRepositoryViewObject> foundViewObjs=new LinkedList<IRepositoryViewObject>();
    Pattern pattern=Pattern.compile(namePattern);
    for (    IRepositoryViewObject viewObj : viewObjects) {
      String label=viewObj.getProperty().getLabel();
      if (pattern.matcher(label).matches()) {
        foundViewObjs.add(viewObj);
      }
    }
    return foundViewObjs;
  }
  return null;
}
Program: 147652
Project: 147652
Buggy source:
private void initListener2BtnEditField(){
  lBtnEditFieldListener=new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      FieldWrapper[] selectedFields=getSelectedFields();
      if (selectedFields.length == 0)       return;
      try {
        KeyWrapper[] selectedKeys=getSelectedKeys();
        List<String> topChilds=getTopChildrenNames();
        List<String> fieldNames=getFieldNames(selectedKeys[0].getSourceKey());
        for (        String fdv : fieldNames) {
          if (topChilds.contains(fdv))           topChilds.remove(fdv);
        }
        SelectFieldDialog selectFieldDlg=new SelectFieldDialog(getShell(),"String_Node_Str",topChilds,selectedFields[0].getXPath());
        if (selectFieldDlg.open() != Window.OK)         return;
        selectedFields[0].setXPath(selectFieldDlg.getField().trim());
        tvFields.refresh();
        if (section != null)         section.autoCommit();
      }
 catch (      Exception exp) {
        log.error(exp.getMessage(),exp);
      }
    }
  }
;
}

Fixed version (ground truth):
private void initListener2BtnEditField(){
  lBtnEditFieldListener=new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      FieldWrapper[] selectedFields=getSelectedFields();
      if (selectedFields.length == 0) {
        return;
      }
      try {
        KeyWrapper[] selectedKeys=getSelectedKeys();
        List<String> topChilds=getTopChildrenNames();
        List<String> fieldNames=getFieldNames(selectedKeys[0].getSourceKey());
        for (        String fdv : fieldNames) {
          if (topChilds.contains(fdv)) {
            topChilds.remove(fdv);
          }
        }
        SelectFieldDialog selectFieldDlg=new SelectFieldDialog(getShell(),"String_Node_Str",topChilds,selectedFields[0].getXPath());
        if (selectFieldDlg.open() != Window.OK) {
          return;
        }
        selectedFields[0].setXPath(selectFieldDlg.getField().trim());
        tvFields.refresh();
        if (section != null) {
          section.autoCommit();
        }
      }
 catch (      Exception exp) {
        log.error(exp.getMessage(),exp);
      }
    }
  }
;
}
Program: 147653
Project: 147653
Buggy source:
private void initListener2ComboSelector(){
  lComboSelectorMouseListener=new MouseAdapter(){
    @Override public void mouseDown(    MouseEvent e){
      initComboSelectorContents();
    }
  }
;
  lComboSelectorModifyListner=new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      KeyWrapper[] selectedKeys=getSelectedKeys();
      if (selectedKeys.length > 0 && selectedKeys[0].getSelector().equals(comboSelector.getText().trim()))       return;
      if (!isSelectorValid(comboSelector.getText().trim())) {
        if (selectedKeys.length > 0)         comboSelector.setText(selectedKeys[0].getSelector());
        return;
      }
      getSelectedKeys()[0].setSelector(comboSelector.getText().trim());
      if (section != null)       section.autoCommit();
    }
  }
;
}

Fixed version (ground truth):
private void initListener2ComboSelector(){
  lComboSelectorMouseListener=new MouseAdapter(){
    @Override public void mouseDown(    MouseEvent e){
      initComboSelectorContents();
    }
  }
;
  lComboSelectorModifyListner=new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      KeyWrapper[] selectedKeys=getSelectedKeys();
      if (selectedKeys.length > 0 && selectedKeys[0].getSelector().equals(comboSelector.getText().trim())) {
        return;
      }
      if (!isSelectorValid(comboSelector.getText().trim())) {
        if (selectedKeys.length > 0) {
          comboSelector.setText(selectedKeys[0].getSelector());
        }
        return;
      }
      getSelectedKeys()[0].setSelector(comboSelector.getText().trim());
      if (section != null) {
        section.autoCommit();
      }
    }
  }
;
}
Program: 147654
Project: 147654
Buggy source:
private void initListener2BtnAddKey(){
  lBtnAddKeyListener=new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      try {
        List<String> topChilds=getTopChildrenNames();
        IdentityConstraintInputDialog dialog=new IdentityConstraintInputDialog(entityWrapper.getSourceEntity(),getShell(),Messages.EntityKeyConfigComposite_AddANewKey,topChilds,entityWrapper.getSourceEntityName());
        dialog.setInputValidator(new NewKeyWrapperValidator(entityWrapper));
        if (dialog.open() != Window.OK)         return;
        KeyWrapper newKeyWrapper=new KeyWrapper(dialog.getKeyName(),"String_Node_Str",dialog.getType(),new FieldWrapper[]{new FieldWrapper(dialog.getFieldName())});
        entityWrapper.addKey(newKeyWrapper);
        tvKeys.setInput(Arrays.asList(entityWrapper.getKeys()));
        tvKeys.setSelection(new StructuredSelection(newKeyWrapper));
        if (section != null)         section.autoCommit();
      }
 catch (      Exception exp) {
        log.error(exp.getMessage(),exp);
      }
    }
  }
;
}

Fixed version (ground truth):
private void initListener2BtnAddKey(){
  lBtnAddKeyListener=new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      try {
        List<String> topChilds=getTopChildrenNames();
        IdentityConstraintInputDialog dialog=new IdentityConstraintInputDialog(entityWrapper.getSourceEntity(),getShell(),Messages.EntityKeyConfigComposite_AddANewKey,topChilds,entityWrapper.getSourceEntityName());
        dialog.setInputValidator(new NewKeyWrapperValidator(entityWrapper));
        if (dialog.open() != Window.OK) {
          return;
        }
        KeyWrapper newKeyWrapper=new KeyWrapper(dialog.getKeyName(),"String_Node_Str",dialog.getType(),new FieldWrapper[]{new FieldWrapper(dialog.getFieldName())});
        entityWrapper.addKey(newKeyWrapper);
        tvKeys.setInput(Arrays.asList(entityWrapper.getKeys()));
        tvKeys.setSelection(new StructuredSelection(newKeyWrapper));
        if (section != null) {
          section.autoCommit();
        }
      }
 catch (      Exception exp) {
        log.error(exp.getMessage(),exp);
      }
    }
  }
;
}
Program: 147655
Project: 147655
Buggy source:
public void setXSDElement(EntityWrapper sourceEntityWrapper){
  entityWrapper=sourceEntityWrapper;
  removeUIListeners();
  tvKeys.setInput(new ArrayList<KeyWrapper>());
  if (entityWrapper != null)   tvKeys.setInput(Arrays.asList(entityWrapper.getKeys()));
  initUIContents();
  addUIListeners();
  selectFirstKeyInCurKeyList();
  refreshUI();
}

Fixed version (ground truth):
public void setXSDElement(EntityWrapper sourceEntityWrapper){
  entityWrapper=sourceEntityWrapper;
  removeUIListeners();
  tvKeys.setInput(new ArrayList<KeyWrapper>());
  if (entityWrapper != null) {
    tvKeys.setInput(Arrays.asList(entityWrapper.getKeys()));
  }
  initUIContents();
  addUIListeners();
  selectFirstKeyInCurKeyList();
  refreshUI();
}
Program: 147656
Project: 147656
Buggy source:
private FieldWrapper[] getSelectedFields(){
  if (!isFieldSelected())   return new FieldWrapper[0];
  List<FieldWrapper> results=new ArrayList<FieldWrapper>();
  for (  Object eachSelectedObj : ((IStructuredSelection)tvFields.getSelection()).toArray()) {
    if (eachSelectedObj instanceof FieldWrapper)     results.add((FieldWrapper)eachSelectedObj);
  }
  return results.toArray(new FieldWrapper[0]);
}

Fixed version (ground truth):
private FieldWrapper[] getSelectedFields(){
  if (!isFieldSelected()) {
    return new FieldWrapper[0];
  }
  List<FieldWrapper> results=new ArrayList<FieldWrapper>();
  for (  Object eachSelectedObj : ((IStructuredSelection)tvFields.getSelection()).toArray()) {
    if (eachSelectedObj instanceof FieldWrapper) {
      results.add((FieldWrapper)eachSelectedObj);
    }
  }
  return results.toArray(new FieldWrapper[0]);
}
Program: 147657
Project: 147657
Buggy source:
private String isKeyNameValid(String keyName,KeyWrapper keyBeforeModified){
  if (entityWrapper == null)   return Messages.EntityKeyConfigComposite_EntityCannotbeNull;
  return new EditKeyWrapperNameValidator(entityWrapper,keyBeforeModified).isValid(keyName);
}

Fixed version (ground truth):
private String isKeyNameValid(String keyName,KeyWrapper keyBeforeModified){
  if (entityWrapper == null) {
    return Messages.EntityKeyConfigComposite_EntityCannotbeNull;
  }
  return new EditKeyWrapperNameValidator(entityWrapper,keyBeforeModified).isValid(keyName);
}
Program: 147658
Project: 147658
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  try {
    List<String> topChilds=getTopChildrenNames();
    IdentityConstraintInputDialog dialog=new IdentityConstraintInputDialog(entityWrapper.getSourceEntity(),getShell(),Messages.EntityKeyConfigComposite_AddANewKey,topChilds,entityWrapper.getSourceEntityName());
    dialog.setInputValidator(new NewKeyWrapperValidator(entityWrapper));
    if (dialog.open() != Window.OK)     return;
    KeyWrapper newKeyWrapper=new KeyWrapper(dialog.getKeyName(),"String_Node_Str",dialog.getType(),new FieldWrapper[]{new FieldWrapper(dialog.getFieldName())});
    entityWrapper.addKey(newKeyWrapper);
    tvKeys.setInput(Arrays.asList(entityWrapper.getKeys()));
    tvKeys.setSelection(new StructuredSelection(newKeyWrapper));
    if (section != null)     section.autoCommit();
  }
 catch (  Exception exp) {
    log.error(exp.getMessage(),exp);
  }
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  try {
    List<String> topChilds=getTopChildrenNames();
    IdentityConstraintInputDialog dialog=new IdentityConstraintInputDialog(entityWrapper.getSourceEntity(),getShell(),Messages.EntityKeyConfigComposite_AddANewKey,topChilds,entityWrapper.getSourceEntityName());
    dialog.setInputValidator(new NewKeyWrapperValidator(entityWrapper));
    if (dialog.open() != Window.OK) {
      return;
    }
    KeyWrapper newKeyWrapper=new KeyWrapper(dialog.getKeyName(),"String_Node_Str",dialog.getType(),new FieldWrapper[]{new FieldWrapper(dialog.getFieldName())});
    entityWrapper.addKey(newKeyWrapper);
    tvKeys.setInput(Arrays.asList(entityWrapper.getKeys()));
    tvKeys.setSelection(new StructuredSelection(newKeyWrapper));
    if (section != null) {
      section.autoCommit();
    }
  }
 catch (  Exception exp) {
    log.error(exp.getMessage(),exp);
  }
}
Program: 147659
Project: 147659
Buggy source:
@Override public String isValid(String keyName,XSDIdentityConstraintCategory type,XSDElementDeclaration element){
  if (keyName == null || "String_Node_Str".equals(keyName.trim()))   return Messages.EntityKeyConfigComposite_ValidInfo4;
  for (  XSDIdentityConstraintDefinition eachKey : getSchema().getIdentityConstraintDefinitions()) {
    if (eachKey.getContainer().equals(element)) {
      continue;
    }
    if (eachKey.getName().equals(keyName)) {
      return Messages.bind(Messages.EntityKeyConfigComposite_ValidInfo5,keyName);
    }
  }
  for (  KeyWrapper eachKeyWrapper : entityWrapper.getKeys()) {
    if (type.equals(XSDIdentityConstraintCategory.UNIQUE_LITERAL) && eachKeyWrapper.getType().equals(XSDIdentityConstraintCategory.UNIQUE_LITERAL)) {
      return Messages.EntityKeyConfigComposite_ValidInfo6;
    }
    if (eachKeyWrapper.getName().equals(keyName)) {
      return Messages.bind(Messages.EntityKeyConfigComposite_ValidInfo7,keyName);
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public String isValid(String keyName,XSDIdentityConstraintCategory type,XSDElementDeclaration element){
  if (keyName == null || "String_Node_Str".equals(keyName.trim())) {
    return Messages.EntityKeyConfigComposite_ValidInfo4;
  }
  for (  XSDIdentityConstraintDefinition eachKey : getSchema().getIdentityConstraintDefinitions()) {
    if (eachKey.getContainer().equals(element)) {
      continue;
    }
    if (eachKey.getName().equals(keyName)) {
      return Messages.bind(Messages.EntityKeyConfigComposite_ValidInfo5,keyName);
    }
  }
  for (  KeyWrapper eachKeyWrapper : entityWrapper.getKeys()) {
    if (type.equals(XSDIdentityConstraintCategory.UNIQUE_LITERAL) && eachKeyWrapper.getType().equals(XSDIdentityConstraintCategory.UNIQUE_LITERAL)) {
      return Messages.EntityKeyConfigComposite_ValidInfo6;
    }
    if (eachKeyWrapper.getName().equals(keyName)) {
      return Messages.bind(Messages.EntityKeyConfigComposite_ValidInfo7,keyName);
    }
  }
  return null;
}
Program: 147660
Project: 147660
Buggy source:
private void initListener2BtnRemoveField(){
  lBtnRemoveFieldListner=new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      KeyWrapper[] selectedKeys=getSelectedKeys();
      if (selectedKeys.length == 0)       return;
      FieldWrapper[] selectedFields=getSelectedFields();
      if (selectedFields.length == 0)       return;
      if (getAllFields().length == selectedFields.length) {
        MessageDialog.openWarning(getShell(),Messages.Warning,Messages.EntityKeyConfigComposite_WarningMsg);
        return;
      }
      for (      FieldWrapper eachRemovedField : selectedFields)       selectedKeys[0].removeField(eachRemovedField);
      tvFields.setInput(Arrays.asList(selectedKeys[0].getFields()));
      if (section != null)       section.autoCommit();
    }
  }
;
}

Fixed version (ground truth):
private void initListener2BtnRemoveField(){
  lBtnRemoveFieldListner=new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      KeyWrapper[] selectedKeys=getSelectedKeys();
      if (selectedKeys.length == 0) {
        return;
      }
      FieldWrapper[] selectedFields=getSelectedFields();
      if (selectedFields.length == 0) {
        return;
      }
      if (getAllFields().length == selectedFields.length) {
        MessageDialog.openWarning(getShell(),Messages.Warning,Messages.EntityKeyConfigComposite_WarningMsg);
        return;
      }
      for (      FieldWrapper eachRemovedField : selectedFields) {
        selectedKeys[0].removeField(eachRemovedField);
      }
      tvFields.setInput(Arrays.asList(selectedKeys[0].getFields()));
      if (section != null) {
        section.autoCommit();
      }
    }
  }
;
}
Program: 147661
Project: 147661
Buggy source:
public void modifyText(ModifyEvent e){
  KeyWrapper[] selectedKeys=getSelectedKeys();
  if (selectedKeys.length > 0 && selectedKeys[0].getSelector().equals(comboSelector.getText().trim()))   return;
  if (!isSelectorValid(comboSelector.getText().trim())) {
    if (selectedKeys.length > 0)     comboSelector.setText(selectedKeys[0].getSelector());
    return;
  }
  getSelectedKeys()[0].setSelector(comboSelector.getText().trim());
  if (section != null)   section.autoCommit();
}

Fixed version (ground truth):
public void modifyText(ModifyEvent e){
  KeyWrapper[] selectedKeys=getSelectedKeys();
  if (selectedKeys.length > 0 && selectedKeys[0].getSelector().equals(comboSelector.getText().trim())) {
    return;
  }
  if (!isSelectorValid(comboSelector.getText().trim())) {
    if (selectedKeys.length > 0) {
      comboSelector.setText(selectedKeys[0].getSelector());
    }
    return;
  }
  getSelectedKeys()[0].setSelector(comboSelector.getText().trim());
  if (section != null) {
    section.autoCommit();
  }
}
Program: 147662
Project: 147662
Buggy source:
private void initListener2BtnRemoveKey(){
  lBtnRemoveKeySelectionListner=new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      KeyWrapper[] selectedKeys=getSelectedKeys();
      if (selectedKeys.length == 0)       return;
      for (      KeyWrapper eachSelectedKey : selectedKeys)       entityWrapper.removeKey(eachSelectedKey);
      tvKeys.setInput(Arrays.asList(entityWrapper.getKeys()));
      selectFirstKeyInCurKeyList();
      if (section != null)       section.autoCommit();
    }
  }
;
}

Fixed version (ground truth):
private void initListener2BtnRemoveKey(){
  lBtnRemoveKeySelectionListner=new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      KeyWrapper[] selectedKeys=getSelectedKeys();
      if (selectedKeys.length == 0) {
        return;
      }
      for (      KeyWrapper eachSelectedKey : selectedKeys) {
        entityWrapper.removeKey(eachSelectedKey);
      }
      tvKeys.setInput(Arrays.asList(entityWrapper.getKeys()));
      selectFirstKeyInCurKeyList();
      if (section != null) {
        section.autoCommit();
      }
    }
  }
;
}
Program: 147663
Project: 147663
Buggy source:
private boolean isSelectorValid(String selector){
  if (selector == null || "String_Node_Str".equals(selector.trim()))   return false;
  return true;
}

Fixed version (ground truth):
private boolean isSelectorValid(String selector){
  if (selector == null || "String_Node_Str".equals(selector.trim())) {
    return false;
  }
  return true;
}
Program: 147664
Project: 147664
Buggy source:
private void initListener2BtnAddField(){
  lBtnAddFieldListener=new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      try {
        KeyWrapper[] selectedKeys=getSelectedKeys();
        if (selectedKeys.length == 0)         return;
        List<String> topChilds=getTopChildrenNames();
        List<String> fieldNames=getFieldNames(selectedKeys[0].getSourceKey());
        for (        String fdv : fieldNames) {
          if (topChilds.contains(fdv))           topChilds.remove(fdv);
        }
        SelectFieldDialog selectFieldDlg=new SelectFieldDialog(getShell(),Messages.EntityKeyConfigComposite_SelectOneField,topChilds,null);
        if (selectFieldDlg.open() != Window.OK)         return;
        if ("String_Node_Str".equals(selectFieldDlg.getField().trim()))         return;
        FieldWrapper newFieldWrapper=new FieldWrapper(selectFieldDlg.getField().trim());
        selectedKeys[0].addField(newFieldWrapper);
        tvFields.setInput(Arrays.asList(selectedKeys[0].getFields()));
        tvFields.setSelection(new StructuredSelection(newFieldWrapper));
        if (section != null)         section.autoCommit();
      }
 catch (      Exception exp) {
        log.error(exp.getMessage(),exp);
      }
    }
  }
;
}

Fixed version (ground truth):
private void initListener2BtnAddField(){
  lBtnAddFieldListener=new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      try {
        KeyWrapper[] selectedKeys=getSelectedKeys();
        if (selectedKeys.length == 0) {
          return;
        }
        List<String> topChilds=getTopChildrenNames();
        List<String> fieldNames=getFieldNames(selectedKeys[0].getSourceKey());
        for (        String fdv : fieldNames) {
          if (topChilds.contains(fdv)) {
            topChilds.remove(fdv);
          }
        }
        SelectFieldDialog selectFieldDlg=new SelectFieldDialog(getShell(),Messages.EntityKeyConfigComposite_SelectOneField,topChilds,null);
        if (selectFieldDlg.open() != Window.OK) {
          return;
        }
        if ("String_Node_Str".equals(selectFieldDlg.getField().trim())) {
          return;
        }
        FieldWrapper newFieldWrapper=new FieldWrapper(selectFieldDlg.getField().trim());
        selectedKeys[0].addField(newFieldWrapper);
        tvFields.setInput(Arrays.asList(selectedKeys[0].getFields()));
        tvFields.setSelection(new StructuredSelection(newFieldWrapper));
        if (section != null) {
          section.autoCommit();
        }
      }
 catch (      Exception exp) {
        log.error(exp.getMessage(),exp);
      }
    }
  }
;
}
Program: 147665
Project: 147665
Buggy source:
private KeyWrapper[] getSelectedKeys(){
  if (!isKeySelected())   return new KeyWrapper[0];
  List<KeyWrapper> results=new ArrayList<KeyWrapper>();
  for (  Object eachSelectedObj : ((IStructuredSelection)tvKeys.getSelection()).toArray()) {
    if (eachSelectedObj instanceof KeyWrapper)     results.add((KeyWrapper)eachSelectedObj);
  }
  return results.toArray(new KeyWrapper[0]);
}

Fixed version (ground truth):
private KeyWrapper[] getSelectedKeys(){
  if (!isKeySelected()) {
    return new KeyWrapper[0];
  }
  List<KeyWrapper> results=new ArrayList<KeyWrapper>();
  for (  Object eachSelectedObj : ((IStructuredSelection)tvKeys.getSelection()).toArray()) {
    if (eachSelectedObj instanceof KeyWrapper) {
      results.add((KeyWrapper)eachSelectedObj);
    }
  }
  return results.toArray(new KeyWrapper[0]);
}
Program: 147666
Project: 147666
Buggy source:
private void initListener2TxtKeyName(){
  lTxtKeyNameModifyListener=new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      KeyWrapper[] selectedKeys=getSelectedKeys();
      if (selectedKeys.length > 0 && selectedKeys[0].getName().equals(txtKeyName.getText().trim()))       return;
      String errMsg=isKeyNameValid(txtKeyName.getText().trim(),selectedKeys[0]);
      lblKeyNameErrIndicator.setVisible(errMsg != null);
      lblKeyNameErrIndicator.setToolTipText(errMsg == null ? "String_Node_Str" : errMsg);
      getSelectedKeys()[0].setName(txtKeyName.getText().trim());
      tvKeys.refresh();
      if (section != null)       section.autoCommit();
    }
  }
;
}

Fixed version (ground truth):
private void initListener2TxtKeyName(){
  lTxtKeyNameModifyListener=new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      KeyWrapper[] selectedKeys=getSelectedKeys();
      if (selectedKeys.length > 0 && selectedKeys[0].getName().equals(txtKeyName.getText().trim())) {
        return;
      }
      String errMsg=isKeyNameValid(txtKeyName.getText().trim(),selectedKeys[0]);
      lblKeyNameErrIndicator.setVisible(errMsg != null);
      lblKeyNameErrIndicator.setToolTipText(errMsg == null ? "String_Node_Str" : errMsg);
      getSelectedKeys()[0].setName(txtKeyName.getText().trim());
      tvKeys.refresh();
      if (section != null) {
        section.autoCommit();
      }
    }
  }
;
}