nus-yam/ex-repair huggingface dataset:
Program: 124153
Project: 124153
Buggy source:
private void refresh(){
  ProxyRepositoryFactory repositoryFactory=ProxyRepositoryFactory.getInstance();
  Project[] projects=null;
  try {
    projects=repositoryFactory.readProject();
  }
 catch (  PersistenceException e1) {
    ExceptionHandler.process(e1);
  }
catch (  BusinessException e1) {
    ExceptionHandler.process(e1);
  }
  projectList.removeAll();
  projectsMap.clear();
  if (projects != null) {
    for (int i=0; i < projects.length; i++) {
      Project pro=projects[i];
      projectList.add(pro.getLabel());
      projectsMap.put(pro.getTechnicalLabel(),pro);
      sortProjects();
      enableOpenAndDelete(true);
    }
  }
  try {
    setStatusArea();
  }
 catch (  PersistenceException e1) {
    ExceptionHandler.process(e1);
  }
}

Fixed version (ground truth):
private void refresh(){
  ProxyRepositoryFactory repositoryFactory=ProxyRepositoryFactory.getInstance();
  Project[] projects=null;
  try {
    projects=repositoryFactory.readProject();
  }
 catch (  PersistenceException e1) {
    ExceptionHandler.process(e1);
  }
catch (  BusinessException e1) {
    ExceptionHandler.process(e1);
  }
  projectList.removeAll();
  projectsMap.clear();
  if (projects != null) {
    for (int i=0; i < projects.length; i++) {
      Project pro=projects[i];
      convertorMapper.put(pro.getTechnicalLabel(),pro.getLabel());
      projectList.add(convertorMapper.get(pro.getTechnicalLabel()));
      projectsMap.put(pro.getTechnicalLabel(),pro);
      sortProjects();
      enableOpenAndDelete(true);
    }
  }
  try {
    setStatusArea();
  }
 catch (  PersistenceException e1) {
    ExceptionHandler.process(e1);
  }
}
Program: 124155
Project: 124155
Buggy source:
public static long StringToLong(String strIn){
  if (null == strIn || strIn.length() == 0)   return -1l;
  return Long.valueOf(strIn);
}

Fixed version (ground truth):
public static long StringToLong(String strIn){
  if (null == strIn || strIn.length() == 0)   return -1l;
  if (strIn.length() > 18) {
    strIn=strIn.substring(0,18);
  }
  return Long.valueOf(strIn);
}
Program: 124159
Project: 124159
Buggy source:
@Override public void notifyChanged(Notification notification){
  if (notification.getEventType() != Notification.REMOVING_ADAPTER) {
    int featureID=notification.getFeatureID(Properties.class);
    if (featureID == PropertiesPackage.PROPERTY__INFORMATIONS) {
      return;
    }
 else     if (featureID == PropertiesPackage.PROPERTY__MAX_INFORMATION_LEVEL) {
      updateTitleImage();
      return;
    }
    if (Display.getCurrent() != null) {
      propertyIsDirty=true;
      firePropertyChange(IEditorPart.PROP_DIRTY);
    }
  }
}

Fixed version (ground truth):
@Override public void notifyChanged(Notification notification){
  Object oldValue=notification.getOldValue();
  Object newValue=notification.getNewValue();
  boolean changed=(newValue == null && oldValue != null) || (newValue != null && !newValue.equals(oldValue));
  if (notification.getEventType() != Notification.REMOVING_ADAPTER && changed) {
    int featureID=notification.getFeatureID(Properties.class);
    if (featureID == PropertiesPackage.PROPERTY__INFORMATIONS) {
      return;
    }
 else     if (featureID == PropertiesPackage.PROPERTY__MAX_INFORMATION_LEVEL) {
      updateTitleImage();
      return;
    }
    if (Display.getCurrent() != null) {
      propertyIsDirty=true;
      firePropertyChange(IEditorPart.PROP_DIRTY);
    }
  }
}
Program: 124160
Project: 124160
Buggy source:
@Override public void notifyChanged(Notification notification){
  if (notification.getEventType() != Notification.REMOVING_ADAPTER) {
    propertyIsDirty=true;
    Display.getDefault().syncExec(new Runnable(){
      public void run(){
        firePropertyChange(IEditorPart.PROP_DIRTY);
      }
    }
);
  }
}

Fixed version (ground truth):
@Override public void notifyChanged(Notification notification){
  Object oldValue=notification.getOldValue();
  Object newValue=notification.getNewValue();
  boolean changed=(newValue == null && oldValue != null) || (newValue != null && !newValue.equals(oldValue));
  if (notification.getEventType() != Notification.REMOVING_ADAPTER && changed) {
    propertyIsDirty=true;
    Display.getDefault().syncExec(new Runnable(){
      public void run(){
        firePropertyChange(IEditorPart.PROP_DIRTY);
      }
    }
);
  }
}
Program: 124161
Project: 124161
Buggy source:
public void advanced(){
  stackLayout.topControl=tosLoginComposite;
  base.layout();
  Project[] projectCollection=tosLoginComposite.readProject();
  for (int i=0; i < projectCollection.length; i++) {
    tosLoginComposite.getProjectList().add(projectCollection[i].getLabel().toUpperCase());
    tosLoginComposite.getProjectMap().put(projectCollection[i].getLabel().toUpperCase(),projectCollection[i]);
    try {
      tosLoginComposite.setStatusArea();
    }
 catch (    PersistenceException e) {
      ExceptionHandler.process(e);
    }
  }
  if (tosLoginComposite.getProjectList().getItemCount() > 0) {
    tosLoginComposite.getProjectList().select(0);
    tosLoginComposite.enableOpenAndDelete(true);
  }
}

Fixed version (ground truth):
public void advanced(){
  stackLayout.topControl=tosLoginComposite;
  base.layout();
  Project[] projectCollection=tosLoginComposite.readProject();
  for (int i=0; i < projectCollection.length; i++) {
    tosLoginComposite.getProjectList().add(projectCollection[i].getLabel());
    tosLoginComposite.getProjectMap().put(projectCollection[i].getLabel().toUpperCase(),projectCollection[i]);
    tosLoginComposite.getConvertorMap().put(projectCollection[i].getLabel().toUpperCase(),projectCollection[i].getLabel());
    try {
      tosLoginComposite.setStatusArea();
    }
 catch (    PersistenceException e) {
      ExceptionHandler.process(e);
    }
  }
  if (tosLoginComposite.getProjectList().getItemCount() > 0) {
    tosLoginComposite.getProjectList().select(0);
    tosLoginComposite.enableOpenAndDelete(true);
  }
}
Program: 124162
Project: 124162
Buggy source:
private void refresh(){
  ProxyRepositoryFactory repositoryFactory=ProxyRepositoryFactory.getInstance();
  Project[] projects=null;
  try {
    projects=repositoryFactory.readProject();
  }
 catch (  PersistenceException e1) {
    ExceptionHandler.process(e1);
  }
catch (  BusinessException e1) {
    ExceptionHandler.process(e1);
  }
  projectList.removeAll();
  projectsMap.clear();
  if (projects != null) {
    for (int i=0; i < projects.length; i++) {
      Project pro=projects[i];
      projectList.add(pro.getLabel());
      projectsMap.put(pro.getTechnicalLabel(),pro);
      sortProjects();
      enableOpenAndDelete(true);
    }
  }
  try {
    setStatusArea();
  }
 catch (  PersistenceException e1) {
    ExceptionHandler.process(e1);
  }
}

Fixed version (ground truth):
private void refresh(){
  ProxyRepositoryFactory repositoryFactory=ProxyRepositoryFactory.getInstance();
  Project[] projects=null;
  try {
    projects=repositoryFactory.readProject();
  }
 catch (  PersistenceException e1) {
    ExceptionHandler.process(e1);
  }
catch (  BusinessException e1) {
    ExceptionHandler.process(e1);
  }
  projectList.removeAll();
  projectsMap.clear();
  if (projects != null) {
    for (int i=0; i < projects.length; i++) {
      Project pro=projects[i];
      convertorMapper.put(pro.getTechnicalLabel(),pro.getLabel());
      projectList.add(convertorMapper.get(pro.getTechnicalLabel()));
      projectsMap.put(pro.getTechnicalLabel(),pro);
      sortProjects();
      enableOpenAndDelete(true);
    }
  }
  try {
    setStatusArea();
  }
 catch (  PersistenceException e1) {
    ExceptionHandler.process(e1);
  }
}
Program: 124168
Project: 124168
Buggy source:
@Override public void notifyChanged(Notification notification){
  if (notification.getEventType() != Notification.REMOVING_ADAPTER) {
    int featureID=notification.getFeatureID(Properties.class);
    if (featureID == PropertiesPackage.PROPERTY__INFORMATIONS) {
      return;
    }
 else     if (featureID == PropertiesPackage.PROPERTY__MAX_INFORMATION_LEVEL) {
      updateTitleImage();
      return;
    }
    if (Display.getCurrent() != null) {
      propertyIsDirty=true;
      firePropertyChange(IEditorPart.PROP_DIRTY);
    }
  }
}

Fixed version (ground truth):
@Override public void notifyChanged(Notification notification){
  Object oldValue=notification.getOldValue();
  Object newValue=notification.getNewValue();
  boolean changed=(newValue == null && oldValue != null) || (newValue != null && !newValue.equals(oldValue));
  if (notification.getEventType() != Notification.REMOVING_ADAPTER && changed) {
    int featureID=notification.getFeatureID(Properties.class);
    if (featureID == PropertiesPackage.PROPERTY__INFORMATIONS) {
      return;
    }
 else     if (featureID == PropertiesPackage.PROPERTY__MAX_INFORMATION_LEVEL) {
      updateTitleImage();
      return;
    }
    if (Display.getCurrent() != null) {
      propertyIsDirty=true;
      firePropertyChange(IEditorPart.PROP_DIRTY);
    }
  }
}
Program: 124169
Project: 124169
Buggy source:
@Override public void notifyChanged(Notification notification){
  if (notification.getEventType() != Notification.REMOVING_ADAPTER) {
    propertyIsDirty=true;
    Display.getDefault().syncExec(new Runnable(){
      public void run(){
        firePropertyChange(IEditorPart.PROP_DIRTY);
      }
    }
);
  }
}

Fixed version (ground truth):
@Override public void notifyChanged(Notification notification){
  Object oldValue=notification.getOldValue();
  Object newValue=notification.getNewValue();
  boolean changed=(newValue == null && oldValue != null) || (newValue != null && !newValue.equals(oldValue));
  if (notification.getEventType() != Notification.REMOVING_ADAPTER && changed) {
    propertyIsDirty=true;
    Display.getDefault().syncExec(new Runnable(){
      public void run(){
        firePropertyChange(IEditorPart.PROP_DIRTY);
      }
    }
);
  }
}
Program: 124170
Project: 124170
Buggy source:
private void refresh(){
  ProxyRepositoryFactory repositoryFactory=ProxyRepositoryFactory.getInstance();
  Project[] projects=null;
  try {
    projects=repositoryFactory.readProject();
  }
 catch (  PersistenceException e1) {
    ExceptionHandler.process(e1);
  }
catch (  BusinessException e1) {
    ExceptionHandler.process(e1);
  }
  projectList.removeAll();
  projectsMap.clear();
  if (projects != null) {
    for (int i=0; i < projects.length; i++) {
      Project pro=projects[i];
      projectList.add(pro.getTechnicalLabel());
      projectsMap.put(pro.getTechnicalLabel(),pro);
      sortProjects();
      enableOpenAndDelete(true);
    }
  }
  try {
    setStatusArea();
  }
 catch (  PersistenceException e1) {
    ExceptionHandler.process(e1);
  }
}

Fixed version (ground truth):
private void refresh(){
  ProxyRepositoryFactory repositoryFactory=ProxyRepositoryFactory.getInstance();
  Project[] projects=null;
  try {
    projects=repositoryFactory.readProject();
  }
 catch (  PersistenceException e1) {
    ExceptionHandler.process(e1);
  }
catch (  BusinessException e1) {
    ExceptionHandler.process(e1);
  }
  projectList.removeAll();
  projectsMap.clear();
  if (projects != null) {
    for (int i=0; i < projects.length; i++) {
      Project pro=projects[i];
      projectList.add(pro.getLabel());
      projectsMap.put(pro.getTechnicalLabel(),pro);
      sortProjects();
      enableOpenAndDelete(true);
    }
  }
  try {
    setStatusArea();
  }
 catch (  PersistenceException e1) {
    ExceptionHandler.process(e1);
  }
}
Program: 124172
Project: 124172
Buggy source:
private void addWsdlNeedLib(RoutineItem routineItem){
  List<IMPORTType> wsdlNeedImport=new ArrayList<IMPORTType>();
  IMPORTType type1=ComponentFactory.eINSTANCE.createIMPORTType();
  type1.setMODULE("String_Node_Str");
  type1.setREQUIRED(true);
  type1.setNAME(routineItem.getProperty().getLabel());
  wsdlNeedImport.add(type1);
  IMPORTType type2=ComponentFactory.eINSTANCE.createIMPORTType();
  type2.setMODULE("String_Node_Str");
  type2.setREQUIRED(true);
  type2.setNAME(routineItem.getProperty().getLabel());
  wsdlNeedImport.add(type2);
  routineItem.getImports().addAll(wsdlNeedImport);
  try {
    CorePlugin.getDefault().getProxyRepositoryFactory().save(routineItem);
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
  CorePlugin.getDefault().getLibrariesService().resetModulesNeeded();
}

Fixed version (ground truth):
private void addWsdlNeedLib(RoutineItem routineItem){
  List<IMPORTType> wsdlNeedImport=new ArrayList<IMPORTType>();
  IMPORTType type1=ComponentFactory.eINSTANCE.createIMPORTType();
  type1.setMODULE("String_Node_Str");
  type1.setREQUIRED(true);
  type1.setNAME(routineItem.getProperty().getLabel());
  wsdlNeedImport.add(type1);
  IMPORTType type2=ComponentFactory.eINSTANCE.createIMPORTType();
  type2.setMODULE("String_Node_Str");
  type2.setREQUIRED(true);
  type2.setNAME(routineItem.getProperty().getLabel());
  wsdlNeedImport.add(type2);
  routineItem.getImports().addAll(wsdlNeedImport);
  try {
    CorePlugin.getDefault().getProxyRepositoryFactory().save(routineItem);
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
  CorePlugin.getDefault().getLibrariesService().resetModulesNeeded();
  CorePlugin.getDefault().getRunProcessService().updateLibraries(new HashSet<String>(),null);
}
Program: 124173
Project: 124173
Buggy source:
private void refresh(){
  ProxyRepositoryFactory repositoryFactory=ProxyRepositoryFactory.getInstance();
  Project[] projects=null;
  try {
    projects=repositoryFactory.readProject();
  }
 catch (  PersistenceException e1) {
    ExceptionHandler.process(e1);
  }
catch (  BusinessException e1) {
    ExceptionHandler.process(e1);
  }
  projectList.removeAll();
  projectsMap.clear();
  if (projects != null) {
    for (int i=0; i < projects.length; i++) {
      Project pro=projects[i];
      projectList.add(pro.getTechnicalLabel());
      projectsMap.put(pro.getTechnicalLabel(),pro);
      sortProjects();
      enableOpenAndDelete(true);
    }
  }
  try {
    setStatusArea();
  }
 catch (  PersistenceException e1) {
    ExceptionHandler.process(e1);
  }
}

Fixed version (ground truth):
private void refresh(){
  ProxyRepositoryFactory repositoryFactory=ProxyRepositoryFactory.getInstance();
  Project[] projects=null;
  try {
    projects=repositoryFactory.readProject();
  }
 catch (  PersistenceException e1) {
    ExceptionHandler.process(e1);
  }
catch (  BusinessException e1) {
    ExceptionHandler.process(e1);
  }
  projectList.removeAll();
  projectsMap.clear();
  if (projects != null) {
    for (int i=0; i < projects.length; i++) {
      Project pro=projects[i];
      projectList.add(pro.getLabel());
      projectsMap.put(pro.getTechnicalLabel(),pro);
      sortProjects();
      enableOpenAndDelete(true);
    }
  }
  try {
    setStatusArea();
  }
 catch (  PersistenceException e1) {
    ExceptionHandler.process(e1);
  }
}
Program: 124181
Project: 124181
Buggy source:
public void selectionChanged(SelectionChangedEvent event){
  int[] selectionIndices=tableViewerForEntries.getTable().getSelectionIndices();
  if (selectionIndices.length > 0) {
    selectThisDataMapTableView();
    onSelectedEntries(event.getSelection(),selectionIndices);
  }
}

Fixed version (ground truth):
public void selectionChanged(SelectionChangedEvent event){
  int[] selectionIndices=tableViewerForEntries.getTable().getSelectionIndices();
  if (selectionIndices.length > 0) {
    selectThisDataMapTableView();
    onSelectedEntries(event.getSelection(),selectionIndices);
    MetadataTableEditorView metadataTableEditorView=null;
    if (getZone() == Zone.INPUTS) {
      metadataTableEditorView=mapperManager.getUiManager().getInputMetaEditorView();
    }
 else     if (getZone() == Zone.OUTPUTS) {
      metadataTableEditorView=mapperManager.getUiManager().getOutputMetaEditorView();
    }
    if (metadataTableEditorView != null) {
      metadataTableEditorView.getTableViewerCreator().refresh();
    }
  }
}
Program: 124184
Project: 124184
Buggy source:
public void selectionChanged(SelectionChangedEvent event){
  int[] selectionIndices=tableViewerForEntries.getTable().getSelectionIndices();
  if (selectionIndices.length > 0) {
    selectThisDataMapTableView();
    onSelectedEntries(event.getSelection(),selectionIndices);
  }
}

Fixed version (ground truth):
public void selectionChanged(SelectionChangedEvent event){
  int[] selectionIndices=tableViewerForEntries.getTable().getSelectionIndices();
  if (selectionIndices.length > 0) {
    selectThisDataMapTableView();
    onSelectedEntries(event.getSelection(),selectionIndices);
    MetadataTableEditorView metadataTableEditorView=null;
    if (getZone() == Zone.INPUTS) {
      metadataTableEditorView=mapperManager.getUiManager().getInputMetaEditorView();
    }
 else     if (getZone() == Zone.OUTPUTS) {
      metadataTableEditorView=mapperManager.getUiManager().getOutputMetaEditorView();
    }
    if (metadataTableEditorView != null) {
      metadataTableEditorView.getTableViewerCreator().refresh();
    }
  }
}
Program: 124186
Project: 124186
Buggy source:
@Override public boolean hasReadOnlyMetadataColumns(){
  boolean hasReadOnlyMetadataColumns=false;
  IOConnection connection=getConnection();
  if (connection != null) {
    INode source=connection.getSource();
    if (source != null) {
      hasReadOnlyMetadataColumns=connection.isReadOnly() || !connection.isActivate() || source.isReadOnly()|| !source.isActivate();
      if (!hasReadOnlyMetadataColumns) {
        for (        IElementParameter param : source.getElementParameters()) {
          if (param.getFieldType() == EParameterFieldType.SCHEMA_TYPE) {
            if (param.isReadOnly()) {
              hasReadOnlyMetadataColumns=true;
              break;
            }
          }
        }
      }
    }
  }
  return hasReadOnlyMetadataColumns;
}

Fixed version (ground truth):
@Override public boolean hasReadOnlyMetadataColumns(){
  boolean hasReadOnlyMetadataColumns=false;
  IOConnection connection=getConnection();
  if (connection != null) {
    INode source=connection.getSource();
    if (source != null) {
      hasReadOnlyMetadataColumns=connection.isReadOnly() || !connection.isActivate() || source.isReadOnly();
      if (!hasReadOnlyMetadataColumns) {
        for (        IElementParameter param : source.getElementParameters()) {
          if (param.getFieldType() == EParameterFieldType.SCHEMA_TYPE) {
            if (param.isReadOnly()) {
              hasReadOnlyMetadataColumns=true;
              break;
            }
          }
        }
      }
    }
  }
  return hasReadOnlyMetadataColumns;
}
Program: 124187
Project: 124187
Buggy source:
@Override public boolean hasReadOnlyMetadataColumns(){
  boolean hasReadOnlyMetadataColumns=false;
  IOConnection connection=getConnection();
  if (connection != null) {
    INode target=connection.getTarget();
    if (target != null) {
      hasReadOnlyMetadataColumns=connection.isReadOnly() || !connection.isActivate() || target.isReadOnly()|| !target.isActivate();
      if (!hasReadOnlyMetadataColumns) {
        for (        IElementParameter param : target.getElementParameters()) {
          if (param.getFieldType() == EParameterFieldType.SCHEMA_TYPE) {
            if (param.isReadOnly()) {
              hasReadOnlyMetadataColumns=true;
              break;
            }
          }
        }
      }
    }
  }
  return hasReadOnlyMetadataColumns;
}

Fixed version (ground truth):
@Override public boolean hasReadOnlyMetadataColumns(){
  boolean hasReadOnlyMetadataColumns=false;
  IOConnection connection=getConnection();
  if (connection != null) {
    INode target=connection.getTarget();
    if (target != null) {
      hasReadOnlyMetadataColumns=connection.isReadOnly() || target.isReadOnly() || connection.getTable().isReadOnly();
      if (!hasReadOnlyMetadataColumns) {
        for (        IElementParameter param : target.getElementParameters()) {
          if (param.getFieldType() == EParameterFieldType.SCHEMA_TYPE) {
            if (param.isReadOnly()) {
              hasReadOnlyMetadataColumns=true;
              break;
            }
          }
        }
      }
    }
  }
  return hasReadOnlyMetadataColumns;
}
Program: 124188
Project: 124188
Buggy source:
@Override public boolean hasReadOnlyMetadataColumns(){
  boolean hasReadOnlyMetadataColumns=false;
  IOConnection connection=getConnection();
  if (connection != null) {
    INode source=connection.getSource();
    if (source != null) {
      hasReadOnlyMetadataColumns=connection.isReadOnly() || !connection.isActivate() || source.isReadOnly()|| !source.isActivate();
      if (!hasReadOnlyMetadataColumns) {
        for (        IElementParameter param : source.getElementParameters()) {
          if (param.getFieldType() == EParameterFieldType.SCHEMA_TYPE) {
            if (param.isReadOnly()) {
              hasReadOnlyMetadataColumns=true;
              break;
            }
          }
        }
      }
    }
  }
  return hasReadOnlyMetadataColumns;
}

Fixed version (ground truth):
@Override public boolean hasReadOnlyMetadataColumns(){
  boolean hasReadOnlyMetadataColumns=false;
  IOConnection connection=getConnection();
  if (connection != null) {
    INode source=connection.getSource();
    if (source != null) {
      hasReadOnlyMetadataColumns=connection.isReadOnly() || !connection.isActivate() || source.isReadOnly();
      if (!hasReadOnlyMetadataColumns) {
        for (        IElementParameter param : source.getElementParameters()) {
          if (param.getFieldType() == EParameterFieldType.SCHEMA_TYPE) {
            if (param.isReadOnly()) {
              hasReadOnlyMetadataColumns=true;
              break;
            }
          }
        }
      }
    }
  }
  return hasReadOnlyMetadataColumns;
}
Program: 124189
Project: 124189
Buggy source:
@Override public boolean hasReadOnlyMetadataColumns(){
  boolean hasReadOnlyMetadataColumns=false;
  IOConnection connection=getConnection();
  if (connection != null) {
    INode target=connection.getTarget();
    if (target != null) {
      hasReadOnlyMetadataColumns=connection.isReadOnly() || !connection.isActivate() || target.isReadOnly()|| !target.isActivate();
      if (!hasReadOnlyMetadataColumns) {
        for (        IElementParameter param : target.getElementParameters()) {
          if (param.getFieldType() == EParameterFieldType.SCHEMA_TYPE) {
            if (param.isReadOnly()) {
              hasReadOnlyMetadataColumns=true;
              break;
            }
          }
        }
      }
    }
  }
  return hasReadOnlyMetadataColumns;
}

Fixed version (ground truth):
@Override public boolean hasReadOnlyMetadataColumns(){
  boolean hasReadOnlyMetadataColumns=false;
  IOConnection connection=getConnection();
  if (connection != null) {
    INode target=connection.getTarget();
    if (target != null) {
      hasReadOnlyMetadataColumns=connection.isReadOnly() || target.isReadOnly() || connection.getTable().isReadOnly();
      if (!hasReadOnlyMetadataColumns) {
        for (        IElementParameter param : target.getElementParameters()) {
          if (param.getFieldType() == EParameterFieldType.SCHEMA_TYPE) {
            if (param.isReadOnly()) {
              hasReadOnlyMetadataColumns=true;
              break;
            }
          }
        }
      }
    }
  }
  return hasReadOnlyMetadataColumns;
}
Program: 124190
Project: 124190
Buggy source:
/** 
 * Getter for targetExecutionTabItem.
 * @return the targetExecutionTabItem
 */
protected static RunProcessContext getProcessContext(){
  return processContext;
}

Fixed version (ground truth):
/** 
 * Getter for targetExecutionTabItem.
 * @return the targetExecutionTabItem
 */
public static RunProcessContext getProcessContext(){
  return processContext;
}
Program: 124191
Project: 124191
Buggy source:
/** 
 * Getter for targetExecutionTabItem.
 * @return the targetExecutionTabItem
 */
protected static RunProcessContext getProcessContext(){
  return processContext;
}

Fixed version (ground truth):
/** 
 * Getter for targetExecutionTabItem.
 * @return the targetExecutionTabItem
 */
public static RunProcessContext getProcessContext(){
  return processContext;
}
Program: 124192
Project: 124192
Buggy source:
/** 
 * DOC dev Comment method "createHeaderComposite".
 * @param parent a TabItem 's Control
 * @param tabItem a TabItem
 */
private void createHeaderComposite(Composite parent,CTabItem tabItem){
  int labelStyle=SWT.WRAP | SWT.MULTI;
  Text tmpLabel=new Text(parent,labelStyle);
  tmpLabel.setText(TextUtil.removeLineBreaks(sqlExecution.getSqlStatement()));
  tmpLabel.setLayoutData(new FillLayout());
  int parentWidth=this.getClientArea().width;
  Point idealSize=tmpLabel.computeSize(parentWidth - 30,SWT.DEFAULT);
  if (idealSize.y > 60) {
    labelStyle=SWT.WRAP | SWT.MULTI | SWT.V_SCROLL;
  }
  tmpLabel.dispose();
  Composite headerComposite=new Composite(parent,SWT.FILL);
  headerComposite.setLayoutData(new GridData(SWT.FILL,SWT.TOP,true,false));
  GridLayout hLayout=new GridLayout();
  hLayout.numColumns=2;
  hLayout.marginLeft=0;
  hLayout.horizontalSpacing=0;
  hLayout.verticalSpacing=0;
  hLayout.marginWidth=0;
  hLayout.marginHeight=0;
  headerComposite.setLayout(hLayout);
  Text label=new Text(headerComposite,labelStyle);
  label.setEditable(false);
  label.setBackground(this.getBackground());
  label.setText(TextUtil.removeLineBreaks(sqlExecution.getSqlStatement()));
  label.setToolTipText(TextUtil.getWrappedText(sqlExecution.getSqlStatement()));
  GridData labelGridData=new GridData(SWT.FILL,SWT.TOP,true,true);
  label.setLayoutData(labelGridData);
  label.setVisible(true);
  ToolBarManager toolBarMgr=new ToolBarManager(SWT.FLAT);
  toolBarMgr.createControl(headerComposite);
  toolBarMgr.add(new CloseSQLResultTabAction(tabItem));
  toolBarMgr.update(true);
  GridData gid=new GridData();
  gid.horizontalAlignment=SWT.RIGHT;
  gid.verticalAlignment=SWT.TOP;
  toolBarMgr.getControl().setLayoutData(gid);
}

Fixed version (ground truth):
/** 
 * DOC dev Comment method "createHeaderComposite".
 * @param parent a TabItem 's Control
 * @param tabItem a TabItem
 */
private void createHeaderComposite(Composite parent,CTabItem tabItem){
  Composite headerComposite=new Composite(parent,SWT.FILL);
  headerComposite.setLayoutData(new GridData(SWT.FILL,SWT.TOP,true,false));
  GridLayout hLayout=new GridLayout();
  hLayout.numColumns=2;
  hLayout.marginLeft=0;
  hLayout.horizontalSpacing=0;
  hLayout.verticalSpacing=0;
  hLayout.marginWidth=0;
  hLayout.marginHeight=0;
  headerComposite.setLayout(hLayout);
  Text label=new Text(headerComposite,SWT.H_SCROLL);
  label.setEditable(false);
  label.setBackground(this.getBackground());
  label.setText(TextUtil.removeLineBreaks(sqlExecution.getSqlStatement()));
  label.setToolTipText(TextUtil.getWrappedText(sqlExecution.getSqlStatement()));
  GridData labelGridData=new GridData(SWT.FILL,SWT.TOP,true,true);
  label.setLayoutData(labelGridData);
  label.setVisible(true);
  ToolBarManager toolBarMgr=new ToolBarManager(SWT.FLAT);
  toolBarMgr.createControl(headerComposite);
  toolBarMgr.add(new CloseSQLResultTabAction(tabItem));
  toolBarMgr.update(true);
  GridData gid=new GridData();
  gid.horizontalAlignment=SWT.RIGHT;
  gid.verticalAlignment=SWT.TOP;
  toolBarMgr.getControl().setLayoutData(gid);
}
Program: 124194
Project: 124194
Buggy source:
public void selectionChanged(SelectionChangedEvent event){
  int[] selectionIndices=tableViewerForEntries.getTable().getSelectionIndices();
  if (selectionIndices.length > 0) {
    selectThisDataMapTableView();
    onSelectedEntries(event.getSelection(),selectionIndices);
  }
}

Fixed version (ground truth):
public void selectionChanged(SelectionChangedEvent event){
  int[] selectionIndices=tableViewerForEntries.getTable().getSelectionIndices();
  if (selectionIndices.length > 0) {
    selectThisDataMapTableView();
    onSelectedEntries(event.getSelection(),selectionIndices);
    MetadataTableEditorView metadataTableEditorView=null;
    if (getZone() == Zone.INPUTS) {
      metadataTableEditorView=mapperManager.getUiManager().getInputMetaEditorView();
    }
 else     if (getZone() == Zone.OUTPUTS) {
      metadataTableEditorView=mapperManager.getUiManager().getOutputMetaEditorView();
    }
    if (metadataTableEditorView != null) {
      metadataTableEditorView.getTableViewerCreator().refresh();
    }
  }
}
Program: 124195
Project: 124195
Buggy source:
private void onSelectedEntries(IStructuredSelection selection,AbstractInOutTree selectedTree){
  EList<? extends TreeNode> nodes=null;
  if (selectedTree instanceof InputXmlTree) {
    nodes=((InputXmlTree)selectedTree).getNodes();
  }
 else {
    nodes=((OutputXmlTree)selectedTree).getNodes();
  }
  List<Integer> selectionIndices=new ArrayList<Integer>();
  Iterator iterator=selection.iterator();
  while (iterator.hasNext()) {
    Object obj=iterator.next();
    if (obj instanceof TreeNodeEditPart) {
      TreeNode model=(TreeNode)((TreeNodeEditPart)obj).getModel();
      if (model.eContainer() == selectedTree) {
        selectionIndices.add(nodes.indexOf(model));
      }
    }
  }
  int selections[]=new int[selectionIndices.size()];
  for (int i=0; i < selectionIndices.size(); i++) {
    selections[i]=selectionIndices.get(i);
  }
  MetadataTableEditorView metaEditorView=null;
  if (selectedTree instanceof InputXmlTree) {
    metaEditorView=mapperUI.getTabFolderEditors().getInputMetaEditorView();
  }
 else {
    metaEditorView=mapperUI.getTabFolderEditors().getOutputMetaEditorView();
  }
  metaEditorView.getExtendedTableViewer().getTableViewerCreator().getSelectionHelper().setSelection(selections);
}

Fixed version (ground truth):
private void onSelectedEntries(IStructuredSelection selection,AbstractInOutTree selectedTree){
  EList<? extends TreeNode> nodes=null;
  if (selectedTree instanceof InputXmlTree) {
    nodes=((InputXmlTree)selectedTree).getNodes();
  }
 else {
    nodes=((OutputXmlTree)selectedTree).getNodes();
  }
  List<Integer> selectionIndices=new ArrayList<Integer>();
  Iterator iterator=selection.iterator();
  while (iterator.hasNext()) {
    Object obj=iterator.next();
    if (obj instanceof TreeNodeEditPart) {
      TreeNode model=(TreeNode)((TreeNodeEditPart)obj).getModel();
      if (model.eContainer() == selectedTree) {
        selectionIndices.add(nodes.indexOf(model));
      }
    }
  }
  int selections[]=new int[selectionIndices.size()];
  for (int i=0; i < selectionIndices.size(); i++) {
    selections[i]=selectionIndices.get(i);
  }
  MetadataTableEditorView metaEditorView=null;
  if (selectedTree instanceof InputXmlTree) {
    metaEditorView=mapperUI.getTabFolderEditors().getInputMetaEditorView();
  }
 else {
    metaEditorView=mapperUI.getTabFolderEditors().getOutputMetaEditorView();
  }
  if (metaEditorView != null) {
    metaEditorView.getTableViewerCreator().refresh();
  }
  metaEditorView.getExtendedTableViewer().getTableViewerCreator().getSelectionHelper().setSelection(selections);
}
Program: 124197
Project: 124197
Buggy source:
public void selectionChanged(SelectionChangedEvent event){
  int[] selectionIndices=tableViewerForEntries.getTable().getSelectionIndices();
  if (selectionIndices.length > 0) {
    selectThisDataMapTableView();
    onSelectedEntries(event.getSelection(),selectionIndices);
  }
}

Fixed version (ground truth):
public void selectionChanged(SelectionChangedEvent event){
  int[] selectionIndices=tableViewerForEntries.getTable().getSelectionIndices();
  if (selectionIndices.length > 0) {
    selectThisDataMapTableView();
    onSelectedEntries(event.getSelection(),selectionIndices);
    MetadataTableEditorView metadataTableEditorView=null;
    if (getZone() == Zone.INPUTS) {
      metadataTableEditorView=mapperManager.getUiManager().getInputMetaEditorView();
    }
 else     if (getZone() == Zone.OUTPUTS) {
      metadataTableEditorView=mapperManager.getUiManager().getOutputMetaEditorView();
    }
    if (metadataTableEditorView != null) {
      metadataTableEditorView.getTableViewerCreator().refresh();
    }
  }
}
Program: 124198
Project: 124198
Buggy source:
private void onSelectedEntries(IStructuredSelection selection,AbstractInOutTree selectedTree){
  EList<? extends TreeNode> nodes=null;
  if (selectedTree instanceof InputXmlTree) {
    nodes=((InputXmlTree)selectedTree).getNodes();
  }
 else {
    nodes=((OutputXmlTree)selectedTree).getNodes();
  }
  List<Integer> selectionIndices=new ArrayList<Integer>();
  Iterator iterator=selection.iterator();
  while (iterator.hasNext()) {
    Object obj=iterator.next();
    if (obj instanceof TreeNodeEditPart) {
      TreeNode model=(TreeNode)((TreeNodeEditPart)obj).getModel();
      if (model.eContainer() == selectedTree) {
        selectionIndices.add(nodes.indexOf(model));
      }
    }
  }
  int selections[]=new int[selectionIndices.size()];
  for (int i=0; i < selectionIndices.size(); i++) {
    selections[i]=selectionIndices.get(i);
  }
  MetadataTableEditorView metaEditorView=null;
  if (selectedTree instanceof InputXmlTree) {
    metaEditorView=mapperUI.getTabFolderEditors().getInputMetaEditorView();
  }
 else {
    metaEditorView=mapperUI.getTabFolderEditors().getOutputMetaEditorView();
  }
  metaEditorView.getExtendedTableViewer().getTableViewerCreator().getSelectionHelper().setSelection(selections);
}

Fixed version (ground truth):
private void onSelectedEntries(IStructuredSelection selection,AbstractInOutTree selectedTree){
  EList<? extends TreeNode> nodes=null;
  if (selectedTree instanceof InputXmlTree) {
    nodes=((InputXmlTree)selectedTree).getNodes();
  }
 else {
    nodes=((OutputXmlTree)selectedTree).getNodes();
  }
  List<Integer> selectionIndices=new ArrayList<Integer>();
  Iterator iterator=selection.iterator();
  while (iterator.hasNext()) {
    Object obj=iterator.next();
    if (obj instanceof TreeNodeEditPart) {
      TreeNode model=(TreeNode)((TreeNodeEditPart)obj).getModel();
      if (model.eContainer() == selectedTree) {
        selectionIndices.add(nodes.indexOf(model));
      }
    }
  }
  int selections[]=new int[selectionIndices.size()];
  for (int i=0; i < selectionIndices.size(); i++) {
    selections[i]=selectionIndices.get(i);
  }
  MetadataTableEditorView metaEditorView=null;
  if (selectedTree instanceof InputXmlTree) {
    metaEditorView=mapperUI.getTabFolderEditors().getInputMetaEditorView();
  }
 else {
    metaEditorView=mapperUI.getTabFolderEditors().getOutputMetaEditorView();
  }
  if (metaEditorView != null) {
    metaEditorView.getTableViewerCreator().refresh();
  }
  metaEditorView.getExtendedTableViewer().getTableViewerCreator().getSelectionHelper().setSelection(selections);
}
Program: 124200
Project: 124200
Buggy source:
/** 
 * Parse the XML file. Buffer the result in LoopEntry.
 * @param is InputStream
 */
public void parse(java.io.InputStream is,String charset){
  this.charset=charset;
  try {
    DefaultHandler hd=null;
    SAXParser saxParser=SAXParserFactory.newInstance().newSAXParser();
    if (rootPath == null || rootPath.equals("String_Node_Str")) {
      hd=newHandler();
    }
 else {
      hd=newHandler2();
    }
    org.xml.sax.InputSource inSource=new org.xml.sax.InputSource(is);
    inSource.setEncoding(this.charset);
    saxParser.parse(is,hd);
  }
 catch (  ParserConfigurationException e) {
    e.printStackTrace();
  }
catch (  SAXException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Parse the XML file. Buffer the result in LoopEntry.
 * @param is InputStream
 */
public void parse(java.io.InputStream is,String charset){
  this.charset=charset;
  try {
    DefaultHandler hd=null;
    SAXParser saxParser=SAXParserFactory.newInstance().newSAXParser();
    if (rootPath == null || rootPath.equals("String_Node_Str")) {
      hd=newHandler();
    }
 else {
      hd=newHandler2();
    }
    saxParser.setProperty("String_Node_Str",hd);
    org.xml.sax.InputSource inSource=new org.xml.sax.InputSource(is);
    inSource.setEncoding(this.charset);
    saxParser.parse(is,hd);
  }
 catch (  ParserConfigurationException e) {
    e.printStackTrace();
  }
catch (  SAXException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 124201
Project: 124201
Buggy source:
public void register(DefaultHandler handler){
  handlerList.add(handler);
}

Fixed version (ground truth):
public void register(DefaultHandler2 handler){
  handlerList.add(handler);
}
Program: 124202
Project: 124202
Buggy source:
/** 
 * Deal with the bug 4402: the content <quotes_encoded>&quot;hello world&quot;</quotes_encoded>. In this case, "characters" will be called three time. first: " second: hello world third: "
 */
public void characters(char ch[],int start,int length) throws SAXException {
  if (isLooping) {
    String text=new String(ch,start,length);
    if (text.length() > 0) {
      if (outputText) {
        for (        int indexOfColumn : indexOfColumns) {
          if (indexOfColumn >= 0 && !currentRowHaveValue[indexOfColumn]) {
            if (currentRow[indexOfColumn] == null) {
              currentRow[indexOfColumn]=text;
            }
 else {
              currentRow[indexOfColumn]+=text;
            }
          }
        }
      }
      if (this.entry.hasFunctions()) {
        Map<String,Object> map=new HashMap<String,Object>();
        map.put("String_Node_Str",loopPath);
        map.put("String_Node_Str",currentPath);
        map.put("String_Node_Str",text);
        listArgs.add(map);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Deal with the bug 4402: the content <quotes_encoded>&quot;hello world&quot;</quotes_encoded>. In this case, "characters" will be called three time. first: " second: hello world third: "
 */
public void characters(char ch[],int start,int length) throws SAXException {
  if (isLooping) {
    String text=new String(ch,start,length);
    if (text.length() > 0) {
      for (int i=0; i < selectColumns.size(); i++) {
        if (outputTexts[i] && !currentRowHaveValue[i]) {
          if (this.asXMLs.get(i) && !inCDATA) {
            text=escapeEntityHelper.escapeElementEntities(text);
          }
          if (currentRow[i] == null) {
            currentRow[i]=text;
          }
 else {
            currentRow[i]+=text;
          }
        }
      }
      if (this.entry.hasFunctions()) {
        Map<String,Object> map=new HashMap<String,Object>();
        map.put("String_Node_Str",loopPath);
        map.put("String_Node_Str",currentPath);
        map.put("String_Node_Str",text);
        listArgs.add(map);
      }
    }
  }
}
Program: 124207
Project: 124207
Buggy source:
private void updateStatus(){
  final MapperSettingModel defaultModel=settingsManager.getDefaultModel();
  if (defaultModel.isDieOnError() == dieOnErrorButton.getSelection()) {
    dieOnErrorButton.setBackground(null);
  }
 else {
    dieOnErrorButton.setBackground(color);
  }
  if (defaultModel.isLookInParallel() == lookupInParallelButton.getSelection()) {
    lookupInParallelButton.setBackground(null);
  }
 else {
    lookupInParallelButton.setBackground(color);
  }
  if (defaultModel.getTempDataDir().equals(directoryField.getText())) {
    directoryField.getTextControl().setBackground(null);
    directoryField.setToolTipText(null);
  }
 else {
    directoryField.getTextControl().setBackground(color);
    directoryField.setToolTipText("String_Node_Str");
  }
  if (defaultModel.getRowBufferSize().equals(sizeField.getText())) {
    sizeField.getTextControl().setBackground(null);
    sizeField.setToolTipText(null);
  }
 else {
    sizeField.getTextControl().setBackground(color);
    sizeField.setToolTipText("String_Node_Str");
  }
}

Fixed version (ground truth):
private void updateStatus(){
  final MapperSettingModel defaultModel=settingsManager.getDefaultModel();
  if (defaultModel.isDieOnError() == dieOnErrorButton.getSelection()) {
    dieOnErrorButton.setBackground(null);
  }
 else {
    dieOnErrorButton.setBackground(color);
  }
  if (defaultModel.isLookInParallel() == lookupInParallelButton.getSelection()) {
    lookupInParallelButton.setBackground(null);
  }
 else {
    lookupInParallelButton.setBackground(color);
  }
  if (defaultModel.getTempDataDir().equals(directoryField.getText())) {
    directoryField.getTextControl().setBackground(null);
    directoryField.setToolTipText(null);
  }
 else {
    if (directoryField.getText() != null && !directoryField.getText().startsWith(QUOTATION_MARK) && !directoryField.getText().endsWith(QUOTATION_MARK)) {
      directoryField.setText(TalendQuoteUtils.addQuotesIfNotExist(directoryField.getText()));
    }
    directoryField.getTextControl().setBackground(color);
    directoryField.setToolTipText("String_Node_Str");
  }
  if (defaultModel.getRowBufferSize().equals(sizeField.getText())) {
    sizeField.getTextControl().setBackground(null);
    sizeField.setToolTipText(null);
  }
 else {
    sizeField.getTextControl().setBackground(color);
    sizeField.setToolTipText("String_Node_Str");
  }
}
Program: 124208
Project: 124208
Buggy source:
private void updateStatus(){
  final MapperSettingModel defaultModel=settingsManager.getDefaultModel();
  if (defaultModel.isDieOnError() == dieOnErrorButton.getSelection()) {
    dieOnErrorButton.setBackground(null);
  }
 else {
    dieOnErrorButton.setBackground(color);
  }
  if (defaultModel.isLookInParallel() == lookupInParallelButton.getSelection()) {
    lookupInParallelButton.setBackground(null);
  }
 else {
    lookupInParallelButton.setBackground(color);
  }
  if (defaultModel.getTempDataDir().equals(directoryField.getText())) {
    directoryField.getTextControl().setBackground(null);
    directoryField.setToolTipText(null);
  }
 else {
    directoryField.getTextControl().setBackground(color);
    directoryField.setToolTipText("String_Node_Str");
  }
  if (defaultModel.getRowBufferSize().equals(sizeField.getText())) {
    sizeField.getTextControl().setBackground(null);
    sizeField.setToolTipText(null);
  }
 else {
    sizeField.getTextControl().setBackground(color);
    sizeField.setToolTipText("String_Node_Str");
  }
}

Fixed version (ground truth):
private void updateStatus(){
  final MapperSettingModel defaultModel=settingsManager.getDefaultModel();
  if (defaultModel.isDieOnError() == dieOnErrorButton.getSelection()) {
    dieOnErrorButton.setBackground(null);
  }
 else {
    dieOnErrorButton.setBackground(color);
  }
  if (defaultModel.isLookInParallel() == lookupInParallelButton.getSelection()) {
    lookupInParallelButton.setBackground(null);
  }
 else {
    lookupInParallelButton.setBackground(color);
  }
  if (defaultModel.getTempDataDir().equals(directoryField.getText())) {
    directoryField.getTextControl().setBackground(null);
    directoryField.setToolTipText(null);
  }
 else {
    if (directoryField.getText() != null && !directoryField.getText().startsWith(QUOTATION_MARK) && !directoryField.getText().endsWith(QUOTATION_MARK)) {
      directoryField.setText(TalendQuoteUtils.addQuotesIfNotExist(directoryField.getText()));
    }
    directoryField.getTextControl().setBackground(color);
    directoryField.setToolTipText("String_Node_Str");
  }
  if (defaultModel.getRowBufferSize().equals(sizeField.getText())) {
    sizeField.getTextControl().setBackground(null);
    sizeField.setToolTipText(null);
  }
 else {
    sizeField.getTextControl().setBackground(color);
    sizeField.setToolTipText("String_Node_Str");
  }
}
Program: 124210
Project: 124210
Buggy source:
@Override public Object[] getChildren(Object parent){
  RepositoryNode repositoryNode=((RepositoryNode)parent);
  ERepositoryObjectType objectType=repositoryNode.getObjectType();
  if (objectType != null) {
    if (objectType == ERepositoryObjectType.METADATA_CONNECTIONS || objectType == ERepositoryObjectType.METADATA_FILE_BRMS || objectType == ERepositoryObjectType.METADATA_FILE_DELIMITED || objectType == ERepositoryObjectType.METADATA_FILE_EBCDIC || objectType == ERepositoryObjectType.METADATA_FILE_EXCEL || objectType == ERepositoryObjectType.METADATA_FILE_FTP || objectType == ERepositoryObjectType.METADATA_FILE_HL7 || objectType == ERepositoryObjectType.METADATA_FILE_LDIF || objectType == ERepositoryObjectType.METADATA_FILE_POSITIONAL || objectType == ERepositoryObjectType.METADATA_FILE_REGEXP || objectType == ERepositoryObjectType.METADATA_FILE_XML) {
      return new Object[0];
    }
  }
  if (!repositoryNode.isInitialized()) {
    if (repositoryNode.getParent() instanceof ProjectRepositoryNode) {
      ((ProjectRepositoryNode)repositoryNode.getParent()).initializeChildren(parent);
    }
    repositoryNode.setInitialized(true);
  }
  return repositoryNode.getChildren().toArray();
}

Fixed version (ground truth):
@Override public Object[] getChildren(Object parent){
  RepositoryNode repositoryNode=((RepositoryNode)parent);
  ERepositoryObjectType objectType=repositoryNode.getObjectType();
  if (objectType != null) {
    if (objectType == ERepositoryObjectType.METADATA_CONNECTIONS || objectType == ERepositoryObjectType.METADATA_FILE_BRMS || objectType == ERepositoryObjectType.METADATA_FILE_DELIMITED || objectType == ERepositoryObjectType.METADATA_FILE_EBCDIC || objectType == ERepositoryObjectType.METADATA_FILE_EXCEL || objectType == ERepositoryObjectType.METADATA_FILE_FTP || objectType == ERepositoryObjectType.METADATA_FILE_HL7 || objectType == ERepositoryObjectType.METADATA_FILE_LDIF || objectType == ERepositoryObjectType.METADATA_FILE_POSITIONAL || objectType == ERepositoryObjectType.METADATA_FILE_REGEXP || objectType == ERepositoryObjectType.METADATA_FILE_XML || objectType == ERepositoryObjectType.METADATA_GENERIC_SCHEMA) {
      return new Object[0];
    }
  }
  if (!repositoryNode.isInitialized()) {
    if (repositoryNode.getParent() instanceof ProjectRepositoryNode) {
      ((ProjectRepositoryNode)repositoryNode.getParent()).initializeChildren(parent);
    }
    repositoryNode.setInitialized(true);
  }
  return repositoryNode.getChildren().toArray();
}
Program: 124215
Project: 124215
Buggy source:
/** 
 * Parse the XML file. Buffer the result in LoopEntry.
 * @param is InputStream
 */
public void parse(java.io.InputStream is,String charset){
  this.charset=charset;
  try {
    DefaultHandler hd=null;
    SAXParser saxParser=SAXParserFactory.newInstance().newSAXParser();
    if (rootPath == null || rootPath.equals("String_Node_Str")) {
      hd=newHandler();
    }
 else {
      hd=newHandler2();
    }
    org.xml.sax.InputSource inSource=new org.xml.sax.InputSource(is);
    inSource.setEncoding(this.charset);
    saxParser.parse(is,hd);
  }
 catch (  ParserConfigurationException e) {
    e.printStackTrace();
  }
catch (  SAXException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Parse the XML file. Buffer the result in LoopEntry.
 * @param is InputStream
 */
public void parse(java.io.InputStream is,String charset){
  this.charset=charset;
  try {
    DefaultHandler hd=null;
    SAXParser saxParser=SAXParserFactory.newInstance().newSAXParser();
    if (rootPath == null || rootPath.equals("String_Node_Str")) {
      hd=newHandler();
    }
 else {
      hd=newHandler2();
    }
    saxParser.setProperty("String_Node_Str",hd);
    org.xml.sax.InputSource inSource=new org.xml.sax.InputSource(is);
    inSource.setEncoding(this.charset);
    saxParser.parse(is,hd);
  }
 catch (  ParserConfigurationException e) {
    e.printStackTrace();
  }
catch (  SAXException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 124216
Project: 124216
Buggy source:
public void register(DefaultHandler handler){
  handlerList.add(handler);
}

Fixed version (ground truth):
public void register(DefaultHandler2 handler){
  handlerList.add(handler);
}