nus-yam/ex-repair huggingface dataset:
Program: 138625
Project: 138625
Buggy source:
/** 
 * DOC bZhou Comment method "getOutputType".
 * @param tag
 * @param element
 * @return
 */
public static String getOutputType(Report report){
  TaggedValue taggedValue=TaggedValueHelper.getTaggedValue(TaggedValueHelper.OUTPUT_TYPE_TAG,report.getTaggedValue());
  if (taggedValue == null) {
    return "String_Node_Str";
  }
  return taggedValue.getValue();
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getOutputType".
 * @param tag
 * @param element
 * @return
 */
public static String getOutputType(Report report){
  TaggedValue taggedValue=TaggedValueHelper.getTaggedValue(TaggedValueHelper.OUTPUT_TYPE_TAG,report.getTaggedValue());
  if (taggedValue == null || taggedValue.getValue() == null) {
    return "String_Node_Str";
  }
  return taggedValue.getValue();
}
Program: 138626
Project: 138626
Buggy source:
public void handleEvent(Event event){
  int columnIndex=getColumnIndex(table,column);
  TableItem[] items=table.getItems();
  for (int i=1; i < items.length - 1; i++) {
    String value2=items[i].getText(columnIndex);
    for (int j=0; j < i; j++) {
      String value1=items[j].getText(columnIndex);
      boolean isLessThan=true;
      if (StringUtils.isNumeric(value2) && StringUtils.isNumeric(value1)) {
        isLessThan=Long.valueOf(value2).compareTo(Long.valueOf(value1)) < 0;
      }
 else {
        isLessThan=comparator.compare(value2,value1) < 0;
      }
      if ((isAscend && isLessThan) || (!isAscend && !isLessThan)) {
        String[] values=getTableItemText(table,items[i]);
        Object obj=items[i].getData();
        items[i].dispose();
        TableItem item=new TableItem(table,SWT.NONE,j);
        item.setText(values);
        item.setData(obj);
        items=table.getItems();
        break;
      }
    }
  }
  table.setSortColumn(column);
  table.setSortDirection((isAscend ? SWT.UP : SWT.DOWN));
  isAscend=!isAscend;
}

Fixed version (ground truth):
public void handleEvent(Event event){
  int columnIndex=getColumnIndex(table,column);
  TableItem[] items=table.getItems();
  int length="String_Node_Str".equals(items[items.length - 1].getText(columnIndex)) ? items.length - 1 : items.length;
  for (int i=1; i < length; i++) {
    String value2=items[i].getText(columnIndex);
    for (int j=0; j < i; j++) {
      String value1=items[j].getText(columnIndex);
      boolean isLessThan=true;
      if (StringUtils.isNumeric(value2) && StringUtils.isNumeric(value1)) {
        isLessThan=Long.valueOf(value2).compareTo(Long.valueOf(value1)) < 0;
      }
 else {
        isLessThan=comparator.compare(value2,value1) < 0;
      }
      if ((isAscend && isLessThan) || (!isAscend && !isLessThan)) {
        String[] values=getTableItemText(table,items[i]);
        Object obj=items[i].getData();
        items[i].dispose();
        TableItem item=new TableItem(table,SWT.NONE,j);
        item.setText(values);
        item.setData(obj);
        items=table.getItems();
        break;
      }
    }
  }
  table.setSortColumn(column);
  table.setSortDirection((isAscend ? SWT.UP : SWT.DOWN));
  isAscend=!isAscend;
}
Program: 138627
Project: 138627
Buggy source:
private void addSorter(final Table table,final TableColumn column){
  column.addListener(SWT.Selection,new Listener(){
    boolean isAscend=true;
    Collator comparator=Collator.getInstance(Locale.getDefault());
    public void handleEvent(    Event event){
      int columnIndex=getColumnIndex(table,column);
      TableItem[] items=table.getItems();
      for (int i=1; i < items.length - 1; i++) {
        String value2=items[i].getText(columnIndex);
        for (int j=0; j < i; j++) {
          String value1=items[j].getText(columnIndex);
          boolean isLessThan=true;
          if (StringUtils.isNumeric(value2) && StringUtils.isNumeric(value1)) {
            isLessThan=Long.valueOf(value2).compareTo(Long.valueOf(value1)) < 0;
          }
 else {
            isLessThan=comparator.compare(value2,value1) < 0;
          }
          if ((isAscend && isLessThan) || (!isAscend && !isLessThan)) {
            String[] values=getTableItemText(table,items[i]);
            Object obj=items[i].getData();
            items[i].dispose();
            TableItem item=new TableItem(table,SWT.NONE,j);
            item.setText(values);
            item.setData(obj);
            items=table.getItems();
            break;
          }
        }
      }
      table.setSortColumn(column);
      table.setSortDirection((isAscend ? SWT.UP : SWT.DOWN));
      isAscend=!isAscend;
    }
  }
);
}

Fixed version (ground truth):
private void addSorter(final Table table,final TableColumn column){
  column.addListener(SWT.Selection,new Listener(){
    boolean isAscend=true;
    Collator comparator=Collator.getInstance(Locale.getDefault());
    public void handleEvent(    Event event){
      int columnIndex=getColumnIndex(table,column);
      TableItem[] items=table.getItems();
      int length="String_Node_Str".equals(items[items.length - 1].getText(columnIndex)) ? items.length - 1 : items.length;
      for (int i=1; i < length; i++) {
        String value2=items[i].getText(columnIndex);
        for (int j=0; j < i; j++) {
          String value1=items[j].getText(columnIndex);
          boolean isLessThan=true;
          if (StringUtils.isNumeric(value2) && StringUtils.isNumeric(value1)) {
            isLessThan=Long.valueOf(value2).compareTo(Long.valueOf(value1)) < 0;
          }
 else {
            isLessThan=comparator.compare(value2,value1) < 0;
          }
          if ((isAscend && isLessThan) || (!isAscend && !isLessThan)) {
            String[] values=getTableItemText(table,items[i]);
            Object obj=items[i].getData();
            items[i].dispose();
            TableItem item=new TableItem(table,SWT.NONE,j);
            item.setText(values);
            item.setData(obj);
            items=table.getItems();
            break;
          }
        }
      }
      table.setSortColumn(column);
      table.setSortDirection((isAscend ? SWT.UP : SWT.DOWN));
      isAscend=!isAscend;
    }
  }
);
}
Program: 138628
Project: 138628
Buggy source:
/** 
 * DOC bZhou Comment method "save". Save a model element and update the related property.
 * @param element
 * @param withProperty
 * @return
 */
public ReturnCode save(ModelElement element,boolean... withProperty){
  ReturnCode rc=new ReturnCode();
  addDependencies(element);
  addResourceContent(element);
  rc.setOk(util.saveResource(element.eResource()));
  updateProperty(element);
  if (rc.isOk()) {
    rc.setMessage("String_Node_Str" + element.getName() + "String_Node_Str");
    notifyResourceChanges();
  }
 else {
    rc.setMessage(util.getLastErrorMessage());
  }
  return rc;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "save". Save a model element and update the related property.
 * @param element
 * @param withProperty
 * @return
 */
public ReturnCode save(ModelElement element,boolean withProperty){
  ReturnCode rc=new ReturnCode();
  addDependencies(element);
  addResourceContent(element);
  rc.setOk(util.saveResource(element.eResource()));
  if (withProperty) {
    updateProperty(element);
  }
  if (rc.isOk()) {
    rc.setMessage("String_Node_Str" + element.getName() + "String_Node_Str");
    notifyResourceChanges();
  }
 else {
    rc.setMessage(util.getLastErrorMessage());
  }
  return rc;
}
Program: 138629
Project: 138629
Buggy source:
@Override protected void notifyResourceChanges(){
  ProxyRepositoryManager.getInstance().save(Boolean.FALSE);
}

Fixed version (ground truth):
@Override protected void notifyResourceChanges(){
  ProxyRepositoryManager.getInstance().save(Boolean.TRUE);
}
Program: 138630
Project: 138630
Buggy source:
@SuppressWarnings("String_Node_Str") protected void createCopyedProvider(){
  if (oldDataProvider.eIsProxy()) {
    ResourceSet resourceSet=ProxyRepositoryFactory.getInstance().getRepositoryFactoryFromProvider().getResourceManager().resourceSet;
    oldDataProvider=(Connection)EcoreUtil.resolve(oldDataProvider,resourceSet);
  }
  IFile selectedFile=WorkspaceUtils.getModelElementResource(oldDataProvider);
  IFile createNeedReloadElementsFile=DQStructureComparer.getNeedReloadElementsFile();
  IFile copyedFile=DQStructureComparer.copyedToDestinationFile(selectedFile,createNeedReloadElementsFile);
  TypedReturnCode<Connection> returnValue=DqRepositoryViewService.readFromFile(copyedFile);
  copyedDataProvider=returnValue.getObject();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") protected void createCopyedProvider(){
  IFile selectedFile=WorkspaceUtils.getModelElementResource(oldDataProvider);
  IFile createNeedReloadElementsFile=DQStructureComparer.getNeedReloadElementsFile();
  IFile copyedFile=DQStructureComparer.copyedToDestinationFile(selectedFile,createNeedReloadElementsFile);
  TypedReturnCode<Connection> returnValue=DqRepositoryViewService.readFromFile(copyedFile);
  copyedDataProvider=returnValue.getObject();
}
Program: 138631
Project: 138631
Buggy source:
/** 
 * Compare the old selected object with reload object(rightResource), and updated the content of old selected object.
 * @param rightResource
 * @return
 * @throws ReloadCompareException
 */
protected boolean compareWithReloadObject() throws ReloadCompareException {
  MatchModel match=null;
  try {
    if (oldDataProvider.eIsProxy()) {
      ResourceSet resourceSet=ProxyRepositoryFactory.getInstance().getRepositoryFactoryFromProvider().getResourceManager().resourceSet;
      oldDataProvider=(Connection)EcoreUtil.resolve(oldDataProvider,resourceSet);
    }
    match=MatchService.doMatch(oldDataProvider,getSavedReloadObject(),options);
  }
 catch (  InterruptedException e) {
    log.error(e,e);
    return false;
  }
  final DiffModel diff=DiffService.doDiff(match);
  EList<DiffElement> ownedElements=diff.getOwnedElements();
  for (  DiffElement de : ownedElements) {
    EList<DiffElement> subDiffElements=de.getSubDiffElements();
    for (    DiffElement difElement : subDiffElements) {
      handleDiffPackageElement(difElement);
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Compare the old selected object with reload object(rightResource), and updated the content of old selected object.
 * @param rightResource
 * @return
 * @throws ReloadCompareException
 */
protected boolean compareWithReloadObject() throws ReloadCompareException {
  MatchModel match=null;
  try {
    match=MatchService.doMatch(oldDataProvider,getSavedReloadObject(),options);
  }
 catch (  InterruptedException e) {
    log.error(e,e);
    return false;
  }
  final DiffModel diff=DiffService.doDiff(match);
  EList<DiffElement> ownedElements=diff.getOwnedElements();
  for (  DiffElement de : ownedElements) {
    EList<DiffElement> subDiffElements=de.getSubDiffElements();
    for (    DiffElement difElement : subDiffElements) {
      handleDiffPackageElement(difElement);
    }
  }
  return true;
}
Program: 138632
Project: 138632
Buggy source:
private int compareColumnValue(DataSetRow m1,DataSetRow m2,int depth){
  if (depth >= _priorities.length)   return 0;
  int columnNumber=_priorities[depth];
  int direction=_directions[columnNumber];
  int result=0;
  Object o1=m1.getPrettyObjectValue(columnNumber);
  Object o2=m2.getPrettyObjectValue(columnNumber);
  if (o1 == null || o2 == null) {
    if (o1 == null && o2 != null) {
      result=1;
    }
 else     if (o1 != null && o2 == null) {
      result=-1;
    }
 else {
      result=0;
    }
    if (result == 0) {
      return compareColumnValue(m1,m2,depth + 1);
    }
    if (direction == SWT.DOWN) {
      return result * -1;
    }
    return result;
  }
  if (o1 instanceof Comparable && o2 instanceof Comparable)   result=((Comparable)o1).compareTo((Comparable)o2);
  if (result == 0)   return compareColumnValue(m1,m2,depth + 1);
  if (direction == SWT.DOWN) {
    return result * -1;
  }
  return result;
}

Fixed version (ground truth):
private int compareColumnValue(DataSetRow m1,DataSetRow m2,int depth){
  if (depth >= _priorities.length)   return 0;
  int columnNumber=_priorities[depth];
  int direction=_directions[columnNumber];
  int result=0;
  Object o1=m1.getPrettyObjectValue(columnNumber);
  Object o2=m2.getPrettyObjectValue(columnNumber);
  if ("String_Node_Str".equals(o1) || "String_Node_Str".equals(o2)) {
    if ("String_Node_Str".equals(o1) && !"String_Node_Str".equals(o2)) {
      result=1;
    }
 else     if (!"String_Node_Str".equals(o1) && "String_Node_Str".equals(o2)) {
      result=-1;
    }
 else {
      result=0;
    }
    if (result == 0) {
      return compareColumnValue(m1,m2,depth + 1);
    }
    if (direction == SWT.DOWN) {
      return result * -1;
    }
    return result;
  }
  if (o1 instanceof Comparable && o2 instanceof Comparable)   result=((Comparable)o1).compareTo((Comparable)o2);
  if (result == 0)   return compareColumnValue(m1,m2,depth + 1);
  if (direction == SWT.DOWN) {
    return result * -1;
  }
  return result;
}
Program: 138635
Project: 138635
Buggy source:
public static List<IRepositoryViewObject> fetchAllDBRepositoryViewObjects(Boolean paramBoolean){
  ArrayList localArrayList=new ArrayList();
  localArrayList.addAll(getDBConnectionInstance().fetchRepositoryViewObjects(paramBoolean.booleanValue(),true));
  return localArrayList;
}

Fixed version (ground truth):
public static List<IRepositoryViewObject> fetchAllDBRepositoryViewObjects(Boolean reload,boolean withDelete){
  List<IRepositoryViewObject> dbReposViewObjs=new ArrayList<IRepositoryViewObject>();
  dbReposViewObjs.addAll(getDBConnectionInstance().fetchRepositoryViewObjects(reload,withDelete));
  return dbReposViewObjs;
}
Program: 138636
Project: 138636
Buggy source:
public static List<IRepositoryViewObject> fetchAllRepositoryViewObjects(Boolean paramBoolean){
  ArrayList localArrayList=new ArrayList();
  localArrayList.addAll(getDBConnectionInstance().fetchRepositoryViewObjects(paramBoolean.booleanValue(),true));
  localArrayList.addAll(getMDMConnectionInstance().fetchRepositoryViewObjects(paramBoolean.booleanValue(),true));
  return localArrayList;
}

Fixed version (ground truth):
/** 
 * DOC mzhao Fetch all repository view objects, database, mdm, file etc.
 * @param true1
 */
public static List<IRepositoryViewObject> fetchAllRepositoryViewObjects(Boolean reload,boolean withDelete){
  List<IRepositoryViewObject> reposViewObjs=new ArrayList<IRepositoryViewObject>();
  reposViewObjs.addAll(getDBConnectionInstance().fetchRepositoryViewObjects(reload,withDelete));
  reposViewObjs.addAll(getMDMConnectionInstance().fetchRepositoryViewObjects(reload,withDelete));
  return reposViewObjs;
}
Program: 138637
Project: 138637
Buggy source:
public static List<IRepositoryViewObject> fetchRepositoryViewObjectsByFolder(boolean paramBoolean,ERepositoryObjectType paramERepositoryObjectType,IPath paramIPath){
  if (paramERepositoryObjectType == ERepositoryObjectType.METADATA_CONNECTIONS)   return getDBConnectionInstance().fetchRepositoryViewObjectsByFolder(paramBoolean,paramERepositoryObjectType,paramIPath,true);
  if (paramERepositoryObjectType == ERepositoryObjectType.METADATA_MDMCONNECTION)   return getMDMConnectionInstance().fetchRepositoryViewObjectsByFolder(paramBoolean,paramERepositoryObjectType,paramIPath,true);
  return new ArrayList();
}

Fixed version (ground truth):
public static List<IRepositoryViewObject> fetchRepositoryViewObjectsByFolder(boolean reload,ERepositoryObjectType itemType,IPath path,boolean withDelete){
  if (itemType == ERepositoryObjectType.METADATA_CONNECTIONS) {
    return getDBConnectionInstance().fetchRepositoryViewObjectsByFolder(reload,itemType,path,withDelete);
  }
 else   if (itemType == ERepositoryObjectType.METADATA_MDMCONNECTION) {
    return getMDMConnectionInstance().fetchRepositoryViewObjectsByFolder(reload,itemType,path,withDelete);
  }
  return new ArrayList<IRepositoryViewObject>();
}
Program: 138638
Project: 138638
Buggy source:
/** 
 * DOC xqliu IndicatorSelectDialog constructor comment.
 * @param parentShell
 * @param title
 * @param modelElementIndicators
 * @deprecated
 */
public IndicatorSelectDialog(Shell parentShell,String title,ModelElementIndicator[] modelElementIndicators){
  this(parentShell,title,modelElementIndicators,null);
  Object editorPart=CorePlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
  if (editorPart instanceof AnalysisEditor) {
    AnalysisEditor analyEditor=(AnalysisEditor)editorPart;
    if (analyEditor.getMasterPage() instanceof ColumnMasterDetailsPage) {
      this.language=ExecutionLanguage.get(((ColumnMasterDetailsPage)analyEditor.getMasterPage()).getExecCombo().getText());
      DataManager connection=((ColumnMasterDetailsPage)analyEditor.getMasterPage()).getAnalysis().getContext().getConnection();
      this.dbms=DbmsLanguageFactory.createDbmsLanguage(connection);
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC xqliu IndicatorSelectDialog constructor comment.
 * @param parentShell
 * @param title
 * @param modelElementIndicators
 * @deprecated
 */
public IndicatorSelectDialog(Shell parentShell,String title,ModelElementIndicator[] modelElementIndicators){
  this(parentShell,title,modelElementIndicators,null);
  Object editorPart=CorePlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
  if (editorPart instanceof AnalysisEditor) {
    AnalysisEditor analyEditor=(AnalysisEditor)editorPart;
    if (analyEditor.getMasterPage() instanceof ColumnMasterDetailsPage) {
      this.language=ExecutionLanguage.get(((ColumnMasterDetailsPage)analyEditor.getMasterPage()).getExecCombo().getText());
      DataManager connection=((ColumnMasterDetailsPage)analyEditor.getMasterPage()).getAnalysis().getContext().getConnection();
      if (connection == null && modelElementIndicators.length > 0) {
        ModelElement modleElement=modelElementIndicators[0].getModelElement();
        connection=ModelElementHelper.getTdDataProvider(modleElement);
      }
      this.dbms=DbmsLanguageFactory.createDbmsLanguage(connection);
    }
  }
}
Program: 138639
Project: 138639
Buggy source:
/** 
 * Method "fillListOfCatalogs" gets the list of catalogs only when the list is empty. When the list is not empty, no call is executed to the connection.
 * @param connection
 * @param catalogNames the list of catalogs of the given connection
 * @throws SQLException
 */
private static void fillListOfCatalogs(java.sql.Connection connection,List<String> catalogNames) throws SQLException {
  if (catalogNames.isEmpty()) {
    ResultSet catalogSet=null;
    if (!(ConnectionUtils.isOdbcOracle(connection) || ConnectionUtils.isOdbcIngres(connection))) {
      catalogSet=getConnectionMetadata(connection).getCatalogs();
    }
    try {
      if (catalogSet != null) {
        while (catalogSet.next()) {
          String catalogName=catalogSet.getString(MetaDataConstants.TABLE_CAT.name());
          if (catalogName != null || !"String_Node_Str".equals(catalogName)) {
            catalogNames.add(catalogName);
          }
        }
      }
    }
 catch (    SQLException e) {
      log.warn("String_Node_Str",e);
    }
 finally {
      if (catalogSet != null) {
        catalogSet.close();
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Method "fillListOfCatalogs" gets the list of catalogs only when the list is empty. When the list is not empty, no call is executed to the connection.
 * @param connection
 * @param catalogNames the list of catalogs of the given connection
 * @throws SQLException
 */
private static void fillListOfCatalogs(java.sql.Connection connection,List<String> catalogNames) throws SQLException {
  if (catalogNames.isEmpty()) {
    ResultSet catalogSet=null;
    if (!(ConnectionUtils.isOdbcOracle(connection) || ConnectionUtils.isOdbcIngres(connection) || ConnectionUtils.isOdbcProgress(connection))) {
      catalogSet=getConnectionMetadata(connection).getCatalogs();
    }
    try {
      if (catalogSet != null) {
        while (catalogSet.next()) {
          String catalogName=catalogSet.getString(MetaDataConstants.TABLE_CAT.name());
          if (catalogName != null || !"String_Node_Str".equals(catalogName)) {
            catalogNames.add(catalogName);
          }
        }
      }
    }
 catch (    SQLException e) {
      log.warn("String_Node_Str",e);
    }
 finally {
      if (catalogSet != null) {
        catalogSet.close();
      }
    }
  }
}
Program: 138641
Project: 138641
Buggy source:
/** 
 * Method "changeCatalog".
 * @param catalogName unquoted catalog's name
 * @param connection
 * @throws SQLException
 */
protected boolean changeCatalog(String catalogName,Connection connection){
  try {
    if (!(ConnectionUtils.isOdbcMssql(connection) || ConnectionUtils.isOdbcOracle(connection))) {
      connection.setCatalog(catalogName);
    }
    return true;
  }
 catch (  RuntimeException e) {
    return traceError("String_Node_Str" + catalogName + "String_Node_Str"+ e.getMessage());
  }
catch (  SQLException e) {
    return traceError("String_Node_Str" + catalogName + "String_Node_Str"+ e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Method "changeCatalog".
 * @param catalogName unquoted catalog's name
 * @param connection
 * @throws SQLException
 */
protected boolean changeCatalog(String catalogName,Connection connection){
  try {
    if (!(ConnectionUtils.isOdbcMssql(connection) || ConnectionUtils.isOdbcOracle(connection) || ConnectionUtils.isOdbcProgress(connection))) {
      connection.setCatalog(catalogName);
    }
    return true;
  }
 catch (  RuntimeException e) {
    return traceError("String_Node_Str" + catalogName + "String_Node_Str"+ e.getMessage());
  }
catch (  SQLException e) {
    return traceError("String_Node_Str" + catalogName + "String_Node_Str"+ e.getMessage());
  }
}
Program: 138642
Project: 138642
Buggy source:
protected boolean changeCatalog(String catalogName,Connection connection){
  try {
    connection.setCatalog(catalogName);
    return true;
  }
 catch (  RuntimeException e) {
    return traceError("String_Node_Str" + catalogName + "String_Node_Str"+ e.getMessage());
  }
catch (  SQLException e) {
    return traceError("String_Node_Str" + catalogName + "String_Node_Str"+ e.getMessage());
  }
}

Fixed version (ground truth):
protected boolean changeCatalog(String catalogName,Connection connection){
  try {
    if (!(ConnectionUtils.isOdbcMssql(connection) || ConnectionUtils.isOdbcOracle(connection) || ConnectionUtils.isOdbcProgress(connection))) {
      connection.setCatalog(catalogName);
    }
    return true;
  }
 catch (  RuntimeException e) {
    return traceError("String_Node_Str" + catalogName + "String_Node_Str"+ e.getMessage());
  }
catch (  SQLException e) {
    return traceError("String_Node_Str" + catalogName + "String_Node_Str"+ e.getMessage());
  }
}
Program: 138643
Project: 138643
Buggy source:
public static List<IRepositoryViewObject> fetchAllDBRepositoryViewObjects(Boolean reload,boolean withDelete){
  List<IRepositoryViewObject> dbReposViewObjs=new ArrayList<IRepositoryViewObject>();
  dbReposViewObjs.addAll(getDBConnectionInstance().fetchRepositoryViewObjects(reload,withDelete));
  return dbReposViewObjs;
}

Fixed version (ground truth):
public static List<IRepositoryViewObject> fetchAllDBRepositoryViewObjects(Boolean paramBoolean){
  ArrayList localArrayList=new ArrayList();
  localArrayList.addAll(getDBConnectionInstance().fetchRepositoryViewObjects(paramBoolean.booleanValue(),true));
  return localArrayList;
}
Program: 138644
Project: 138644
Buggy source:
/** 
 * DOC mzhao Fetch all repository view objects, database, mdm, file etc.
 * @param true1
 */
public static List<IRepositoryViewObject> fetchAllRepositoryViewObjects(Boolean reload,boolean withDelete){
  List<IRepositoryViewObject> reposViewObjs=new ArrayList<IRepositoryViewObject>();
  reposViewObjs.addAll(getDBConnectionInstance().fetchRepositoryViewObjects(reload,withDelete));
  reposViewObjs.addAll(getMDMConnectionInstance().fetchRepositoryViewObjects(reload,withDelete));
  return reposViewObjs;
}

Fixed version (ground truth):
public static List<IRepositoryViewObject> fetchAllRepositoryViewObjects(Boolean paramBoolean){
  ArrayList localArrayList=new ArrayList();
  localArrayList.addAll(getDBConnectionInstance().fetchRepositoryViewObjects(paramBoolean.booleanValue(),true));
  localArrayList.addAll(getMDMConnectionInstance().fetchRepositoryViewObjects(paramBoolean.booleanValue(),true));
  return localArrayList;
}
Program: 138645
Project: 138645
Buggy source:
public static List<IRepositoryViewObject> fetchRepositoryViewObjectsByFolder(boolean reload,ERepositoryObjectType itemType,IPath path,boolean withDelete){
  if (itemType == ERepositoryObjectType.METADATA_CONNECTIONS) {
    return getDBConnectionInstance().fetchRepositoryViewObjectsByFolder(reload,itemType,path,withDelete);
  }
 else   if (itemType == ERepositoryObjectType.METADATA_MDMCONNECTION) {
    return getMDMConnectionInstance().fetchRepositoryViewObjectsByFolder(reload,itemType,path,withDelete);
  }
  return new ArrayList<IRepositoryViewObject>();
}

Fixed version (ground truth):
public static List<IRepositoryViewObject> fetchRepositoryViewObjectsByFolder(boolean paramBoolean,ERepositoryObjectType paramERepositoryObjectType,IPath paramIPath){
  if (paramERepositoryObjectType == ERepositoryObjectType.METADATA_CONNECTIONS)   return getDBConnectionInstance().fetchRepositoryViewObjectsByFolder(paramBoolean,paramERepositoryObjectType,paramIPath,true);
  if (paramERepositoryObjectType == ERepositoryObjectType.METADATA_MDMCONNECTION)   return getMDMConnectionInstance().fetchRepositoryViewObjectsByFolder(paramBoolean,paramERepositoryObjectType,paramIPath,true);
  return new ArrayList();
}
Program: 138646
Project: 138646
Buggy source:
/** 
 * Method "selectCatalog" attempts to set the catalog for the current connection.
 * @param catalogName the catalog to select
 * @return true if set, false if problem
 */
public boolean selectCatalog(String catalogName){
  if (connection == null) {
    return false;
  }
  try {
    connection.setCatalog(catalogName);
    return true;
  }
 catch (  SQLException e) {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Method "selectCatalog" attempts to set the catalog for the current connection.
 * @param catalogName the catalog to select
 * @return true if set, false if problem
 */
public boolean selectCatalog(String catalogName){
  if (connection == null) {
    return false;
  }
  try {
    if (!ConnectionUtils.isOdbcProgress(connection)) {
      connection.setCatalog(catalogName);
    }
    return true;
  }
 catch (  SQLException e) {
    return false;
  }
}
Program: 138647
Project: 138647
Buggy source:
@Override protected ReturnCode executeSqlQuery(String sqlStatement) throws SQLException {
  ReturnCode ok=new ReturnCode(true);
  DataProvider dataProvider=this.getDataManager();
  if (this.elementToIndicators.values().isEmpty()) {
    String msg="String_Node_Str";
    log.error(msg);
    ok.setReturnCode(msg,false);
    return ok;
  }
  Indicator[] indics=this.getAllIndicators();
  if (indics.length == 0) {
    String msg="String_Node_Str" + dataProvider;
    log.error(msg);
    ok.setReturnCode(msg,false);
    return ok;
  }
  for (  Indicator indicator : indics) {
    SchemaIndicator schemaIndicator=DataqualitySwitchHelper.SCHEMA_SWITCH.doSwitch(indicator);
    if (schemaIndicator == null) {
      continue;
    }
    Schema schema=(Schema)schemaIndicator.getAnalyzedElement();
    String catName=schema.getName();
    if (!checkSchema(schema)) {
      ok.setReturnCode(Messages.getString("String_Node_Str",catName),false);
      return ok;
    }
    EObject container=schema.eContainer();
    if (container != null) {
      Catalog catalog=SwitchHelpers.CATALOG_SWITCH.doSwitch(container);
      if (catalog != null) {
        catName=catalog.getName();
      }
    }
    connection.setCatalog(catName);
    evalSchemaIndicLow(null,schemaIndicator,null,schema,ok);
  }
  return ok;
}

Fixed version (ground truth):
@Override protected ReturnCode executeSqlQuery(String sqlStatement) throws SQLException {
  ReturnCode ok=new ReturnCode(true);
  DataProvider dataProvider=this.getDataManager();
  if (this.elementToIndicators.values().isEmpty()) {
    String msg="String_Node_Str";
    log.error(msg);
    ok.setReturnCode(msg,false);
    return ok;
  }
  Indicator[] indics=this.getAllIndicators();
  if (indics.length == 0) {
    String msg="String_Node_Str" + dataProvider;
    log.error(msg);
    ok.setReturnCode(msg,false);
    return ok;
  }
  for (  Indicator indicator : indics) {
    SchemaIndicator schemaIndicator=DataqualitySwitchHelper.SCHEMA_SWITCH.doSwitch(indicator);
    if (schemaIndicator == null) {
      continue;
    }
    Schema schema=(Schema)schemaIndicator.getAnalyzedElement();
    String catName=schema.getName();
    if (!checkSchema(schema)) {
      ok.setReturnCode(Messages.getString("String_Node_Str",catName),false);
      return ok;
    }
    EObject container=schema.eContainer();
    if (container != null) {
      Catalog catalog=SwitchHelpers.CATALOG_SWITCH.doSwitch(container);
      if (catalog != null) {
        catName=catalog.getName();
      }
    }
    if (!ConnectionUtils.isOdbcProgress(connection)) {
      connection.setCatalog(catName);
    }
    evalSchemaIndicLow(null,schemaIndicator,null,schema,ok);
  }
  return ok;
}
Program: 138648
Project: 138648
Buggy source:
public static List<IEcosCategory> getCategoryList(String version) throws Exception {
  String jsonContent=sendGetRequest(CATEGORY_LIST_URL);
  List<IEcosCategory> categorys=parseJsonObject(jsonContent,IEcosCategory.class);
  if (categorys != null) {
    for (    IEcosCategory category : categorys) {
      ((EcosCategory)category).setVersion(version);
    }
  }
 else {
    categorys=Collections.emptyList();
  }
  return categorys;
}

Fixed version (ground truth):
public static List<IEcosCategory> getCategoryList(String version) throws Exception {
  String jsonContent=sendGetRequest(CATEGORY_LIST_URL);
  List<EcosCategory> categorys=parseJsonObject(jsonContent,EcosCategory.class);
  if (categorys != null) {
    for (    EcosCategory category : categorys) {
      ((EcosCategory)category).setVersion(version);
    }
  }
 else {
    categorys=Collections.emptyList();
  }
  List<IEcosCategory> iCategorys=new ArrayList<IEcosCategory>();
  for (  EcosCategory ecosCategory : categorys) {
    iCategorys.add(ecosCategory);
  }
  return iCategorys;
}
Program: 138649
Project: 138649
Buggy source:
/** 
 * DOC bZhou Comment method "delete".
 * @param ifile
 * @throws Exception
 */
public ReturnCode delete(IFile ifile) throws Exception {
  ReturnCode rc=new ReturnCode();
  Resource resource=getFileResource(ifile);
  List<ModelElement> dependencyClients=EObjectHelper.getDependencyClients(ifile);
  if (!dependencyClients.isEmpty()) {
    rc.setOk(false);
    rc.setMessage("String_Node_Str" + dependencyClients.get(0).getName() + "String_Node_Str");
  }
 else {
    EObjectHelper.removeDependencys(ifile);
    deleteRelated(ifile);
    String uriStr=resource.getURI().toString();
    remove(ifile);
    EMFSharedResources.getInstance().unloadResource(uriStr);
    if (ifile.isLinked()) {
      File file=new File(ifile.getRawLocation().toOSString());
      if (file.exists()) {
        file.delete();
      }
    }
    ifile.delete(true,new NullProgressMonitor());
    IFile propFile=ResourcesPlugin.getWorkspace().getRoot().getFile(ifile.getFullPath().removeFileExtension().addFileExtension(FactoriesUtil.PROPERTIES_EXTENSION));
    resource=getFileResource(propFile);
    remove(propFile);
    EMFSharedResources.getInstance().unloadResource(resource.getURI().toString());
    if (propFile.exists()) {
      propFile.delete(true,new NullProgressMonitor());
    }
    ProxyRepositoryManager.getInstance().save();
    ifile.getParent().refreshLocal(IResource.DEPTH_INFINITE,null);
    rc.setMessage("String_Node_Str");
  }
  return rc;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "delete".
 * @param ifile
 * @throws Exception
 */
public ReturnCode delete(IFile ifile) throws Exception {
  ReturnCode rc=new ReturnCode();
  Resource resource=getFileResource(ifile);
  List<ModelElement> dependencyClients=EObjectHelper.getDependencyClients(ifile);
  if (!dependencyClients.isEmpty()) {
    rc.setOk(false);
    rc.setMessage("String_Node_Str" + dependencyClients.get(0).getName() + "String_Node_Str");
  }
 else {
    EObjectHelper.removeDependencys(ifile);
    deleteRelated(ifile);
    String uriStr=resource.getURI().toString();
    remove(ifile);
    EMFSharedResources.getInstance().unloadResource(uriStr);
    if (ifile.isLinked()) {
      File file=new File(ifile.getRawLocation().toOSString());
      if (file.exists()) {
        file.delete();
      }
    }
    ifile.delete(true,new NullProgressMonitor());
    IFile propFile=ResourcesPlugin.getWorkspace().getRoot().getFile(ifile.getFullPath().removeFileExtension().addFileExtension(FactoriesUtil.PROPERTIES_EXTENSION));
    if (propFile.exists()) {
      propFile.delete(true,new NullProgressMonitor());
    }
    ProxyRepositoryManager.getInstance().save();
    ifile.getParent().refreshLocal(IResource.DEPTH_INFINITE,null);
    rc.setMessage("String_Node_Str");
  }
  return rc;
}
Program: 138651
Project: 138651
Buggy source:
@Override protected void createFormContent(IManagedForm managedForm){
  setFormTitle(DefaultMessagesImpl.getString("String_Node_Str"));
  setMetadataTitle(DefaultMessagesImpl.getString("String_Node_Str"));
  super.createFormContent(managedForm);
  metadataSection.setDescription(DefaultMessagesImpl.getString("String_Node_Str"));
  createDefinitionSection(topComp);
  if (isSystemIndicator()) {
    if (IndicatorCategoryHelper.isCorrelation(category)) {
      createAdditionalFunctionsSection(topComp);
    }
    if (this.hasCharactersMapping) {
      createCharactersMappingSection(topComp);
    }
  }
 else {
    createCategorySection(topComp);
    createDefinitionParametersSection(topComp);
  }
}

Fixed version (ground truth):
@Override protected void createFormContent(IManagedForm managedForm){
  setFormTitle(DefaultMessagesImpl.getString("String_Node_Str"));
  setMetadataTitle(DefaultMessagesImpl.getString("String_Node_Str"));
  super.createFormContent(managedForm);
  metadataSection.setDescription(DefaultMessagesImpl.getString("String_Node_Str"));
  createDefinitionSection(topComp);
  if (isSystemIndicator()) {
    if (IndicatorCategoryHelper.isCorrelation(category)) {
      createAdditionalFunctionsSection(topComp);
    }
    if (this.hasCharactersMapping) {
      createCharactersMappingSection(topComp);
    }
  }
 else {
    createCategorySection(topComp);
    createDefinitionParametersSection(topComp);
  }
  form.reflow(true);
}
Program: 138654
Project: 138654
Buggy source:
public boolean doDropValidation(DropTargetEvent event,LocalSelectionTransfer transfer){
  if (dragSelectedElement != null) {
    return true;
  }
  boolean doDropValidation=false;
  StructuredSelection selection=(StructuredSelection)transfer.getSelection();
switch (validateType) {
case COLUMN_VALIDATETYPE:
    doDropValidation=validateColumnType(selection,targetViewer);
  break;
default :
doDropValidation=true;
}
return doDropValidation;
}

Fixed version (ground truth):
public boolean doDropValidation(DropTargetEvent event,LocalSelectionTransfer transfer){
  StructuredSelection selection=(StructuredSelection)transfer.getSelection();
  if (dragSelectedElement != null && selection != null) {
    return true;
  }
  boolean doDropValidation=false;
switch (validateType) {
case COLUMN_VALIDATETYPE:
    doDropValidation=validateColumnType(selection,targetViewer);
  break;
default :
doDropValidation=true;
}
return doDropValidation;
}
Program: 138655
Project: 138655
Buggy source:
@SuppressWarnings("String_Node_Str") private boolean validateColumnType(StructuredSelection selection,TableViewer targetViewer){
  boolean isValidation=true;
  List selectionList=selection.toList();
  if (!allowDuplication) {
    List elements=(List)targetViewer.getInput();
    if (elements != null) {
      for (      Object element : elements) {
        if (selectionList.contains(element)) {
          isValidation=false;
          break;
        }
      }
    }
  }
  for (  Object obj : selectionList) {
    if (!(obj instanceof TdColumn)) {
      isValidation=false;
      break;
    }
  }
  return isValidation;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private boolean validateColumnType(StructuredSelection selection,TableViewer targetViewer){
  if (selection == null) {
    return false;
  }
  boolean isValidation=true;
  List selectionList=selection.toList();
  if (!allowDuplication) {
    List elements=(List)targetViewer.getInput();
    if (elements != null) {
      for (      Object element : elements) {
        if (selectionList.contains(element)) {
          isValidation=false;
          break;
        }
      }
    }
  }
  for (  Object obj : selectionList) {
    if (!(obj instanceof TdColumn)) {
      isValidation=false;
      break;
    }
  }
  return isValidation;
}
Program: 138657
Project: 138657
Buggy source:
@Override protected void createFormContent(IManagedForm managedForm){
  super.createFormContent(managedForm);
  form=managedForm.getForm();
  form.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  this.metadataSection.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  this.metadataSection.setDescription(DefaultMessagesImpl.getString("String_Node_Str"));
  anaColumnCompareViewer=new AnalysisColumnCompareTreeViewer((AbstractAnalysisMetadataPage)this,topComp,getColumnLeftSet(),getColumnRightSet(),DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str"),false,true);
  anaColumnCompareViewer.addPropertyChangeListener(this);
  createDataFilterSection(form,topComp);
  columnListA=anaColumnCompareViewer.getColumnListA();
  columnListB=anaColumnCompareViewer.getColumnListB();
  columnsComparisonSection=anaColumnCompareViewer.getColumnsComparisonSection();
  anaColumnCompareViewer.addPropertyChangeListener(this);
}

Fixed version (ground truth):
@Override protected void createFormContent(IManagedForm managedForm){
  super.createFormContent(managedForm);
  form=managedForm.getForm();
  form.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  this.metadataSection.setText(DefaultMessagesImpl.getString("String_Node_Str"));
  this.metadataSection.setDescription(DefaultMessagesImpl.getString("String_Node_Str"));
  anaColumnCompareViewer=new AnalysisColumnCompareTreeViewer((AbstractAnalysisMetadataPage)this,topComp,getColumnLeftSet(),getColumnRightSet(),DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str"),false,true);
  anaColumnCompareViewer.addPropertyChangeListener(this);
  createDataFilterSection(form,topComp);
  columnListA=anaColumnCompareViewer.getColumnListA();
  columnListB=anaColumnCompareViewer.getColumnListB();
  columnsComparisonSection=anaColumnCompareViewer.getColumnsComparisonSection();
  anaColumnCompareViewer.addPropertyChangeListener(this);
  form.reflow(true);
}
Program: 138658
Project: 138658
Buggy source:
/** 
 * DOC bZhou Comment method "doMigrationTask".
 * @param tasks
 * @param monitor
 */
public static void doMigrationTask(List<IMigrationTask> tasks,IProgressMonitor monitor){
  if (monitor == null) {
    monitor=new NullProgressMonitor();
  }
  monitor.beginTask("String_Node_Str",tasks.size());
  for (  IMigrationTask task : tasks) {
    if (monitor.isCanceled()) {
      break;
    }
    monitor.subTask(task.getName());
    if (task.valid()) {
      if (!task.execute()) {
        log.warn("String_Node_Str" + task.getName());
      }
 else {
        if (log.isInfoEnabled()) {
          log.info("String_Node_Str" + task.getName());
        }
        System.out.println("String_Node_Str" + task.getName());
      }
    }
    monitor.worked(1);
  }
  monitor.done();
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "doMigrationTask".
 * @param tasks
 * @param monitor
 */
public static void doMigrationTask(List<IMigrationTask> tasks,IProgressMonitor monitor){
  if (monitor == null) {
    monitor=new NullProgressMonitor();
  }
  monitor.beginTask("String_Node_Str",tasks.size());
  for (  IMigrationTask task : tasks) {
    if (monitor.isCanceled()) {
      break;
    }
    monitor.subTask(task.getName());
    if (task.valid()) {
      if (!task.execute()) {
        log.error("String_Node_Str" + task.getName());
      }
 else {
        if (log.isInfoEnabled()) {
          log.info("String_Node_Str" + task.getName());
        }
        System.out.println("String_Node_Str" + task.getName());
      }
    }
    monitor.worked(1);
  }
  monitor.done();
}
Program: 138661
Project: 138661
Buggy source:
/** 
 * DOC xqliu Comment method "getOwnedWhereRuleFiles". ADD xqliu 2009-04-30 bug 6808
 * @param tableIndicator
 * @param whereRuleFolder
 * @return
 */
private Object[] getOwnedWhereRuleFiles(TableIndicator tableIndicator,IFolder whereRuleFolder){
  ArrayList ret=new ArrayList();
  Indicator[] indicators=tableIndicator.getIndicators();
  for (  Indicator indicator : indicators) {
    Object obj=indicator.getIndicatorDefinition();
    if (obj != null && obj instanceof WhereRule) {
      WhereRule wr=(WhereRule)obj;
      ret.add(DQRuleResourceFileHelper.getInstance().getWhereRuleFile(wr,new IFolder[]{whereRuleFolder}));
    }
  }
  return ret.toArray();
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "getOwnedWhereRuleFiles". ADD xqliu 2009-04-30 bug 6808
 * @param tableIndicator
 * @param whereRuleFolder
 * @return
 */
private Object[] getOwnedWhereRuleFiles(TableIndicator tableIndicator,IFolder whereRuleFolder){
  ArrayList<IFile> ret=new ArrayList<IFile>();
  Indicator[] indicators=tableIndicator.getIndicators();
  for (  Indicator indicator : indicators) {
    Object obj=indicator.getIndicatorDefinition();
    if (obj != null && obj instanceof WhereRule) {
      WhereRule wr=(WhereRule)obj;
      ret.add(DQRuleResourceFileHelper.getInstance().getWhereRuleFile(wr,new IFolder[]{whereRuleFolder}));
    }
  }
  return ret.toArray();
}
Program: 138662
Project: 138662
Buggy source:
/** 
 * DOC rli Comment method "createResource".
 * @param file
 * @return
 */
public Resource getFileResource(IFile file){
  Resource res;
  if (exist(file)) {
    res=registedResourceMap.get(file);
  }
 else {
    URI uri=URI.createPlatformResourceURI(file.getFullPath().toString(),false);
    res=EMFSharedResources.getInstance().getResource(uri,true);
    register(file,res);
  }
  return res;
}

Fixed version (ground truth):
/** 
 * DOC rli Comment method "createResource".
 * @param file
 * @return
 */
public synchronized Resource getFileResource(IFile file){
  Resource res;
  if (exist(file)) {
    res=registedResourceMap.get(file);
  }
 else {
    URI uri=URI.createPlatformResourceURI(file.getFullPath().toString(),false);
    res=EMFSharedResources.getInstance().getResource(uri,true);
    register(file,res);
  }
  return res;
}
Program: 138663
Project: 138663
Buggy source:
/** 
 * DOC bZhou Comment method "copyDefinitionsIntoFolder".
 * @param destinationUri
 * @return
 */
public Resource copyDefinitionsIntoFolder(URI destinationUri){
  Resource resource=getDefCategoryResourceFromFile();
  EMFUtil.changeUri(resource,destinationUri);
  if (EMFUtil.saveResource(resource)) {
    if (log.isInfoEnabled()) {
      log.info("String_Node_Str" + resource.getURI());
    }
  }
 else {
    log.error("String_Node_Str" + resource.getURI());
  }
  return resource;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "copyDefinitionsIntoFolder".
 * @param destinationUri
 * @return
 */
public Resource copyDefinitionsIntoFolder(URI destinationUri){
  URI uri=URI.createPlatformPluginURI(PLUGIN_PATH,false);
  Resource resource=EMFSharedResources.getInstance().getResource(uri,true);
  EMFUtil.changeUri(resource,destinationUri);
  if (EMFSharedResources.getInstance().saveResource(resource)) {
    if (log.isInfoEnabled()) {
      log.info("String_Node_Str" + resource.getURI());
    }
  }
 else {
    log.error("String_Node_Str" + resource.getURI());
  }
  return resource;
}
Program: 138664
Project: 138664
Buggy source:
/** 
 * DOC mzhao Get definition category files from file.
 * @return
 */
private Resource getDefCategoryResourceFromFile(){
  EMFUtil util=new EMFUtil();
  Resource definitionsFile=null;
  IPath definitionPath=ResourceManager.getLibrariesFolder().getFullPath().append(FILENAME);
  URI uri=URI.createPlatformResourceURI(definitionPath.toString(),false);
  try {
    definitionsFile=util.getResourceSet().getResource(uri,true);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + uri);
    }
  }
 catch (  RuntimeException e) {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + e.getMessage(),e);
    }
  }
  if (definitionsFile == null) {
    uri=URI.createPlatformPluginURI(PLUGIN_PATH,false);
    try {
      definitionsFile=util.getResourceSet().getResource(uri,true);
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str" + uri);
      }
    }
 catch (    RuntimeException e) {
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str" + e.getMessage(),e);
      }
    }
  }
  if (definitionsFile == null) {
    definitionsFile=util.getResourceSet().getResource(URI.createFileURI("String_Node_Str" + File.separator + PLUGIN_PATH),true);
  }
  if (definitionsFile == null) {
    log.error("String_Node_Str" + PLUGIN_PATH + "String_Node_Str"+ uri);
    return null;
  }
  return definitionsFile;
}

Fixed version (ground truth):
/** 
 * DOC mzhao Get definition category files from file.
 * @return
 */
private Resource getDefCategoryResourceFromFile(){
  Resource definitionsFile=null;
  IPath definitionPath=ResourceManager.getLibrariesFolder().getFullPath().append(FILENAME);
  URI uri=URI.createPlatformResourceURI(definitionPath.toString(),false);
  try {
    definitionsFile=EMFSharedResources.getInstance().getResource(uri,true);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + uri);
    }
  }
 catch (  RuntimeException e) {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + e.getMessage(),e);
    }
  }
  if (definitionsFile == null) {
    uri=URI.createPlatformPluginURI(PLUGIN_PATH,false);
    try {
      definitionsFile=EMFSharedResources.getInstance().getResource(uri,true);
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str" + uri);
      }
    }
 catch (    RuntimeException e) {
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str" + e.getMessage(),e);
      }
    }
  }
  if (definitionsFile == null) {
    definitionsFile=EMFSharedResources.getInstance().getResource(URI.createFileURI("String_Node_Str" + File.separator + PLUGIN_PATH),true);
  }
  if (definitionsFile == null) {
    log.error("String_Node_Str" + PLUGIN_PATH + "String_Node_Str"+ uri);
    return null;
  }
  return definitionsFile;
}
Program: 138665
Project: 138665
Buggy source:
private IndicatorCategory getIndicatorCategory(String categoryId){
  for (  IndicatorCategory indCategory : indicatorCategories) {
    CwmResource resource=(CwmResource)indCategory.eResource();
    EObject object=resource.getEObject(categoryId);
    if (object != null && DefinitionPackage.eINSTANCE.getIndicatorCategory().equals(object.eClass())) {
      return (IndicatorCategory)object;
    }
  }
  return null;
}

Fixed version (ground truth):
private IndicatorCategory getIndicatorCategory(String categoryId){
  for (  IndicatorCategory indCategory : indicatorCategories) {
    CwmResource resource=(CwmResource)indCategory.eResource();
    if (resource != null) {
      EObject object=resource.getEObject(categoryId);
      if (object != null && DefinitionPackage.eINSTANCE.getIndicatorCategory().equals(object.eClass())) {
        return (IndicatorCategory)object;
      }
    }
  }
  return null;
}
Program: 138666
Project: 138666
Buggy source:
public Resource getResource(URI uri,boolean loadOnDemand){
  return resourceSet.getResource(uri,loadOnDemand);
}

Fixed version (ground truth):
public Resource getResource(IFile file,boolean loadOnDemand){
  URI uri=URI.createPlatformResourceURI(file.getFullPath().toString(),false);
  return getResource(uri,loadOnDemand);
}