nus-yam/ex-repair huggingface dataset:
Program: 138711
Project: 138711
Buggy source:
/** 
 * DOC bZhou Comment method "populateElement".
 */
private void populateElement(){
  ItemRecord[] invalidRecords=writer.populate(getElements(),!overwriteBTN.getSelection());
  updateErrorList(invalidRecords);
  if (invalidRecords.length > 0) {
    removeInvalidRecords(invalidRecords);
  }
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "populateElement".
 */
private void populateElement(){
  List<ItemRecord> allRecordList=ItemRecord.getAllItemRecords();
  ItemRecord[] invalidRecords=writer.populate(allRecordList.toArray(new ItemRecord[allRecordList.size()]),!overwriteBTN.getSelection());
  updateErrorList(invalidRecords);
  if (invalidRecords.length > 0) {
    removeInvalidRecords(invalidRecords);
  }
}
Program: 138712
Project: 138712
Buggy source:
public ItemRecord[] populate(ItemRecord[] elements,boolean checkExisted){
  List<ItemRecord> inValidRecords=new ArrayList<ItemRecord>();
  for (  ItemRecord record : elements) {
    record.getErrors().clear();
    checkDependency(record);
    if (checkExisted) {
      checkExisted(record);
    }
    if (!record.isValid()) {
      inValidRecords.add(record);
    }
  }
  return inValidRecords.toArray(new ItemRecord[inValidRecords.size()]);
}

Fixed version (ground truth):
public ItemRecord[] populate(ItemRecord[] elements,boolean checkExisted){
  List<ItemRecord> inValidRecords=new ArrayList<ItemRecord>();
  for (  ItemRecord record : elements) {
    checkDependency(record);
    if (checkExisted) {
      checkExisted(record);
    }
    if (!record.isValid()) {
      inValidRecords.add(record);
    }
  }
  return inValidRecords.toArray(new ItemRecord[inValidRecords.size()]);
}
Program: 138713
Project: 138713
Buggy source:
/** 
 * DOC bZhou Comment method "checkExisted".
 * @param record
 */
private void checkExisted(ItemRecord record){
  Property property=record.getProperty();
  if (property != null) {
    IPath itemPath=PropertyHelper.getItemPath(property);
    IFile itemFile=ResourcesPlugin.getWorkspace().getRoot().getFile(itemPath);
    try {
      itemFile.getParent().refreshLocal(IResource.DEPTH_INFINITE,null);
    }
 catch (    CoreException e) {
    }
    String aString=record.getName();
    if (itemFile.exists()) {
      ModelElementFileFactory.getResourceFileMap(itemFile).clear();
      URI itemURI=URI.createPlatformResourceURI(itemFile.getFullPath().toString(),false);
      EMFSharedResources.getInstance().unloadResource(itemURI.toString());
      URI propURI=itemURI.trimFileExtension().appendFileExtension(FactoriesUtil.PROPERTIES_EXTENSION);
      EMFSharedResources.getInstance().unloadResource(propURI.toString());
      record.addError("String_Node_Str" + aString + "String_Node_Str"+ itemFile.getFullPath().toString());
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "checkExisted".
 * @param record
 */
private void checkExisted(ItemRecord record){
  Property property=record.getProperty();
  if (property != null) {
    IPath itemPath=PropertyHelper.getItemPath(property);
    IFile itemFile=ResourcesPlugin.getWorkspace().getRoot().getFile(itemPath);
    try {
      itemFile.getParent().refreshLocal(IResource.DEPTH_INFINITE,null);
    }
 catch (    CoreException e) {
    }
    if (itemFile.exists()) {
      ModelElementFileFactory.getResourceFileMap(itemFile).clear();
      URI itemURI=URI.createPlatformResourceURI(itemFile.getFullPath().toString(),false);
      EMFSharedResources.getInstance().unloadResource(itemURI.toString());
      URI propURI=itemURI.trimFileExtension().appendFileExtension(FactoriesUtil.PROPERTIES_EXTENSION);
      EMFSharedResources.getInstance().unloadResource(propURI.toString());
      record.addError("String_Node_Str" + record.getName() + "String_Node_Str"+ itemFile.getFullPath().toString());
    }
  }
}
Program: 138714
Project: 138714
Buggy source:
/** 
 * DOC bZhou Comment method "addError".
 * @param error
 */
public void addError(String error){
  this.errors.add(error);
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "addError".
 * @param error
 */
public void addError(String error){
  if (elementEName != null) {
    error="String_Node_Str" + elementEName.name() + "String_Node_Str"+ error;
  }
  this.errors.add(error);
}
Program: 138715
Project: 138715
Buggy source:
/** 
 * DOC bZhou Comment method "init".
 */
private void init(){
  if (resourceSet == null) {
    resourceSet=new ResourceSetImpl();
  }
  if (allItemRecords == null) {
    allItemRecords=new ArrayList<ItemRecord>();
  }
  allItemRecords.add(this);
  if (property == null) {
    property=(Property)EObjectHelper.retrieveEObject(getPropertyPath(),PropertiesPackage.eINSTANCE.getProperty());
  }
  if (element == null && !isJRXml()) {
    try {
      URI fileURI=URI.createFileURI(file.getAbsolutePath());
      Resource resource=resourceSet.getResource(fileURI,true);
      EList<EObject> contents=resource.getContents();
      if (contents != null && !contents.isEmpty()) {
        if (property.getItem() instanceof ConnectionItem) {
          element=((ConnectionItem)property.getItem()).getConnection();
        }
 else {
          EObject object=contents.get(0);
          if (object instanceof ModelElement) {
            element=(ModelElement)object;
          }
        }
      }
    }
 catch (    Exception e) {
      Log.warn("String_Node_Str" + getName());
    }
  }
  computeDependencies();
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "init".
 */
private void init(){
  if (resourceSet == null) {
    resourceSet=new ResourceSetImpl();
  }
  if (allItemRecords == null) {
    allItemRecords=new ArrayList<ItemRecord>();
  }
  allItemRecords.add(this);
  URI fileURI=URI.createFileURI(file.getAbsolutePath());
  elementEName=EElementEName.findENameByExt(fileURI.fileExtension());
  if (property == null) {
    property=(Property)EObjectHelper.retrieveEObject(getPropertyPath(),PropertiesPackage.eINSTANCE.getProperty());
  }
  if (element == null && !isJRXml()) {
    Resource resource=resourceSet.getResource(fileURI,true);
    EList<EObject> contents=resource.getContents();
    if (contents != null && !contents.isEmpty()) {
      if (property.getItem() instanceof ConnectionItem) {
        element=((ConnectionItem)property.getItem()).getConnection();
      }
 else {
        EObject object=contents.get(0);
        if (object instanceof ModelElement) {
          element=(ModelElement)object;
        }
      }
    }
  }
  computeDependencies();
}
Program: 138716
Project: 138716
Buggy source:
public ItemRecord(File file){
  this.file=file;
  try {
    if (file != null && file.isFile()) {
      init();
    }
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
}

Fixed version (ground truth):
public ItemRecord(File file){
  this.file=file;
  try {
    if (file != null && file.isFile()) {
      init();
    }
  }
 catch (  Exception e) {
    addError("String_Node_Str" + getName() + "String_Node_Str"+ e.getMessage());
  }
}
Program: 138717
Project: 138717
Buggy source:
/** 
 * Getter for childern.
 * @return the childern
 */
public ItemRecord[] getChildern(){
  if (childern == null) {
    List<ItemRecord> recordList=new ArrayList<ItemRecord>();
    File[] listFiles=file.listFiles();
    if (listFiles != null) {
      for (      File aFile : listFiles) {
        if (isValid(aFile)) {
          recordList.add(new ItemRecord(aFile));
        }
      }
    }
    childern=recordList.toArray(new ItemRecord[recordList.size()]);
  }
  return this.childern;
}

Fixed version (ground truth):
/** 
 * Getter for childern.
 * @return the childern
 */
public ItemRecord[] getChildern(){
  if (childern == null) {
    List<ItemRecord> recordList=new ArrayList<ItemRecord>();
    File[] listFiles=file.listFiles();
    if (listFiles != null) {
      for (      File aFile : listFiles) {
        if (isValid(aFile)) {
          ItemRecord itemRecord=new ItemRecord(aFile);
          if (itemRecord.isValid()) {
            recordList.add(itemRecord);
          }
        }
      }
    }
    childern=recordList.toArray(new ItemRecord[recordList.size()]);
  }
  return this.childern;
}
Program: 138718
Project: 138718
Buggy source:
public String getPersent(){
  if (percent != null) {
    if (percent.matches("String_Node_Str")) {
      return StringFormatUtil.format(percent,StringFormatUtil.PERCENT).toString();
    }
 else {
      return "String_Node_Str";
    }
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
public String getPersent(){
  if (percent != null) {
    if (percent != Double.NaN) {
      return StringFormatUtil.format(percent,StringFormatUtil.PERCENT).toString();
    }
 else {
      return "String_Node_Str";
    }
  }
 else {
    return null;
  }
}
Program: 138719
Project: 138719
Buggy source:
public void setPercent(String percent){
  this.percent=percent;
}

Fixed version (ground truth):
public void setPercent(Double percent){
  this.percent=percent;
}
Program: 138720
Project: 138720
Buggy source:
public ChartDataEntity(Indicator indicator,String label,String value,String percent,boolean labelNull){
  this.label=label;
  this.value=value;
  this.percent=percent;
  this.labelNull=labelNull;
  this.indicator=indicator;
}

Fixed version (ground truth):
public ChartDataEntity(Indicator indicator,String label,String value,Double percent,boolean labelNull){
  this.label=label;
  this.value=value;
  this.percent=percent;
  this.labelNull=labelNull;
  this.indicator=indicator;
}
Program: 138721
Project: 138721
Buggy source:
public ICustomerDataset getCustomerDataset(){
  CustomerDefaultCategoryDataset customerdataset=new CustomerDefaultCategoryDataset();
  for (  IndicatorUnit unit : units) {
    final Object unitValue=unit.getValue();
    double value=unitValue != null ? Double.parseDouble(unitValue.toString()) : Double.NaN;
    String label=unit.getIndicatorName();
    customerdataset.addValue(value,label,label);
    ChartDataEntity entity=new ChartDataEntity();
    entity.setIndicator(unit.getIndicator());
    entity.setLabel(label);
    entity.setValue(String.valueOf(value));
    entity.setPercent(String.valueOf(value / unit.getIndicator().getCount()));
    customerdataset.addDataEntity(entity);
  }
  return customerdataset;
}

Fixed version (ground truth):
public ICustomerDataset getCustomerDataset(){
  CustomerDefaultCategoryDataset customerdataset=new CustomerDefaultCategoryDataset();
  for (  IndicatorUnit unit : units) {
    final Object unitValue=unit.getValue();
    double value=unitValue != null ? Double.parseDouble(unitValue.toString()) : Double.NaN;
    String label=unit.getIndicatorName();
    customerdataset.addValue(value,label,label);
    ChartDataEntity entity=new ChartDataEntity();
    entity.setIndicator(unit.getIndicator());
    entity.setLabel(label);
    entity.setValue(String.valueOf(value));
    entity.setPercent(value / unit.getIndicator().getCount());
    customerdataset.addDataEntity(entity);
  }
  return customerdataset;
}
Program: 138722
Project: 138722
Buggy source:
public ICustomerDataset getCustomerDataset(){
  CustomerDefaultCategoryDataset customerdataset=new CustomerDefaultCategoryDataset();
  for (  TableIndicatorUnit unit : units) {
    double value=Double.parseDouble(unit.getValue().toString());
    String label=unit.getIndicatorName();
    customerdataset.addValue(value,label,"String_Node_Str");
    ChartDataEntity entity=new ChartDataEntity();
    entity.setIndicator(unit.getIndicator());
    entity.setLabel(label);
    entity.setValue(String.valueOf(value));
    entity.setPercent(String.valueOf(value / unit.getIndicator().getCount()));
    customerdataset.addDataEntity(entity);
  }
  return customerdataset;
}

Fixed version (ground truth):
public ICustomerDataset getCustomerDataset(){
  CustomerDefaultCategoryDataset customerdataset=new CustomerDefaultCategoryDataset();
  for (  TableIndicatorUnit unit : units) {
    double value=Double.parseDouble(unit.getValue().toString());
    String label=unit.getIndicatorName();
    customerdataset.addValue(value,label,"String_Node_Str");
    ChartDataEntity entity=new ChartDataEntity();
    entity.setIndicator(unit.getIndicator());
    entity.setLabel(label);
    entity.setValue(String.valueOf(value));
    entity.setPercent(value / unit.getIndicator().getCount());
    customerdataset.addDataEntity(entity);
  }
  return customerdataset;
}
Program: 138723
Project: 138723
Buggy source:
public ICustomerDataset getCustomerDataset(){
  ComparatorsFactory.sort(units,ComparatorsFactory.TEXT_STATISTICS_COMPARATOR_ID);
  CustomerDefaultCategoryDataset customerdataset=new CustomerDefaultCategoryDataset();
  for (  IndicatorUnit unit : units) {
    double value=Double.parseDouble(unit.getValue().toString());
    String label=unit.getIndicatorName();
    String type="String_Node_Str";
switch (unit.getType()) {
case MinLengthWithNullIndicatorEnum:
case MinLengthWithBlankIndicatorEnum:
case MinLengthWithBlankNullIndicatorEnum:
      type="String_Node_Str";
    break;
case MaxLengthWithBlankIndicatorEnum:
case MaxLengthWithBlankNullIndicatorEnum:
case MaxLengthWithNullIndicatorEnum:
  type="String_Node_Str";
break;
case AverageLengthWithNullIndicatorEnum:
case AverageLengthWithBlankIndicatorEnum:
case AverageLengthWithNullBlankIndicatorEnum:
type="String_Node_Str";
break;
default :
type=label;
break;
}
customerdataset.addValue(value,type,label);
ChartDataEntity entity=new ChartDataEntity();
entity.setIndicator(unit.getIndicator());
entity.setLabel(label);
entity.setValue(String.valueOf(value));
entity.setPercent(String.valueOf(value / unit.getIndicator().getCount()));
customerdataset.addDataEntity(entity);
}
return customerdataset;
}

Fixed version (ground truth):
public ICustomerDataset getCustomerDataset(){
  ComparatorsFactory.sort(units,ComparatorsFactory.TEXT_STATISTICS_COMPARATOR_ID);
  CustomerDefaultCategoryDataset customerdataset=new CustomerDefaultCategoryDataset();
  for (  IndicatorUnit unit : units) {
    double value=Double.parseDouble(unit.getValue().toString());
    String label=unit.getIndicatorName();
    String type="String_Node_Str";
switch (unit.getType()) {
case MinLengthWithNullIndicatorEnum:
case MinLengthWithBlankIndicatorEnum:
case MinLengthWithBlankNullIndicatorEnum:
      type="String_Node_Str";
    break;
case MaxLengthWithBlankIndicatorEnum:
case MaxLengthWithBlankNullIndicatorEnum:
case MaxLengthWithNullIndicatorEnum:
  type="String_Node_Str";
break;
case AverageLengthWithNullIndicatorEnum:
case AverageLengthWithBlankIndicatorEnum:
case AverageLengthWithNullBlankIndicatorEnum:
type="String_Node_Str";
break;
default :
type=label;
break;
}
customerdataset.addValue(value,type,label);
ChartDataEntity entity=new ChartDataEntity();
entity.setIndicator(unit.getIndicator());
entity.setLabel(label);
entity.setValue(String.valueOf(value));
entity.setPercent(value / unit.getIndicator().getCount());
customerdataset.addDataEntity(entity);
}
return customerdataset;
}
Program: 138724
Project: 138724
Buggy source:
public ICustomerDataset getCustomerDataset(){
  ComparatorsFactory.sort(units,ComparatorsFactory.TEXT_STATISTICS_COMPARATOR_ID);
  CustomerDefaultCategoryDataset customerdataset=new CustomerDefaultCategoryDataset();
  for (  IndicatorUnit unit : units) {
    double value=Double.parseDouble(unit.getValue().toString());
    String label=unit.getIndicatorName();
    customerdataset.addValue(value,label,label);
    ChartDataEntity entity=new ChartDataEntity();
    entity.setIndicator(unit.getIndicator());
    entity.setLabel(label);
    entity.setValue(String.valueOf(value));
    entity.setPercent(String.valueOf(value / unit.getIndicator().getCount()));
    customerdataset.addDataEntity(entity);
  }
  return customerdataset;
}

Fixed version (ground truth):
public ICustomerDataset getCustomerDataset(){
  ComparatorsFactory.sort(units,ComparatorsFactory.TEXT_STATISTICS_COMPARATOR_ID);
  CustomerDefaultCategoryDataset customerdataset=new CustomerDefaultCategoryDataset();
  for (  IndicatorUnit unit : units) {
    double value=Double.parseDouble(unit.getValue().toString());
    String label=unit.getIndicatorName();
    customerdataset.addValue(value,label,label);
    ChartDataEntity entity=new ChartDataEntity();
    entity.setIndicator(unit.getIndicator());
    entity.setLabel(label);
    entity.setValue(String.valueOf(value));
    entity.setPercent(value / unit.getIndicator().getCount());
    customerdataset.addDataEntity(entity);
  }
  return customerdataset;
}
Program: 138725
Project: 138725
Buggy source:
@Override public ICustomerDataset getCustomerDataset(){
  CustomerDefaultCategoryDataset customerdataset=new CustomerDefaultCategoryDataset();
  for (  IndicatorUnit unit : units) {
    if (unit.isExcuted()) {
      FrequencyExt[] frequencyExt=(FrequencyExt[])unit.getValue();
      sortIndicator(frequencyExt);
      int numOfShown=frequencyExt.length;
      IndicatorParameters parameters=unit.getIndicator().getParameters();
      if (parameters != null) {
        if (parameters.getTopN() < frequencyExt.length) {
          numOfShown=parameters.getTopN();
        }
      }
      for (int i=0; i < numOfShown; i++) {
        FrequencyExt freqExt=frequencyExt[i];
        String keyLabel=String.valueOf(freqExt.getKey());
        if ("String_Node_Str".equals(keyLabel)) {
          keyLabel=SpecialValueDisplay.NULL_FIELD;
        }
        if ("String_Node_Str".equals(keyLabel)) {
          keyLabel=SpecialValueDisplay.EMPTY_FIELD;
        }
        customerdataset.addValue(freqExt.getValue(),unit.getIndicatorName(),keyLabel);
        ChartDataEntity entity=new ChartDataEntity();
        entity.setIndicator(unit.getIndicator());
        entity.setKey(freqExt.getKey());
        entity.setLabelNull(freqExt.getKey() == null);
        entity.setLabel(keyLabel);
        entity.setValue(String.valueOf(freqExt.getValue()));
        entity.setPercent(String.valueOf(freqExt.getFrequency()));
        customerdataset.addDataEntity(entity);
      }
    }
  }
  return customerdataset;
}

Fixed version (ground truth):
@Override public ICustomerDataset getCustomerDataset(){
  CustomerDefaultCategoryDataset customerdataset=new CustomerDefaultCategoryDataset();
  for (  IndicatorUnit unit : units) {
    if (unit.isExcuted()) {
      FrequencyExt[] frequencyExt=(FrequencyExt[])unit.getValue();
      sortIndicator(frequencyExt);
      int numOfShown=frequencyExt.length;
      IndicatorParameters parameters=unit.getIndicator().getParameters();
      if (parameters != null) {
        if (parameters.getTopN() < frequencyExt.length) {
          numOfShown=parameters.getTopN();
        }
      }
      for (int i=0; i < numOfShown; i++) {
        FrequencyExt freqExt=frequencyExt[i];
        String keyLabel=String.valueOf(freqExt.getKey());
        if ("String_Node_Str".equals(keyLabel)) {
          keyLabel=SpecialValueDisplay.NULL_FIELD;
        }
        if ("String_Node_Str".equals(keyLabel)) {
          keyLabel=SpecialValueDisplay.EMPTY_FIELD;
        }
        customerdataset.addValue(freqExt.getValue(),unit.getIndicatorName(),keyLabel);
        ChartDataEntity entity=new ChartDataEntity();
        entity.setIndicator(unit.getIndicator());
        entity.setKey(freqExt.getKey());
        entity.setLabelNull(freqExt.getKey() == null);
        entity.setLabel(keyLabel);
        entity.setValue(String.valueOf(freqExt.getValue()));
        entity.setPercent(freqExt.getFrequency());
        customerdataset.addDataEntity(entity);
      }
    }
  }
  return customerdataset;
}
Program: 138726
Project: 138726
Buggy source:
@Override public ICustomerDataset getCustomerDataset(){
  CustomerDefaultCategoryDataset customerdataset=new CustomerDefaultCategoryDataset();
  for (  IndicatorUnit unit : units) {
    if (unit.isExcuted()) {
      FrequencyExt[] frequencyExt=(FrequencyExt[])unit.getValue();
      sortIndicator(frequencyExt);
      int numOfShown=frequencyExt.length;
      IndicatorParameters parameters=unit.getIndicator().getParameters();
      if (parameters != null) {
        if (parameters.getTopN() < frequencyExt.length) {
          numOfShown=parameters.getTopN();
        }
      }
      for (int i=0; i < numOfShown; i++) {
        FrequencyExt freqExt=frequencyExt[i];
        String keyLabel=String.valueOf(freqExt.getKey());
        if ("String_Node_Str".equals(keyLabel)) {
          keyLabel=SpecialValueDisplay.NULL_FIELD;
        }
        if ("String_Node_Str".equals(keyLabel)) {
          keyLabel=SpecialValueDisplay.EMPTY_FIELD;
        }
        customerdataset.addValue(freqExt.getValue(),unit.getIndicatorName(),keyLabel);
        ChartDataEntity entity=new ChartDataEntity();
        entity.setIndicator(unit.getIndicator());
        entity.setKey(freqExt.getKey());
        entity.setLabelNull(freqExt.getKey() == null);
        entity.setLabel(keyLabel);
        entity.setValue(String.valueOf(freqExt.getValue()));
        entity.setPercent(String.valueOf(freqExt.getFrequency()));
        customerdataset.addDataEntity(entity);
      }
    }
  }
  return customerdataset;
}

Fixed version (ground truth):
@Override public ICustomerDataset getCustomerDataset(){
  CustomerDefaultCategoryDataset customerdataset=new CustomerDefaultCategoryDataset();
  for (  IndicatorUnit unit : units) {
    if (unit.isExcuted()) {
      FrequencyExt[] frequencyExt=(FrequencyExt[])unit.getValue();
      sortIndicator(frequencyExt);
      int numOfShown=frequencyExt.length;
      IndicatorParameters parameters=unit.getIndicator().getParameters();
      if (parameters != null) {
        if (parameters.getTopN() < frequencyExt.length) {
          numOfShown=parameters.getTopN();
        }
      }
      for (int i=0; i < numOfShown; i++) {
        FrequencyExt freqExt=frequencyExt[i];
        String keyLabel=String.valueOf(freqExt.getKey());
        if ("String_Node_Str".equals(keyLabel)) {
          keyLabel=SpecialValueDisplay.NULL_FIELD;
        }
        if ("String_Node_Str".equals(keyLabel)) {
          keyLabel=SpecialValueDisplay.EMPTY_FIELD;
        }
        customerdataset.addValue(freqExt.getValue(),unit.getIndicatorName(),keyLabel);
        ChartDataEntity entity=new ChartDataEntity();
        entity.setIndicator(unit.getIndicator());
        entity.setKey(freqExt.getKey());
        entity.setLabelNull(freqExt.getKey() == null);
        entity.setLabel(keyLabel);
        entity.setValue(String.valueOf(freqExt.getValue()));
        entity.setPercent(freqExt.getFrequency());
        customerdataset.addDataEntity(entity);
      }
    }
  }
  return customerdataset;
}
Program: 138727
Project: 138727
Buggy source:
public ICustomerDataset getCustomerDataset(){
  CustomerDefaultCategoryDataset customerdataset=new CustomerDefaultCategoryDataset();
  for (  IndicatorUnit unit : units) {
    if (unit.isExcuted()) {
      FrequencyExt[] frequencyExt=(FrequencyExt[])unit.getValue();
      sortIndicator(frequencyExt);
      int numOfShown=frequencyExt.length;
      IndicatorParameters parameters=unit.getIndicator().getParameters();
      if (parameters != null) {
        if (parameters.getTopN() < frequencyExt.length) {
          numOfShown=parameters.getTopN();
        }
      }
      for (int i=0; i < numOfShown; i++) {
        FrequencyExt freqExt=frequencyExt[i];
        String keyLabel=String.valueOf(freqExt.getKey());
        if ("String_Node_Str".equals(keyLabel)) {
          keyLabel=SpecialValueDisplay.NULL_FIELD;
        }
        if ("String_Node_Str".equals(keyLabel)) {
          keyLabel=SpecialValueDisplay.EMPTY_FIELD;
        }
        customerdataset.addValue(freqExt.getValue(),"String_Node_Str",keyLabel);
        ChartDataEntity entity=new ChartDataEntity();
        entity.setIndicator(unit.getIndicator());
        entity.setKey(freqExt.getKey());
        entity.setLabelNull(freqExt.getKey() == null);
        entity.setLabel(keyLabel);
        entity.setValue(String.valueOf(freqExt.getValue()));
        entity.setPercent(String.valueOf(freqExt.getFrequency()));
        customerdataset.addDataEntity(entity);
      }
    }
  }
  return customerdataset;
}

Fixed version (ground truth):
public ICustomerDataset getCustomerDataset(){
  CustomerDefaultCategoryDataset customerdataset=new CustomerDefaultCategoryDataset();
  for (  IndicatorUnit unit : units) {
    if (unit.isExcuted()) {
      FrequencyExt[] frequencyExt=(FrequencyExt[])unit.getValue();
      sortIndicator(frequencyExt);
      int numOfShown=frequencyExt.length;
      IndicatorParameters parameters=unit.getIndicator().getParameters();
      if (parameters != null) {
        if (parameters.getTopN() < frequencyExt.length) {
          numOfShown=parameters.getTopN();
        }
      }
      for (int i=0; i < numOfShown; i++) {
        FrequencyExt freqExt=frequencyExt[i];
        String keyLabel=String.valueOf(freqExt.getKey());
        if ("String_Node_Str".equals(keyLabel)) {
          keyLabel=SpecialValueDisplay.NULL_FIELD;
        }
        if ("String_Node_Str".equals(keyLabel)) {
          keyLabel=SpecialValueDisplay.EMPTY_FIELD;
        }
        customerdataset.addValue(freqExt.getValue(),"String_Node_Str",keyLabel);
        ChartDataEntity entity=new ChartDataEntity();
        entity.setIndicator(unit.getIndicator());
        entity.setKey(freqExt.getKey());
        entity.setLabelNull(freqExt.getKey() == null);
        entity.setLabel(keyLabel);
        entity.setValue(String.valueOf(freqExt.getValue()));
        entity.setPercent(freqExt.getFrequency());
        customerdataset.addDataEntity(entity);
      }
    }
  }
  return customerdataset;
}
Program: 138728
Project: 138728
Buggy source:
public Properties getDBPameterProperties(String connectionStr){
  Properties paramProperties=new Properties();
  String matchSubStr=connectionStr.substring(0,8);
  Set<Object> s=PROP.keySet();
  Iterator<Object> it=s.iterator();
  while (it.hasNext()) {
    String id=(String)it.next();
    String value=PROP.getProperty(id);
    if (value.contains(matchSubStr)) {
      paramProperties.setProperty(PluginConstant.DBTYPE_PROPERTY,id);
      MessageFormat mf=new MessageFormat(value);
      Object[] parseResult=mf.parse(connectionStr,new ParsePosition(0));
      if (parseResult != null) {
        if (parseResult[0] != null) {
          paramProperties.setProperty(PluginConstant.HOSTNAME_PROPERTY,(String)parseResult[0]);
        }
        if (parseResult[1] != null) {
          paramProperties.setProperty(PluginConstant.PORT_PROPERTY,(String)parseResult[1]);
        }
        break;
      }
    }
  }
  return paramProperties;
}

Fixed version (ground truth):
public Properties getDBPameterProperties(String connectionStr){
  Properties paramProperties=new Properties();
  if (connectionStr != null) {
    String matchSubStr=connectionStr.substring(0,8);
    Set<Object> s=PROP.keySet();
    Iterator<Object> it=s.iterator();
    while (it.hasNext()) {
      String id=(String)it.next();
      String value=PROP.getProperty(id);
      if (value.contains(matchSubStr)) {
        paramProperties.setProperty(PluginConstant.DBTYPE_PROPERTY,id);
        MessageFormat mf=new MessageFormat(value);
        Object[] parseResult=mf.parse(connectionStr,new ParsePosition(0));
        if (parseResult != null) {
          if (parseResult[0] != null) {
            paramProperties.setProperty(PluginConstant.HOSTNAME_PROPERTY,(String)parseResult[0]);
          }
          if (parseResult[1] != null) {
            paramProperties.setProperty(PluginConstant.PORT_PROPERTY,(String)parseResult[1]);
          }
          break;
        }
      }
    }
  }
 else {
    paramProperties.setProperty(PluginConstant.DBTYPE_PROPERTY,"String_Node_Str");
    paramProperties.setProperty(PluginConstant.HOSTNAME_PROPERTY,"String_Node_Str");
    paramProperties.setProperty(PluginConstant.PORT_PROPERTY,"String_Node_Str");
  }
  return paramProperties;
}
Program: 138729
Project: 138729
Buggy source:
public static String computePath(Property property){
  Resource eResource=property.eResource();
  if (eResource != null) {
    IPath propPath, typedPath;
    URI propURI=eResource.getURI();
    if (propURI.isPlatform()) {
      propPath=new Path(propURI.toPlatformString(true)).removeLastSegments(1);
      typedPath=ResourceManager.getRootProject().getFullPath().append(PropertyHelper.getItemTypedPath(property));
      IPath itemPath=propPath.makeRelativeTo(typedPath);
      return itemPath.toString();
    }
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "computePath".
 * @param property
 * @param file
 * @return
 */
public static String computePath(Property property,File file){
  IPath filePath=new Path(file.getAbsolutePath()).setDevice(null);
  int flag=0;
  EResourceConstant typedConstant=EResourceConstant.getTypedConstant(property.getItem());
  if (typedConstant != null) {
    String typedName=typedConstant.getName();
    for (int i=0; i < filePath.segmentCount(); i++) {
      String seg=filePath.segment(i);
      if (seg.equals(typedName)) {
        flag=i + 1;
        break;
      }
    }
  }
 else {
    List<EResourceConstant> typedConstantList=EResourceConstant.getTypedConstantList();
    typedConstantList.add(EResourceConstant.OLD_DB_CONNECTIONS);
    typedConstantList.add(EResourceConstant.MDM_CONNECTIONS);
    for (int i=0; i < filePath.segmentCount() && flag == 0; i++) {
      String seg=filePath.segment(i);
      for (      EResourceConstant constant : typedConstantList) {
        if (seg.equals(constant.getName())) {
          flag=i + 1;
          break;
        }
      }
    }
  }
  IPath statPath=filePath.removeFirstSegments(flag).removeLastSegments(1);
  return statPath.toString();
}
Program: 138732
Project: 138732
Buggy source:
@Override protected String getTitle(){
  return DefaultMessagesImpl.getString("String_Node_Str");
}

Fixed version (ground truth):
@Override protected String getTitle(){
  return null == type ? DefaultMessagesImpl.getString("String_Node_Str") : type.getLiteral();
}
Program: 138733
Project: 138733
Buggy source:
/** 
 * DOC yyi DateFrequencyStatisticsState constructor comment.
 * @param units
 */
public DateFrequencyStatisticsState(List<IndicatorUnit> units){
  super(units);
}

Fixed version (ground truth):
public DateFrequencyStatisticsState(List<IndicatorUnit> units,EIndicatorChartType type){
  this(units);
  this.type=type;
}
Program: 138734
Project: 138734
Buggy source:
@Override protected String getTitle(){
  return DefaultMessagesImpl.getString("String_Node_Str");
}

Fixed version (ground truth):
@Override protected String getTitle(){
  return null == type ? DefaultMessagesImpl.getString("String_Node_Str") : type.getLiteral();
}
Program: 138735
Project: 138735
Buggy source:
/** 
 * DOC yyi DateLowFrequencyStatisticsState constructor comment.
 * @param units
 */
public DateLowFrequencyStatisticsState(List<IndicatorUnit> units){
  super(units);
}

Fixed version (ground truth):
public DateLowFrequencyStatisticsState(List<IndicatorUnit> units,EIndicatorChartType type){
  this(units);
  this.type=type;
}
Program: 138736
Project: 138736
Buggy source:
@Test public void deleteForeverElemensByTXT() throws Exception {
  List<String[]> delLs=LogicalDeleteFileHandle.getDelLs();
  for (int i=0; i < delLs.size(); i++) {
    String[] els=(String[])delLs.get(i);
    IPath path=new Path(els[1]);
    if (els[0].equals("String_Node_Str")) {
      IFile file=ResourceManager.getRoot().getFile(path);
      if (file.exists()) {
        file.delete(true,null);
        LogicalDeleteFileHandle.replaceInFile(LogicalDeleteFileHandle.fileType + file.getFullPath().toOSString(),PluginConstant.EMPTY_STRING);
        i--;
      }
    }
 else     if (els[0].equals("String_Node_Str")) {
      IFolder folder=ResourceManager.getRoot().getFolder(path);
      if (folder.exists()) {
        folder.delete(true,null);
        LogicalDeleteFileHandle.replaceInFile(LogicalDeleteFileHandle.folderType + folder.getFullPath().toOSString(),PluginConstant.EMPTY_STRING);
        i--;
      }
    }
  }
}

Fixed version (ground truth):
@Test public void deleteForeverElemensByTXT() throws Exception {
  List<String[]> delLs=new ArrayList<String[]>();
  for (int i=0; i < delLs.size(); i++) {
    String[] els=(String[])delLs.get(i);
    IPath path=new Path(els[1]);
    if (els[0].equals("String_Node_Str")) {
      IFile file=ResourceManager.getRoot().getFile(path);
      if (file.exists()) {
        file.delete(true,null);
        i--;
      }
    }
 else     if (els[0].equals("String_Node_Str")) {
      IFolder folder=ResourceManager.getRoot().getFolder(path);
      if (folder.exists()) {
        folder.delete(true,null);
        i--;
      }
    }
  }
}
Program: 138738
Project: 138738
Buggy source:
@Test public void restoreAllByTXTFile() throws Exception {
  List<String[]> delLs=LogicalDeleteFileHandle.getDelLs();
  for (int i=0; i < delLs.size(); i++) {
    String[] els=(String[])delLs.get(i);
    IPath path=new Path(els[1]);
    if (els[0].equals("String_Node_Str")) {
      IFile file=ResourceManager.getRoot().getFile(path);
      if (file.exists()) {
        Property property=PropertyHelper.getProperty(file);
        property.getItem().getState().setDeleted(false);
        Resource propertyResource=property.eResource();
        if (!EMFSharedResources.getInstance().saveResource(propertyResource))         continue;
        LogicalDeleteFileHandle.replaceInFile(LogicalDeleteFileHandle.fileType + file.getFullPath().toOSString(),PluginConstant.EMPTY_STRING);
        i--;
      }
    }
 else     if (els[0].equals("String_Node_Str")) {
      IFolder folder=ResourceManager.getRoot().getFolder(path);
      if (folder.exists()) {
        LogicalDeleteFileHandle.replaceInFile(LogicalDeleteFileHandle.folderType + folder.getFullPath().toOSString(),PluginConstant.EMPTY_STRING);
        i--;
      }
    }
  }
}

Fixed version (ground truth):
@Test public void restoreAllByTXTFile() throws Exception {
  List<String[]> delLs=new ArrayList();
  for (int i=0; i < delLs.size(); i++) {
    String[] els=(String[])delLs.get(i);
    IPath path=new Path(els[1]);
    if (els[0].equals("String_Node_Str")) {
      IFile file=ResourceManager.getRoot().getFile(path);
      if (file.exists()) {
        Property property=PropertyHelper.getProperty(file);
        property.getItem().getState().setDeleted(false);
        Resource propertyResource=property.eResource();
        if (!EMFSharedResources.getInstance().saveResource(propertyResource))         continue;
        i--;
      }
    }
 else     if (els[0].equals("String_Node_Str")) {
      IFolder folder=ResourceManager.getRoot().getFolder(path);
      if (folder.exists()) {
        i--;
      }
    }
  }
}
Program: 138739
Project: 138739
Buggy source:
public String getPersent(){
  if (percent != null) {
    if (percent != Double.NaN) {
      return StringFormatUtil.format(percent,StringFormatUtil.PERCENT).toString();
    }
 else {
      return "String_Node_Str";
    }
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
public String getPersent(){
  if (percent != null) {
    if (Double.isNaN(percent)) {
      return "String_Node_Str";
    }
 else {
      return StringFormatUtil.format(percent,StringFormatUtil.PERCENT).toString();
    }
  }
 else {
    return null;
  }
}
Program: 138740
Project: 138740
Buggy source:
public ICustomerDataset getCustomerDataset(){
  CustomerDefaultCategoryDataset customerdataset=new CustomerDefaultCategoryDataset();
  for (  IndicatorUnit unit : units) {
    if (unit.isExcuted()) {
      FrequencyExt[] frequencyExt=(FrequencyExt[])unit.getValue();
      sortIndicator(frequencyExt);
      int numOfShown=frequencyExt.length;
      IndicatorParameters parameters=unit.getIndicator().getParameters();
      if (parameters != null) {
        if (parameters.getTopN() < frequencyExt.length) {
          numOfShown=parameters.getTopN();
        }
      }
      for (int i=0; i < numOfShown; i++) {
        FrequencyExt freqExt=frequencyExt[i];
        String keyLabel=String.valueOf(freqExt.getKey());
        if ("String_Node_Str".equals(keyLabel)) {
          keyLabel=SpecialValueDisplay.NULL_FIELD;
        }
        if ("String_Node_Str".equals(keyLabel)) {
          keyLabel=SpecialValueDisplay.EMPTY_FIELD;
        }
        customerdataset.addValue(freqExt.getValue(),"String_Node_Str",keyLabel);
        ChartDataEntity entity=new ChartDataEntity();
        entity.setIndicator(unit.getIndicator());
        entity.setKey(freqExt.getKey());
        entity.setLabelNull(freqExt.getKey() == null);
        entity.setLabel(keyLabel);
        entity.setValue(String.valueOf(freqExt.getValue()));
        entity.setPercent(freqExt.getFrequency());
        customerdataset.addDataEntity(entity);
      }
    }
  }
  return customerdataset;
}

Fixed version (ground truth):
public ICustomerDataset getCustomerDataset(){
  CustomerDefaultCategoryDataset customerdataset=new CustomerDefaultCategoryDataset();
  for (  IndicatorUnit unit : units) {
    if (unit.isExcuted()) {
      FrequencyExt[] frequencyExt=(FrequencyExt[])unit.getValue();
      sortIndicator(frequencyExt);
      int numOfShown=frequencyExt.length;
      IndicatorParameters parameters=unit.getIndicator().getParameters();
      if (parameters != null) {
        if (parameters.getTopN() < frequencyExt.length) {
          numOfShown=parameters.getTopN();
        }
      }
      for (int i=0; i < numOfShown; i++) {
        FrequencyExt freqExt=frequencyExt[i];
        String keyLabel=String.valueOf(freqExt.getKey());
        if ("String_Node_Str".equals(keyLabel)) {
          keyLabel=SpecialValueDisplay.NULL_FIELD;
        }
        if ("String_Node_Str".equals(keyLabel)) {
          keyLabel=SpecialValueDisplay.EMPTY_FIELD;
        }
        customerdataset.addValue(freqExt.getValue(),"String_Node_Str",keyLabel);
        ChartDataEntity entity=new ChartDataEntity();
        entity.setIndicator(unit.getIndicator());
        entity.setKey(freqExt.getKey());
        entity.setLabelNull(freqExt.getKey() == null);
        entity.setLabel(keyLabel);
        entity.setValue(String.valueOf(freqExt.getValue()));
        Double percent=isWithRowCountIndicator() ? freqExt.getFrequency() : Double.NaN;
        entity.setPercent(percent);
        customerdataset.addDataEntity(entity);
      }
    }
  }
  return customerdataset;
}
Program: 138741
Project: 138741
Buggy source:
@Override public void run(){
  SelectedResources selectedResources=new SelectedResources();
  Property[] selectedProps=selectedResources.getSelectedArrayForDelForever();
  try {
    for (    Property property : selectedProps) {
      Item item=property.getItem();
      if (item instanceof ConnectionItem) {
        IRepositoryViewObject repViewObj=ProxyRepositoryViewObject.getRepositoryViewObjectByProperty(property);
        Property propertyTMP=repViewObj.getProperty();
        propertyTMP.getItem().getState().setDeleted(false);
        ProxyRepositoryFactory.getInstance().save(propertyTMP);
        EMFSharedResources.getInstance().unloadResource(property.eResource().getURI().toString());
      }
 else {
        property.getItem().getState().setDeleted(false);
        Resource propertyResource=property.eResource();
        if (!EMFSharedResources.getInstance().saveResource(propertyResource))         return;
      }
      LogicalDeleteFileHandle.refreshDelPropertys(0,property);
      if (property.getItem() instanceof ConnectionItem) {
        SQLExplorerPlugin.getDefault().getAliasManager().modelChanged();
      }
    }
  }
 catch (  Exception exc) {
    log.error(exc,exc);
  }
  ProxyRepositoryManager.getInstance().save();
  CorePlugin.getDefault().refreshDQView();
  CorePlugin.getDefault().refreshWorkSpace();
}

Fixed version (ground truth):
@Override public void run(){
  SelectedResources selectedResources=new SelectedResources();
  Property[] selectedProps=selectedResources.getSelectedArrayForDelForever();
  try {
    for (    Property property : selectedProps) {
      Item item=property.getItem();
      if (item instanceof ConnectionItem) {
        IRepositoryViewObject repViewObj=ProxyRepositoryViewObject.getRepositoryViewObjectByProperty(property);
        Property propertyTMP=repViewObj.getProperty();
        propertyTMP.getItem().getState().setDeleted(false);
        ProxyRepositoryFactory.getInstance().save(propertyTMP);
      }
 else {
        property.getItem().getState().setDeleted(false);
        Resource propertyResource=property.eResource();
        if (!EMFSharedResources.getInstance().saveResource(propertyResource))         return;
      }
      LogicalDeleteFileHandle.refreshDelPropertys(0,property);
      if (property.getItem() instanceof ConnectionItem) {
        SQLExplorerPlugin.getDefault().getAliasManager().modelChanged();
      }
    }
  }
 catch (  Exception exc) {
    log.error(exc,exc);
  }
  ProxyRepositoryManager.getInstance().save();
  CorePlugin.getDefault().refreshDQView();
  CorePlugin.getDefault().refreshWorkSpace();
}
Program: 138742
Project: 138742
Buggy source:
/** 
 * DOC bZhou RepositoryViewObjectHandle constructor comment.
 * @param property
 */
RepositoryViewObjectHandle(Property property){
  this.property=property;
  repositoryObject=ProxyRepositoryViewObject.getRepositoryViewObjectByProperty(property);
}

Fixed version (ground truth):
/** 
 * DOC bZhou RepositoryViewObjectHandle constructor comment.
 * @param property
 */
RepositoryViewObjectHandle(Property property){
  if (property.eIsProxy()) {
    property=(Property)EObjectHelper.resolveObject(property);
  }
  this.property=property;
  repositoryObject=ProxyRepositoryViewObject.getRepositoryViewObjectByProperty(property);
}
Program: 138743
Project: 138743
Buggy source:
public boolean delete() throws Exception {
  String pathStr=property.eResource().getURI().toPlatformString(false);
  IFile file=ResourceManager.getRoot().getFile(new Path(pathStr));
  if (isPhysicalDelete()) {
    ProxyRepositoryFactory.getInstance().deleteObjectPhysical(repositoryObject);
    LogicalDeleteFileHandle.refreshDelPropertys(0,property);
    EMFSharedResources.getInstance().unloadResource(property.eResource().getURI().toString());
  }
 else {
    ProxyRepositoryFactory.getInstance().deleteObjectLogical(repositoryObject);
    LogicalDeleteFileHandle.deleteLogical(file);
  }
  return true;
}

Fixed version (ground truth):
public boolean delete() throws Exception {
  if (property.eIsProxy()) {
    LogicalDeleteFileHandle.refreshDelPropertys(0,property);
    property=(Property)EObjectHelper.resolveObject(property);
  }
  String pathStr=property.eResource().getURI().toPlatformString(false);
  IFile file=ResourceManager.getRoot().getFile(new Path(pathStr));
  if (isPhysicalDelete()) {
    ProxyRepositoryFactory.getInstance().deleteObjectPhysical(repositoryObject);
    LogicalDeleteFileHandle.refreshDelPropertys(0,property);
  }
 else {
    ProxyRepositoryFactory.getInstance().deleteObjectLogical(repositoryObject);
    LogicalDeleteFileHandle.deleteLogical(file);
  }
  return true;
}
Program: 138744
Project: 138744
Buggy source:
public void migration(IProgressMonitor monitor){
  List<IMigrationTask> modelTasks=new ArrayList<IMigrationTask>();
  if (versionFile != null && versionFile.exists()) {
    ProductVersion version=WorkspaceVersionHelper.getVesion(new Path(versionFile.getAbsolutePath()));
    List<IMigrationTask> taskList=MigrationTaskManager.findWorkspaceTaskByType(MigrationTaskType.FILE,version);
    if (!taskList.isEmpty()) {
      for (      IMigrationTask task : taskList) {
        if (isModelTask(task)) {
          ((AbstractWorksapceUpdateTask)task).setWorkspacePath(basePath);
          modelTasks.add(task);
        }
 else {
          commTasks.add(task);
        }
      }
    }
  }
  if (!modelTasks.isEmpty()) {
    MigrationTaskManager.doMigrationTask(modelTasks,monitor);
  }
}

Fixed version (ground truth):
public void migration(IProgressMonitor monitor){
  List<IMigrationTask> modelTasks=new ArrayList<IMigrationTask>();
  if (versionFile != null && versionFile.exists()) {
    ProductVersion version=WorkspaceVersionHelper.getVesion(new Path(versionFile.getAbsolutePath()));
    List<IMigrationTask> taskList=MigrationTaskManager.findWorkspaceTaskByType(MigrationTaskType.FILE,version);
    if (!taskList.isEmpty()) {
      for (      IMigrationTask task : taskList) {
        if (task.isModelTask()) {
          ((AbstractWorksapceUpdateTask)task).setWorkspacePath(basePath);
          modelTasks.add(task);
        }
 else {
          commTasks.add(task);
        }
      }
    }
  }
  if (!modelTasks.isEmpty()) {
    MigrationTaskManager.doMigrationTask(modelTasks,monitor);
  }
}
Program: 138746
Project: 138746
Buggy source:
protected void reloadDataproviderAndFillConnCombo(){
  Collection<Connection> connections=ProxyRepositoryViewObject.getAllMetadataConnections(true);
  int index=0;
  connCombo.removeAll();
  for (  Connection prov : connections) {
    connCombo.add(prov.getName(),index);
    connCombo.setData(prov.getName(),index);
    connCombo.setData(index + "String_Node_Str",prov);
    index++;
  }
  if (index > 0) {
    connCombo.select(0);
  }
}

Fixed version (ground truth):
protected void reloadDataproviderAndFillConnCombo(){
  Collection<Connection> connections=ProxyRepositoryViewObject.getAllMetadataConnections(true);
  int index=0;
  connCombo.removeAll();
  for (  Connection prov : connections) {
    if (prov.eResource() == null) {
      prov=(Connection)EObjectHelper.resolveObject(prov);
    }
    connCombo.add(prov.getName(),index);
    connCombo.setData(prov.getName(),index);
    connCombo.setData(index + "String_Node_Str",prov);
    index++;
  }
  if (index > 0) {
    connCombo.select(0);
  }
}
Program: 138747
Project: 138747
Buggy source:
@SuppressWarnings("String_Node_Str") public Object[] getChildren(Object parentElement){
  if (parentElement instanceof IContainer) {
    IContainer container=((IContainer)parentElement);
    IResource[] members=null;
    try {
      members=container.members();
    }
 catch (    CoreException e) {
      log.error(DefaultMessagesImpl.getString("String_Node_Str") + container.getLocation());
    }
    if (container.equals(ResourceManager.getConnectionFolder())) {
      ComparatorsFactory.sort(members,ComparatorsFactory.FILEMODEL_COMPARATOR_ID);
    }
    if (ResourceManager.getConnectionFolder().equals(container)) {
      return ProxyRepositoryViewObject.fetchAllDBRepositoryViewObjects(false).toArray();
    }
 else     if (ResourceManager.getMDMConnectionFolder().equals(container)) {
      return ProxyRepositoryViewObject.fetchAllMDMRepositoryViewObjects(false).toArray();
    }
    return members;
  }
 else   if (parentElement instanceof Schema) {
    return null;
  }
 else   if (parentElement instanceof Catalog) {
    Catalog catalog=(Catalog)parentElement;
    EList<ModelElement> eList=catalog.getOwnedElement();
    if (!(eList.size() > 0 && eList.get(0) instanceof Schema)) {
      return null;
    }
  }
  return super.getChildren(parentElement);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public Object[] getChildren(Object parentElement){
  if (parentElement instanceof IContainer) {
    IContainer container=((IContainer)parentElement);
    IResource[] members=null;
    try {
      members=container.members();
    }
 catch (    CoreException e) {
      log.error(DefaultMessagesImpl.getString("String_Node_Str") + container.getLocation());
    }
    if (container.equals(ResourceManager.getConnectionFolder())) {
      ComparatorsFactory.sort(members,ComparatorsFactory.FILEMODEL_COMPARATOR_ID);
    }
    if (ResourceManager.getConnectionFolder().equals(container)) {
      return ProxyRepositoryViewObject.fetchAllDBRepositoryViewObjects(true).toArray();
    }
 else     if (ResourceManager.getMDMConnectionFolder().equals(container)) {
      return ProxyRepositoryViewObject.fetchAllMDMRepositoryViewObjects(true).toArray();
    }
    return members;
  }
 else   if (parentElement instanceof Schema) {
    return null;
  }
 else   if (parentElement instanceof Catalog) {
    Catalog catalog=(Catalog)parentElement;
    EList<ModelElement> eList=catalog.getOwnedElement();
    if (!(eList.size() > 0 && eList.get(0) instanceof Schema)) {
      return null;
    }
  }
  return super.getChildren(parentElement);
}