nus-yam/ex-repair huggingface dataset:
Program: 126586
Project: 126586
Buggy source:
protected Project computeProject(ResourcesManager manager,ImportItem importItem,IPath path){
  InputStream stream=null;
  Map<IPath,Project> pathWithProjects=ImportCacheHelper.getInstance().getPathWithProjects();
  try {
    if (!pathWithProjects.containsKey(path)) {
      stream=manager.getStream(path);
      Resource resource=createResource(importItem,path,false);
      resource.load(stream,null);
      pathWithProjects.put(path,(Project)EcoreUtil.getObjectByType(resource.getContents(),PropertiesPackage.eINSTANCE.getProject()));
    }
    return pathWithProjects.get(path);
  }
 catch (  IOException e) {
  }
 finally {
    if (stream != null) {
      try {
        stream.close();
      }
 catch (      IOException e) {
      }
    }
  }
  return null;
}

Fixed version (ground truth):
protected Project computeProject(ResourcesManager manager,ImportItem importItem,IPath path){
  InputStream stream=null;
  Map<IPath,Project> pathWithProjects=ImportCacheHelper.getInstance().getPathWithProjects();
  try {
    if (!pathWithProjects.containsKey(path)) {
      stream=manager.getStream(path);
      Resource resource=createResource(importItem,path,false);
      resource.load(stream,null);
      pathWithProjects.put(path,(Project)EcoreUtil.getObjectByType(resource.getContents(),PropertiesPackage.eINSTANCE.getProject()));
    }
    return pathWithProjects.get(path);
  }
 catch (  IOException e) {
    if (Platform.inDebugMode()) {
      ExceptionHandler.process(e);
    }
  }
 finally {
    if (stream != null) {
      try {
        stream.close();
      }
 catch (      IOException e) {
      }
    }
  }
  return null;
}
Program: 126587
Project: 126587
Buggy source:
@Override public void checkInstalledLibraries(){
  Set<String> existLibraries=repositoryBundleService.list();
  Set<String> existDllLibraries=repositoryBundleService.listAllDllFiles();
  existLibraries.addAll(existDllLibraries);
  List<ModuleNeeded> toCheck=ModulesNeededProvider.getModulesNeeded();
  for (  ModuleNeeded current : toCheck) {
    if (existLibraries.contains(current.getModuleName())) {
      current.setStatus(ELibraryInstallStatus.INSTALLED);
    }
 else {
      current.setStatus(ELibraryInstallStatus.NOT_INSTALLED);
    }
  }
  List<String> modulesNeededNames=ModulesNeededProvider.getModulesNeededNames();
  ModulesNeededProvider.getUnUsedModules().clear();
  for (  String library : existLibraries) {
    if (!modulesNeededNames.contains(library)) {
      ModulesNeededProvider.userAddUnusedModules("String_Node_Str",library);
    }
  }
}

Fixed version (ground truth):
@Override public void checkInstalledLibraries(){
  Set<String> existLibraries=repositoryBundleService.list(false);
  Set<String> existDllLibraries=repositoryBundleService.listAllDllFiles();
  existLibraries.addAll(existDllLibraries);
  List<ModuleNeeded> toCheck=ModulesNeededProvider.getModulesNeeded();
  for (  ModuleNeeded current : toCheck) {
    if (existLibraries.contains(current.getModuleName())) {
      current.setStatus(ELibraryInstallStatus.INSTALLED);
    }
 else {
      current.setStatus(ELibraryInstallStatus.NOT_INSTALLED);
    }
  }
  List<String> modulesNeededNames=ModulesNeededProvider.getModulesNeededNames();
  ModulesNeededProvider.getUnUsedModules().clear();
  for (  String library : existLibraries) {
    if (!modulesNeededNames.contains(library)) {
      ModulesNeededProvider.userAddUnusedModules("String_Node_Str",library);
    }
  }
}
Program: 126589
Project: 126589
Buggy source:
@Override protected void afterCreatedItem(ResourcesManager resManager,ImportItem selectedItemRecord) throws Exception {
  final Item tmpItem=selectedItemRecord.getItem();
  boolean isConnectionEmptyBeforeMigration=tmpItem instanceof ConnectionItem && ((ConnectionItem)tmpItem).getConnection().eResource() == null && !selectedItemRecord.getMigrationTasksToApply().isEmpty();
  if (isConnectionEmptyBeforeMigration) {
    InputStream is=resManager.getStream(selectedItemRecord.getPath().removeFileExtension().addFileExtension(FileConstants.ITEM_EXTENSION));
    try {
      URI propertyResourceURI=EcoreUtil.getURI(((ConnectionItem)tmpItem).getProperty());
      URI relativePlateformDestUri=propertyResourceURI.trimFileExtension().appendFileExtension(FileConstants.ITEM_EXTENSION);
      URL fileURL=FileLocator.toFileURL(new java.net.URL("String_Node_Str" + relativePlateformDestUri.toPlatformString(true)));
      OutputStream os=new FileOutputStream(fileURL.getFile());
      try {
        FileCopyUtils.copyStreams(is,os);
      }
  finally {
        os.close();
      }
    }
  finally {
      is.close();
    }
    ProxyRepositoryFactory repFactory=ProxyRepositoryFactory.getInstance();
    repFactory.unloadResources(tmpItem.getProperty());
  }
 else {
    super.afterCreatedItem(resManager,selectedItemRecord);
  }
}

Fixed version (ground truth):
@Override protected void afterCreatedItem(ResourcesManager resManager,ImportItem selectedItemRecord) throws Exception {
  final Item tmpItem=selectedItemRecord.getItem();
  if (isConnectionEmptyBeforeMigration) {
    InputStream is=resManager.getStream(selectedItemRecord.getPath().removeFileExtension().addFileExtension(FileConstants.ITEM_EXTENSION));
    try {
      URI propertyResourceURI=EcoreUtil.getURI(((ConnectionItem)tmpItem).getProperty());
      URI relativePlateformDestUri=propertyResourceURI.trimFileExtension().appendFileExtension(FileConstants.ITEM_EXTENSION);
      URL fileURL=FileLocator.toFileURL(new java.net.URL("String_Node_Str" + relativePlateformDestUri.toPlatformString(true)));
      OutputStream os=new FileOutputStream(fileURL.getFile());
      try {
        FileCopyUtils.copyStreams(is,os);
      }
  finally {
        os.close();
      }
    }
  finally {
      is.close();
    }
    ProxyRepositoryFactory repFactory=ProxyRepositoryFactory.getInstance();
    repFactory.unloadResources(tmpItem.getProperty());
  }
 else {
    super.afterCreatedItem(resManager,selectedItemRecord);
  }
}
Program: 126590
Project: 126590
Buggy source:
@Override protected void afterCreatedItem(ResourcesManager resManager,ImportItem importItem) throws Exception {
  final Item tmpItem=importItem.getItem();
  boolean isConnectionEmptyBeforeMigration=tmpItem instanceof ConnectionItem && ((ConnectionItem)tmpItem).getConnection().eResource() == null && !importItem.getMigrationTasksToApply().isEmpty();
  if (isConnectionEmptyBeforeMigration) {
    InputStream is=resManager.getStream(importItem.getPath().removeFileExtension().addFileExtension(FileConstants.ITEM_EXTENSION));
    try {
      URI propertyResourceURI=EcoreUtil.getURI(((ConnectionItem)tmpItem).getProperty());
      URI relativePlateformDestUri=propertyResourceURI.trimFileExtension().appendFileExtension(FileConstants.ITEM_EXTENSION);
      URL fileURL=FileLocator.toFileURL(new java.net.URL("String_Node_Str" + relativePlateformDestUri.toPlatformString(true)));
      OutputStream os=new FileOutputStream(fileURL.getFile());
      try {
        FileCopyUtils.copyStreams(is,os);
      }
  finally {
        os.close();
      }
    }
  finally {
      is.close();
    }
    ProxyRepositoryFactory repFactory=ProxyRepositoryFactory.getInstance();
    repFactory.unloadResources(tmpItem.getProperty());
  }
 else {
    super.afterCreatedItem(resManager,importItem);
  }
}

Fixed version (ground truth):
@Override protected void afterCreatedItem(ResourcesManager resManager,ImportItem importItem) throws Exception {
  final Item tmpItem=importItem.getItem();
  if (isConnectionEmptyBeforeMigration) {
    InputStream is=resManager.getStream(importItem.getPath().removeFileExtension().addFileExtension(FileConstants.ITEM_EXTENSION));
    try {
      URI propertyResourceURI=EcoreUtil.getURI(((ConnectionItem)tmpItem).getProperty());
      URI relativePlateformDestUri=propertyResourceURI.trimFileExtension().appendFileExtension(FileConstants.ITEM_EXTENSION);
      URL fileURL=FileLocator.toFileURL(new java.net.URL("String_Node_Str" + relativePlateformDestUri.toPlatformString(true)));
      OutputStream os=new FileOutputStream(fileURL.getFile());
      try {
        FileCopyUtils.copyStreams(is,os);
      }
  finally {
        os.close();
      }
    }
  finally {
      is.close();
    }
    ProxyRepositoryFactory repFactory=ProxyRepositoryFactory.getInstance();
    repFactory.unloadResources(tmpItem.getProperty());
  }
 else {
    super.afterCreatedItem(resManager,importItem);
  }
}
Program: 126591
Project: 126591
Buggy source:
@Override public void checkInstalledLibraries(){
  Set<String> existLibraries=repositoryBundleService.list();
  Set<String> existDllLibraries=repositoryBundleService.listAllDllFiles();
  existLibraries.addAll(existDllLibraries);
  List<ModuleNeeded> toCheck=ModulesNeededProvider.getModulesNeeded();
  for (  ModuleNeeded current : toCheck) {
    if (existLibraries.contains(current.getModuleName())) {
      current.setStatus(ELibraryInstallStatus.INSTALLED);
    }
 else {
      current.setStatus(ELibraryInstallStatus.NOT_INSTALLED);
    }
  }
  List<String> modulesNeededNames=ModulesNeededProvider.getModulesNeededNames();
  ModulesNeededProvider.getUnUsedModules().clear();
  for (  String library : existLibraries) {
    if (!modulesNeededNames.contains(library)) {
      ModulesNeededProvider.userAddUnusedModules("String_Node_Str",library);
    }
  }
}

Fixed version (ground truth):
@Override public void checkInstalledLibraries(){
  Set<String> existLibraries=repositoryBundleService.list(false);
  Set<String> existDllLibraries=repositoryBundleService.listAllDllFiles();
  existLibraries.addAll(existDllLibraries);
  List<ModuleNeeded> toCheck=ModulesNeededProvider.getModulesNeeded();
  for (  ModuleNeeded current : toCheck) {
    if (existLibraries.contains(current.getModuleName())) {
      current.setStatus(ELibraryInstallStatus.INSTALLED);
    }
 else {
      current.setStatus(ELibraryInstallStatus.NOT_INSTALLED);
    }
  }
  List<String> modulesNeededNames=ModulesNeededProvider.getModulesNeededNames();
  ModulesNeededProvider.getUnUsedModules().clear();
  for (  String library : existLibraries) {
    if (!modulesNeededNames.contains(library)) {
      ModulesNeededProvider.userAddUnusedModules("String_Node_Str",library);
    }
  }
}
Program: 126595
Project: 126595
Buggy source:
public static boolean isOracle(DatabaseMetaData metadata){
  if (metadata != null) {
    try {
      String name=metadata.getDatabaseProductName().toUpperCase();
      if (name != null && name.equals(EDatabaseTypeName.ORACLEFORSID.getProduct().toUpperCase())) {
        return true;
      }
    }
 catch (    SQLException e) {
      ExceptionHandler.process(e);
    }
  }
  return false;
}

Fixed version (ground truth):
public static boolean isOracle(DatabaseMetaData metadata){
  if (metadata != null) {
    try {
      String name=metadata.getDatabaseProductName();
      if (name != null && name.toUpperCase().equals(EDatabaseTypeName.ORACLEFORSID.getProduct().toUpperCase())) {
        return true;
      }
    }
 catch (    SQLException e) {
      ExceptionHandler.process(e);
    }
  }
  return false;
}
Program: 126596
Project: 126596
Buggy source:
/** 
 * DOC YeXiaowei Comment method "hidePassword".
 * @param password
 * @return
 */
public static String hidePassword(final String password){
  if (password == null) {
    return "String_Node_Str";
  }
  if (password.startsWith(ContextParameterUtils.JAVA_NEW_CONTEXT_PREFIX)) {
    String variableName=password.substring(ContextParameterUtils.JAVA_NEW_CONTEXT_PREFIX.length(),password.length());
    if (!ContextUtils.isJavaKeyWords(variableName)) {
      return password;
    }
  }
  int length=password.length() + 2;
  StringBuilder builder=new StringBuilder();
  for (int i=0; i < length; i++) {
    builder.append(PASS_COVER);
  }
  return builder.toString();
}

Fixed version (ground truth):
/** 
 * DOC YeXiaowei Comment method "hidePassword".
 * @param password
 * @return
 */
public static String hidePassword(final String password){
  if (password == null) {
    return "String_Node_Str";
  }
  String testPassword=password.trim();
  if (testPassword.startsWith(ContextParameterUtils.JAVA_NEW_CONTEXT_PREFIX)) {
    String variableName=testPassword.substring(ContextParameterUtils.JAVA_NEW_CONTEXT_PREFIX.length(),testPassword.length());
    if (!ContextUtils.isJavaKeyWords(variableName)) {
      return password;
    }
  }
  int length=password.length() + 2;
  StringBuilder builder=new StringBuilder();
  for (int i=0; i < length; i++) {
    builder.append(PASS_COVER);
  }
  return builder.toString();
}
Program: 126597
Project: 126597
Buggy source:
@Test public void testIsSame4DiffId(){
  ItemRecord itemRecord1=mock(ItemRecord.class);
  Property property1=mock(Property.class);
  when(itemRecord1.getProperty()).thenReturn(property1);
  when(property1.getId()).thenReturn("String_Node_Str");
  when(property1.getVersion()).thenReturn("String_Node_Str");
  ItemRecord itemRecord2=mock(ItemRecord.class);
  Property property2=mock(Property.class);
  when(itemRecord2.getProperty()).thenReturn(property2);
  when(property2.getId()).thenReturn("String_Node_Str");
  when(property2.getVersion()).thenReturn("String_Node_Str");
  ImportBasicHandler basicHandler=new ImportBasicHandler();
  Assert.assertFalse(basicHandler.isSame(itemRecord1,itemRecord2));
}

Fixed version (ground truth):
@Test public void testIsSame4DiffId(){
  ImportItem ImportItem1=mock(ImportItem.class);
  Property property1=mock(Property.class);
  when(ImportItem1.getProperty()).thenReturn(property1);
  when(property1.getId()).thenReturn("String_Node_Str");
  when(property1.getVersion()).thenReturn("String_Node_Str");
  ImportItem ImportItem2=mock(ImportItem.class);
  Property property2=mock(Property.class);
  when(ImportItem2.getProperty()).thenReturn(property2);
  when(property2.getId()).thenReturn("String_Node_Str");
  when(property2.getVersion()).thenReturn("String_Node_Str");
  ImportBasicHandler basicHandler=new ImportBasicHandler();
  Assert.assertFalse(basicHandler.isSame(ImportItem1,ImportItem2));
}
Program: 126598
Project: 126598
Buggy source:
@Test public void testIsSameName(){
  ItemRecord itemRecord1=mock(ItemRecord.class);
  Property property1=mock(Property.class);
  when(itemRecord1.getProperty()).thenReturn(property1);
  when(property1.getLabel()).thenReturn("String_Node_Str");
  IRepositoryViewObject repViewObj=mock(IRepositoryViewObject.class);
  when(repViewObj.getLabel()).thenReturn("String_Node_Str");
  ImportBasicHandler basicHandler=new ImportBasicHandler();
  Assert.assertTrue(basicHandler.isSameName(itemRecord1,repViewObj));
}

Fixed version (ground truth):
@Test public void testIsSameName(){
  ImportItem ImportItem1=mock(ImportItem.class);
  Property property1=mock(Property.class);
  when(ImportItem1.getProperty()).thenReturn(property1);
  when(property1.getLabel()).thenReturn("String_Node_Str");
  IRepositoryViewObject repViewObj=mock(IRepositoryViewObject.class);
  when(repViewObj.getLabel()).thenReturn("String_Node_Str");
  ImportBasicHandler basicHandler=new ImportBasicHandler();
  Assert.assertTrue(basicHandler.isSameName(ImportItem1,repViewObj));
}
Program: 126599
Project: 126599
Buggy source:
@Test public void testIsSame4DiffVersion(){
  ItemRecord itemRecord1=mock(ItemRecord.class);
  Property property1=mock(Property.class);
  when(itemRecord1.getProperty()).thenReturn(property1);
  when(property1.getId()).thenReturn("String_Node_Str");
  when(property1.getVersion()).thenReturn("String_Node_Str");
  ItemRecord itemRecord2=mock(ItemRecord.class);
  Property property2=mock(Property.class);
  when(itemRecord2.getProperty()).thenReturn(property2);
  when(property2.getId()).thenReturn("String_Node_Str");
  when(property2.getVersion()).thenReturn("String_Node_Str");
  ImportBasicHandler basicHandler=new ImportBasicHandler();
  Assert.assertFalse(basicHandler.isSame(itemRecord1,itemRecord2));
}

Fixed version (ground truth):
@Test public void testIsSame4DiffVersion(){
  ImportItem ImportItem1=mock(ImportItem.class);
  Property property1=mock(Property.class);
  when(ImportItem1.getProperty()).thenReturn(property1);
  when(property1.getId()).thenReturn("String_Node_Str");
  when(property1.getVersion()).thenReturn("String_Node_Str");
  ImportItem ImportItem2=mock(ImportItem.class);
  Property property2=mock(Property.class);
  when(ImportItem2.getProperty()).thenReturn(property2);
  when(property2.getId()).thenReturn("String_Node_Str");
  when(property2.getVersion()).thenReturn("String_Node_Str");
  ImportBasicHandler basicHandler=new ImportBasicHandler();
  Assert.assertFalse(basicHandler.isSame(ImportItem1,ImportItem2));
}
Program: 126600
Project: 126600
Buggy source:
@Test public void testLoadItemResource() throws Exception {
  ImportBasicHandler basicHandler=new ImportBasicHandler();
  ItemRecord itemRecord=new ItemRecord(processPropPath1);
  itemRecord.setItemName(processPropPath1.lastSegment());
  Property property=mock(Property.class);
  itemRecord.setProperty(property);
  ResourcesManager resManager=mock(ResourcesManager.class);
  Set<IPath> pathes=new HashSet<IPath>();
  IPath projPath=new Path("String_Node_Str" + FileConstants.LOCAL_PROJECT_FILENAME);
  pathes.add(projPath);
  pathes.add(processPropPath1);
  pathes.add(processItemPath1);
  when(resManager.getPaths()).thenReturn(pathes);
  Resource resource=basicHandler.loadResource(resManager,itemRecord);
  Assert.assertNull(resource);
}

Fixed version (ground truth):
@Test public void testLoadItemResource() throws Exception {
  ImportBasicHandler basicHandler=new ImportBasicHandler();
  ImportItem ImportItem=new ImportItem(processPropPath1);
  ImportItem.setItemName(processPropPath1.lastSegment());
  Property property=mock(Property.class);
  ImportItem.setProperty(property);
  ResourcesManager resManager=mock(ResourcesManager.class);
  Set<IPath> pathes=new HashSet<IPath>();
  IPath projPath=new Path("String_Node_Str" + FileConstants.LOCAL_PROJECT_FILENAME);
  pathes.add(projPath);
  pathes.add(processPropPath1);
  pathes.add(processItemPath1);
  when(resManager.getPaths()).thenReturn(pathes);
  Resource resource=basicHandler.loadResource(resManager,ImportItem);
  Assert.assertNull(resource);
}
Program: 126601
Project: 126601
Buggy source:
@Test public void testCheckAndSetProject4NoProject(){
  ImportBasicHandler basicHandler=new ImportBasicHandler();
  ItemRecord itemRecord=new ItemRecord(processPropPath1);
  Property property=mock(Property.class);
  itemRecord.setProperty(property);
  ProcessItem item=PropertiesFactory.eINSTANCE.createProcessItem();
  when(property.getItem()).thenReturn(item);
  ResourcesManager resManager=mock(ResourcesManager.class);
  basicHandler.checkAndSetProject(resManager,itemRecord);
  Assert.assertFalse(itemRecord.getErrors().isEmpty());
  Assert.assertFalse(itemRecord.isValid());
  Assert.assertTrue(itemRecord.getErrors().size() == 1);
}

Fixed version (ground truth):
@Test public void testCheckAndSetProject4NoProject(){
  ImportBasicHandler basicHandler=new ImportBasicHandler();
  ImportItem ImportItem=new ImportItem(processPropPath1);
  Property property=mock(Property.class);
  ImportItem.setProperty(property);
  ProcessItem item=PropertiesFactory.eINSTANCE.createProcessItem();
  when(property.getItem()).thenReturn(item);
  ResourcesManager resManager=mock(ResourcesManager.class);
  basicHandler.checkAndSetProject(resManager,ImportItem);
  Assert.assertFalse(ImportItem.getErrors().isEmpty());
  Assert.assertFalse(ImportItem.isValid());
  Assert.assertTrue(ImportItem.getErrors().size() == 1);
}
Program: 126602
Project: 126602
Buggy source:
@Test public void testCreateResource() throws Exception {
  ImportBasicHandler basicHandler=new ImportBasicHandler();
  ItemRecord processItemRecord=new ItemRecord(processItemPath1);
  Resource processItemResource=basicHandler.createResource(processItemRecord,processItemPath1,false);
  Assert.assertTrue(processItemResource != null);
  Assert.assertTrue(processItemResource.getURI().fileExtension().equals("String_Node_Str"));
  ItemRecord propertyRecord=new ItemRecord(processPropPath1);
  Resource propertyResource=basicHandler.createResource(propertyRecord,processPropPath1,false);
  Assert.assertTrue(propertyResource != null);
  Assert.assertTrue(propertyResource.getURI().fileExtension().equals("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testCreateResource() throws Exception {
  ImportBasicHandler basicHandler=new ImportBasicHandler();
  ImportItem processImportItem=new ImportItem(processItemPath1);
  Resource processItemResource=basicHandler.createResource(processImportItem,processItemPath1,false);
  Assert.assertTrue(processItemResource != null);
  Assert.assertTrue(processItemResource.getURI().fileExtension().equals("String_Node_Str"));
  ImportItem propertyRecord=new ImportItem(processPropPath1);
  Resource propertyResource=basicHandler.createResource(propertyRecord,processPropPath1,false);
  Assert.assertTrue(propertyResource != null);
  Assert.assertTrue(propertyResource.getURI().fileExtension().equals("String_Node_Str"));
}
Program: 126603
Project: 126603
Buggy source:
@Test public void testIsSame(){
  ItemRecord itemRecord1=mock(ItemRecord.class);
  Property property1=mock(Property.class);
  when(itemRecord1.getProperty()).thenReturn(property1);
  when(property1.getId()).thenReturn("String_Node_Str");
  when(property1.getLabel()).thenReturn("String_Node_Str");
  ItemRecord itemRecord2=mock(ItemRecord.class);
  Property property2=mock(Property.class);
  when(itemRecord2.getProperty()).thenReturn(property2);
  when(property2.getId()).thenReturn("String_Node_Str");
  when(property2.getLabel()).thenReturn("String_Node_Str");
  ImportBasicHandler basicHandler=new ImportBasicHandler();
  Assert.assertTrue(basicHandler.isSame(itemRecord1,itemRecord2));
}

Fixed version (ground truth):
@Test public void testIsSame(){
  ImportItem ImportItem1=mock(ImportItem.class);
  Property property1=mock(Property.class);
  when(ImportItem1.getProperty()).thenReturn(property1);
  when(property1.getId()).thenReturn("String_Node_Str");
  when(property1.getLabel()).thenReturn("String_Node_Str");
  ImportItem ImportItem2=mock(ImportItem.class);
  Property property2=mock(Property.class);
  when(ImportItem2.getProperty()).thenReturn(property2);
  when(property2.getId()).thenReturn("String_Node_Str");
  when(property2.getLabel()).thenReturn("String_Node_Str");
  ImportBasicHandler basicHandler=new ImportBasicHandler();
  Assert.assertTrue(basicHandler.isSame(ImportItem1,ImportItem2));
}
Program: 126604
Project: 126604
Buggy source:
@Test public void testCheckItem() throws Exception {
  ImportBasicHandler basicHandler=new ImportBasicHandler();
  ItemRecord itemRecord=new ItemRecord(processPropPath1);
  itemRecord.setItemName(processPropPath1.lastSegment());
  Property property=mock(Property.class);
  itemRecord.setProperty(property);
  ProcessItem item=PropertiesFactory.eINSTANCE.createProcessItem();
  when(property.getItem()).thenReturn(item);
  ResourcesManager resManager=mock(ResourcesManager.class);
  Set<IPath> pathes=new HashSet<IPath>();
  IPath projPath=new Path("String_Node_Str" + FileConstants.LOCAL_PROJECT_FILENAME);
  pathes.add(projPath);
  pathes.add(processPropPath1);
  pathes.add(processItemPath1);
  Assert.assertFalse(basicHandler.checkItem(resManager,itemRecord,false));
  Assert.assertFalse(itemRecord.getErrors().isEmpty());
  ItemState itemState=PropertiesFactory.eINSTANCE.createItemState();
  item.setState(itemState);
  Assert.assertTrue(basicHandler.checkItem(resManager,itemRecord,false));
  itemRecord.setState(State.NAME_AND_ID_EXISTED);
  Assert.assertTrue(basicHandler.checkItem(resManager,itemRecord,true));
  Assert.assertTrue(basicHandler.checkItem(resManager,itemRecord,true));
  Assert.assertTrue(itemRecord.getErrors().size() == 1);
}

Fixed version (ground truth):
@Test public void testCheckItem() throws Exception {
  ImportBasicHandler basicHandler=new ImportBasicHandler();
  ImportItem ImportItem=new ImportItem(processPropPath1);
  ImportItem.setItemName(processPropPath1.lastSegment());
  Property property=mock(Property.class);
  ImportItem.setProperty(property);
  ProcessItem item=PropertiesFactory.eINSTANCE.createProcessItem();
  when(property.getItem()).thenReturn(item);
  ResourcesManager resManager=mock(ResourcesManager.class);
  Set<IPath> pathes=new HashSet<IPath>();
  IPath projPath=new Path("String_Node_Str" + FileConstants.LOCAL_PROJECT_FILENAME);
  pathes.add(projPath);
  pathes.add(processPropPath1);
  pathes.add(processItemPath1);
  Assert.assertFalse(basicHandler.checkItem(resManager,ImportItem,false));
  Assert.assertFalse(ImportItem.getErrors().isEmpty());
  ItemState itemState=PropertiesFactory.eINSTANCE.createItemState();
  item.setState(itemState);
  Assert.assertTrue(basicHandler.checkItem(resManager,ImportItem,false));
  ImportItem.setState(State.NAME_AND_ID_EXISTED);
  Assert.assertTrue(basicHandler.checkItem(resManager,ImportItem,true));
  Assert.assertTrue(basicHandler.checkItem(resManager,ImportItem,true));
  Assert.assertTrue(ImportItem.getErrors().size() == 1);
}
Program: 126605
Project: 126605
Buggy source:
@Test public void testResolveItem4ValidItem() throws Exception {
  ImportBasicHandler basicHandler=new ImportBasicHandler();
  ItemRecord itemRecord=new ItemRecord(processPropPath1);
  itemRecord.setItemName(processPropPath1.lastSegment());
  Property property=mock(Property.class);
  itemRecord.setProperty(property);
  ProcessItem processItem=createTempProcessItem();
  when(property.getItem()).thenReturn(processItem);
  ResourcesManager resManager=mock(ResourcesManager.class);
  Set<IPath> pathes=new HashSet<IPath>();
  IPath projPath=new Path("String_Node_Str" + FileConstants.LOCAL_PROJECT_FILENAME);
  pathes.add(projPath);
  pathes.add(processPropPath1);
  pathes.add(processItemPath1);
  when(resManager.getPaths()).thenReturn(pathes);
  when(resManager.getStream(processItemPath1)).thenReturn(new InputStream(){
    @Override public int read() throws IOException {
      return 1;
    }
  }
);
  basicHandler.resolveItem(resManager,itemRecord);
  Assert.assertTrue(itemRecord.getErrors().isEmpty());
  Assert.assertTrue(itemRecord.isValid());
  Assert.assertTrue(itemRecord.getErrors().size() == 0);
}

Fixed version (ground truth):
@Test public void testResolveItem4ValidItem() throws Exception {
  ImportBasicHandler basicHandler=new ImportBasicHandler();
  ImportItem ImportItem=new ImportItem(processPropPath1);
  ImportItem.setItemName(processPropPath1.lastSegment());
  Property property=mock(Property.class);
  ImportItem.setProperty(property);
  ProcessItem processItem=createTempProcessItem();
  when(property.getItem()).thenReturn(processItem);
  ResourcesManager resManager=mock(ResourcesManager.class);
  Set<IPath> pathes=new HashSet<IPath>();
  IPath projPath=new Path("String_Node_Str" + FileConstants.LOCAL_PROJECT_FILENAME);
  pathes.add(projPath);
  pathes.add(processPropPath1);
  pathes.add(processItemPath1);
  when(resManager.getPaths()).thenReturn(pathes);
  when(resManager.getStream(processItemPath1)).thenReturn(new InputStream(){
    @Override public int read() throws IOException {
      return 1;
    }
  }
);
  basicHandler.resolveItem(resManager,ImportItem);
  Assert.assertTrue(ImportItem.getErrors().isEmpty());
  Assert.assertTrue(ImportItem.isValid());
  Assert.assertTrue(ImportItem.getErrors().size() == 0);
}
Program: 126606
Project: 126606
Buggy source:
@Test public void testIsSameName4DiffLabel(){
  ItemRecord itemRecord1=mock(ItemRecord.class);
  Property property1=mock(Property.class);
  when(itemRecord1.getProperty()).thenReturn(property1);
  when(property1.getLabel()).thenReturn("String_Node_Str");
  IRepositoryViewObject repViewObj=mock(IRepositoryViewObject.class);
  when(repViewObj.getLabel()).thenReturn("String_Node_Str");
  ImportBasicHandler basicHandler=new ImportBasicHandler();
  Assert.assertFalse(basicHandler.isSameName(itemRecord1,repViewObj));
}

Fixed version (ground truth):
@Test public void testIsSameName4DiffLabel(){
  ImportItem ImportItem1=mock(ImportItem.class);
  Property property1=mock(Property.class);
  when(ImportItem1.getProperty()).thenReturn(property1);
  when(property1.getLabel()).thenReturn("String_Node_Str");
  IRepositoryViewObject repViewObj=mock(IRepositoryViewObject.class);
  when(repViewObj.getLabel()).thenReturn("String_Node_Str");
  ImportBasicHandler basicHandler=new ImportBasicHandler();
  Assert.assertFalse(basicHandler.isSameName(ImportItem1,repViewObj));
}
Program: 126607
Project: 126607
Buggy source:
@Test public void testResolveItem4MissItemFile() throws Exception {
  ImportBasicHandler basicHandler=new ImportBasicHandler();
  ItemRecord itemRecord=new ItemRecord(processPropPath1);
  itemRecord.setItemName(processPropPath1.lastSegment());
  Property property=mock(Property.class);
  itemRecord.setProperty(property);
  ProcessItem item=PropertiesFactory.eINSTANCE.createProcessItem();
  when(property.getItem()).thenReturn(item);
  ResourcesManager resManager=mock(ResourcesManager.class);
  Set<IPath> pathes=new HashSet<IPath>();
  IPath projPath=new Path("String_Node_Str" + FileConstants.LOCAL_PROJECT_FILENAME);
  pathes.add(projPath);
  pathes.add(processPropPath1);
  when(resManager.getPaths()).thenReturn(pathes);
  basicHandler.resolveItem(resManager,itemRecord);
  Assert.assertFalse(itemRecord.getErrors().isEmpty());
  Assert.assertFalse(itemRecord.isValid());
  Assert.assertTrue(itemRecord.getErrors().size() == 1);
}

Fixed version (ground truth):
@Test public void testResolveItem4MissItemFile() throws Exception {
  ImportBasicHandler basicHandler=new ImportBasicHandler();
  ImportItem ImportItem=new ImportItem(processPropPath1);
  ImportItem.setItemName(processPropPath1.lastSegment());
  Property property=mock(Property.class);
  ImportItem.setProperty(property);
  ProcessItem item=PropertiesFactory.eINSTANCE.createProcessItem();
  when(property.getItem()).thenReturn(item);
  ResourcesManager resManager=mock(ResourcesManager.class);
  Set<IPath> pathes=new HashSet<IPath>();
  IPath projPath=new Path("String_Node_Str" + FileConstants.LOCAL_PROJECT_FILENAME);
  pathes.add(projPath);
  pathes.add(processPropPath1);
  when(resManager.getPaths()).thenReturn(pathes);
  basicHandler.resolveItem(resManager,ImportItem);
  Assert.assertFalse(ImportItem.getErrors().isEmpty());
  Assert.assertFalse(ImportItem.isValid());
  Assert.assertTrue(ImportItem.getErrors().size() == 1);
}
Program: 126608
Project: 126608
Buggy source:
/** 
 * DOC YeXiaowei Comment method "hidePassword".
 * @param password
 * @return
 */
public static String hidePassword(final String password){
  if (password == null) {
    return "String_Node_Str";
  }
  int length=password.length() + 2;
  StringBuilder builder=new StringBuilder();
  for (int i=0; i < length; i++) {
    builder.append(PASS_COVER);
  }
  return builder.toString();
}

Fixed version (ground truth):
/** 
 * DOC YeXiaowei Comment method "hidePassword".
 * @param password
 * @return
 */
public static String hidePassword(final String password){
  if (password == null) {
    return "String_Node_Str";
  }
  if (password.startsWith(ContextParameterUtils.JAVA_NEW_CONTEXT_PREFIX)) {
    String variableName=password.substring(ContextParameterUtils.JAVA_NEW_CONTEXT_PREFIX.length(),password.length());
    if (!ContextUtils.isJavaKeyWords(variableName)) {
      return password;
    }
  }
  int length=password.length() + 2;
  StringBuilder builder=new StringBuilder();
  for (int i=0; i < length; i++) {
    builder.append(PASS_COVER);
  }
  return builder.toString();
}
Program: 126609
Project: 126609
Buggy source:
/** 
 * Removes the column from metadatatable by the name identified, created by Marvin Wang on May 21, 2012.
 * @param orignalColumnName
 * @return the index removed. If no need to remove, return -1.
 */
protected synchronized int removeOriginalColumn(String orignalColumnName){
  int index=-1;
  EList<MetadataColumn> columns=metadataTable.getColumns();
  if (columns != null && !columns.isEmpty()) {
    for (int i=0; i < columns.size(); i++) {
      MetadataColumn mdColumn=columns.get(i);
      String name=mdColumn.getLabel();
      if (name != null && name.equals(orignalColumnName)) {
        metadataTable.getColumns().remove(i);
        index=i;
      }
    }
  }
  return index;
}

Fixed version (ground truth):
/** 
 * Removes the column from metadatatable by the name identified, created by Marvin Wang on May 21, 2012.
 * @param orignalColumnName
 * @return the index removed. If no need to remove, return -1.
 */
protected synchronized int removeOriginalColumn(String orignalColumnName){
  int index=-1;
  EList<MetadataColumn> columns=metadataTable.getColumns();
  if (columns != null && !columns.isEmpty()) {
    for (int i=columns.size() - 1; 0 <= i; i--) {
      MetadataColumn mdColumn=columns.get(i);
      String name=mdColumn.getLabel();
      if (name != null && name.equals(orignalColumnName)) {
        metadataTable.getColumns().remove(i);
        index=i;
      }
    }
  }
  return index;
}
Program: 126610
Project: 126610
Buggy source:
/** 
 * Removes the column from metadatatable by the name identified, created by Marvin Wang on May 21, 2012.
 * @param orignalColumnName
 * @return the index removed. If no need to remove, return -1.
 */
protected synchronized int removeOriginalColumn(String orignalColumnName){
  int index=-1;
  EList<MetadataColumn> columns=metadataTable.getColumns();
  if (columns != null && !columns.isEmpty()) {
    for (int i=columns.size() - 1; 0 <= i; i--) {
      MetadataColumn mdColumn=columns.get(i);
      String name=mdColumn.getLabel();
      if (name != null && name.equals(orignalColumnName)) {
        metadataTable.getColumns().remove(i);
        index=i;
      }
    }
  }
  return index;
}

Fixed version (ground truth):
/** 
 * Removes the column from metadatatable by the name identified, created by Marvin Wang on May 21, 2012.
 * @param orignalColumnName
 * @return the index removed. If no need to remove, return -1.
 */
protected synchronized int removeOriginalColumn(String orignalColumnName){
  int index=-1;
  EList<MetadataColumn> columns=metadataTable.getColumns();
  if (columns != null && !columns.isEmpty()) {
    Iterator<MetadataColumn> imc=columns.iterator();
    int i=-1;
    while (imc.hasNext()) {
      if (i < 0) {
        i=0;
      }
      MetadataColumn mdColumn=imc.next();
      String name=mdColumn.getLabel();
      if (name != null && name.equals(orignalColumnName)) {
        imc.remove();
        if (index < 0) {
          index=i;
        }
      }
      i++;
    }
  }
  return index;
}
Program: 126611
Project: 126611
Buggy source:
public MetadataTable getMetadataTable(){
  return null;
}

Fixed version (ground truth):
@Override public MetadataTable getMetadataTable(){
  return null;
}
Program: 126612
Project: 126612
Buggy source:
public void setSelectedText(String label){
}

Fixed version (ground truth):
@Override public void setSelectedText(String label){
}
Program: 126613
Project: 126613
Buggy source:
public void updateConnection(){
}

Fixed version (ground truth):
@Override public void updateConnection(){
}
Program: 126614
Project: 126614
Buggy source:
public void redrawLinkers(){
}

Fixed version (ground truth):
@Override public void redrawLinkers(){
}
Program: 126615
Project: 126615
Buggy source:
public List<FOXTreeNode> getTreeData(){
  return null;
}

Fixed version (ground truth):
@Override public List<FOXTreeNode> getTreeData(){
  return null;
}
Program: 126616
Project: 126616
Buggy source:
/** 
 * Removes the column from metadatatable by the name identified, created by Marvin Wang on May 21, 2012.
 * @param orignalColumnName
 * @return the index removed. If no need to remove, return -1.
 */
protected synchronized int removeOriginalColumn(String orignalColumnName){
  int index=-1;
  EList<MetadataColumn> columns=metadataTable.getColumns();
  if (columns != null && !columns.isEmpty()) {
    for (int i=0; i < columns.size(); i++) {
      MetadataColumn mdColumn=columns.get(i);
      String name=mdColumn.getLabel();
      if (name != null && name.equals(orignalColumnName)) {
        metadataTable.getColumns().remove(i);
        index=i;
      }
    }
  }
  return index;
}

Fixed version (ground truth):
/** 
 * Removes the column from metadatatable by the name identified, created by Marvin Wang on May 21, 2012.
 * @param orignalColumnName
 * @return the index removed. If no need to remove, return -1.
 */
protected synchronized int removeOriginalColumn(String orignalColumnName){
  int index=-1;
  EList<MetadataColumn> columns=metadataTable.getColumns();
  if (columns != null && !columns.isEmpty()) {
    Iterator<MetadataColumn> imc=columns.iterator();
    int i=-1;
    while (imc.hasNext()) {
      if (i < 0) {
        i=0;
      }
      MetadataColumn mdColumn=imc.next();
      String name=mdColumn.getLabel();
      if (name != null && name.equals(orignalColumnName)) {
        imc.remove();
        if (index < 0) {
          index=i;
        }
      }
      i++;
    }
  }
  return index;
}
Program: 126617
Project: 126617
Buggy source:
public TableViewer getSchemaViewer(){
  return null;
}

Fixed version (ground truth):
@Override public TableViewer getSchemaViewer(){
  return null;
}
Program: 126618
Project: 126618
Buggy source:
public void updateStatus(){
}

Fixed version (ground truth):
@Override public void updateStatus(){
}
Program: 126624
Project: 126624
Buggy source:
/** 
 * DOC YeXiaowei Comment method "hidePassword".
 * @param password
 * @return
 */
public static String hidePassword(final String password){
  if (password == null) {
    return "String_Node_Str";
  }
  int length=password.length() + 2;
  StringBuilder builder=new StringBuilder();
  for (int i=0; i < length; i++) {
    builder.append(PASS_COVER);
  }
  return builder.toString();
}

Fixed version (ground truth):
/** 
 * DOC YeXiaowei Comment method "hidePassword".
 * @param password
 * @return
 */
public static String hidePassword(final String password){
  if (password == null) {
    return "String_Node_Str";
  }
  String testPassword=password.trim();
  if (testPassword.startsWith(ContextParameterUtils.JAVA_NEW_CONTEXT_PREFIX)) {
    String variableName=testPassword.substring(ContextParameterUtils.JAVA_NEW_CONTEXT_PREFIX.length(),testPassword.length());
    if (!ContextUtils.isJavaKeyWords(variableName)) {
      return password;
    }
  }
  int length=password.length() + 2;
  StringBuilder builder=new StringBuilder();
  for (int i=0; i < length; i++) {
    builder.append(PASS_COVER);
  }
  return builder.toString();
}
Program: 126626
Project: 126626
Buggy source:
public static boolean isOracle(DatabaseMetaData metadata){
  if (metadata != null) {
    try {
      String name=metadata.getDatabaseProductName().toUpperCase();
      if (name != null && name.equals(EDatabaseTypeName.ORACLEFORSID.getProduct().toUpperCase())) {
        return true;
      }
    }
 catch (    SQLException e) {
      ExceptionHandler.process(e);
    }
  }
  return false;
}

Fixed version (ground truth):
public static boolean isOracle(DatabaseMetaData metadata){
  if (metadata != null) {
    try {
      String name=metadata.getDatabaseProductName();
      if (name != null && name.toUpperCase().equals(EDatabaseTypeName.ORACLEFORSID.getProduct().toUpperCase())) {
        return true;
      }
    }
 catch (    SQLException e) {
      ExceptionHandler.process(e);
    }
  }
  return false;
}
Program: 126627
Project: 126627
Buggy source:
@Test public void testIsSame4DiffId(){
  ItemRecord itemRecord1=mock(ItemRecord.class);
  Property property1=mock(Property.class);
  when(itemRecord1.getProperty()).thenReturn(property1);
  when(property1.getId()).thenReturn("String_Node_Str");
  when(property1.getVersion()).thenReturn("String_Node_Str");
  ItemRecord itemRecord2=mock(ItemRecord.class);
  Property property2=mock(Property.class);
  when(itemRecord2.getProperty()).thenReturn(property2);
  when(property2.getId()).thenReturn("String_Node_Str");
  when(property2.getVersion()).thenReturn("String_Node_Str");
  ImportBasicHandler basicHandler=new ImportBasicHandler();
  Assert.assertFalse(basicHandler.isSame(itemRecord1,itemRecord2));
}

Fixed version (ground truth):
@Test public void testIsSame4DiffId(){
  ImportItem ImportItem1=mock(ImportItem.class);
  Property property1=mock(Property.class);
  when(ImportItem1.getProperty()).thenReturn(property1);
  when(property1.getId()).thenReturn("String_Node_Str");
  when(property1.getVersion()).thenReturn("String_Node_Str");
  ImportItem ImportItem2=mock(ImportItem.class);
  Property property2=mock(Property.class);
  when(ImportItem2.getProperty()).thenReturn(property2);
  when(property2.getId()).thenReturn("String_Node_Str");
  when(property2.getVersion()).thenReturn("String_Node_Str");
  ImportBasicHandler basicHandler=new ImportBasicHandler();
  Assert.assertFalse(basicHandler.isSame(ImportItem1,ImportItem2));
}
Program: 126628
Project: 126628
Buggy source:
@Test public void testIsSameName(){
  ItemRecord itemRecord1=mock(ItemRecord.class);
  Property property1=mock(Property.class);
  when(itemRecord1.getProperty()).thenReturn(property1);
  when(property1.getLabel()).thenReturn("String_Node_Str");
  IRepositoryViewObject repViewObj=mock(IRepositoryViewObject.class);
  when(repViewObj.getLabel()).thenReturn("String_Node_Str");
  ImportBasicHandler basicHandler=new ImportBasicHandler();
  Assert.assertTrue(basicHandler.isSameName(itemRecord1,repViewObj));
}

Fixed version (ground truth):
@Test public void testIsSameName(){
  ImportItem ImportItem1=mock(ImportItem.class);
  Property property1=mock(Property.class);
  when(ImportItem1.getProperty()).thenReturn(property1);
  when(property1.getLabel()).thenReturn("String_Node_Str");
  IRepositoryViewObject repViewObj=mock(IRepositoryViewObject.class);
  when(repViewObj.getLabel()).thenReturn("String_Node_Str");
  ImportBasicHandler basicHandler=new ImportBasicHandler();
  Assert.assertTrue(basicHandler.isSameName(ImportItem1,repViewObj));
}
Program: 126629
Project: 126629
Buggy source:
@Test public void testIsSame4DiffVersion(){
  ItemRecord itemRecord1=mock(ItemRecord.class);
  Property property1=mock(Property.class);
  when(itemRecord1.getProperty()).thenReturn(property1);
  when(property1.getId()).thenReturn("String_Node_Str");
  when(property1.getVersion()).thenReturn("String_Node_Str");
  ItemRecord itemRecord2=mock(ItemRecord.class);
  Property property2=mock(Property.class);
  when(itemRecord2.getProperty()).thenReturn(property2);
  when(property2.getId()).thenReturn("String_Node_Str");
  when(property2.getVersion()).thenReturn("String_Node_Str");
  ImportBasicHandler basicHandler=new ImportBasicHandler();
  Assert.assertFalse(basicHandler.isSame(itemRecord1,itemRecord2));
}

Fixed version (ground truth):
@Test public void testIsSame4DiffVersion(){
  ImportItem ImportItem1=mock(ImportItem.class);
  Property property1=mock(Property.class);
  when(ImportItem1.getProperty()).thenReturn(property1);
  when(property1.getId()).thenReturn("String_Node_Str");
  when(property1.getVersion()).thenReturn("String_Node_Str");
  ImportItem ImportItem2=mock(ImportItem.class);
  Property property2=mock(Property.class);
  when(ImportItem2.getProperty()).thenReturn(property2);
  when(property2.getId()).thenReturn("String_Node_Str");
  when(property2.getVersion()).thenReturn("String_Node_Str");
  ImportBasicHandler basicHandler=new ImportBasicHandler();
  Assert.assertFalse(basicHandler.isSame(ImportItem1,ImportItem2));
}
Program: 126630
Project: 126630
Buggy source:
@Test public void testLoadItemResource() throws Exception {
  ImportBasicHandler basicHandler=new ImportBasicHandler();
  ItemRecord itemRecord=new ItemRecord(processPropPath1);
  itemRecord.setItemName(processPropPath1.lastSegment());
  Property property=mock(Property.class);
  itemRecord.setProperty(property);
  ResourcesManager resManager=mock(ResourcesManager.class);
  Set<IPath> pathes=new HashSet<IPath>();
  IPath projPath=new Path("String_Node_Str" + FileConstants.LOCAL_PROJECT_FILENAME);
  pathes.add(projPath);
  pathes.add(processPropPath1);
  pathes.add(processItemPath1);
  when(resManager.getPaths()).thenReturn(pathes);
  Resource resource=basicHandler.loadResource(resManager,itemRecord);
  Assert.assertNull(resource);
}

Fixed version (ground truth):
@Test public void testLoadItemResource() throws Exception {
  ImportBasicHandler basicHandler=new ImportBasicHandler();
  ImportItem ImportItem=new ImportItem(processPropPath1);
  ImportItem.setItemName(processPropPath1.lastSegment());
  Property property=mock(Property.class);
  ImportItem.setProperty(property);
  ResourcesManager resManager=mock(ResourcesManager.class);
  Set<IPath> pathes=new HashSet<IPath>();
  IPath projPath=new Path("String_Node_Str" + FileConstants.LOCAL_PROJECT_FILENAME);
  pathes.add(projPath);
  pathes.add(processPropPath1);
  pathes.add(processItemPath1);
  when(resManager.getPaths()).thenReturn(pathes);
  Resource resource=basicHandler.loadResource(resManager,ImportItem);
  Assert.assertNull(resource);
}
Program: 126631
Project: 126631
Buggy source:
@Test public void testCheckAndSetProject4NoProject(){
  ImportBasicHandler basicHandler=new ImportBasicHandler();
  ItemRecord itemRecord=new ItemRecord(processPropPath1);
  Property property=mock(Property.class);
  itemRecord.setProperty(property);
  ProcessItem item=PropertiesFactory.eINSTANCE.createProcessItem();
  when(property.getItem()).thenReturn(item);
  ResourcesManager resManager=mock(ResourcesManager.class);
  basicHandler.checkAndSetProject(resManager,itemRecord);
  Assert.assertFalse(itemRecord.getErrors().isEmpty());
  Assert.assertFalse(itemRecord.isValid());
  Assert.assertTrue(itemRecord.getErrors().size() == 1);
}

Fixed version (ground truth):
@Test public void testCheckAndSetProject4NoProject(){
  ImportBasicHandler basicHandler=new ImportBasicHandler();
  ImportItem ImportItem=new ImportItem(processPropPath1);
  Property property=mock(Property.class);
  ImportItem.setProperty(property);
  ProcessItem item=PropertiesFactory.eINSTANCE.createProcessItem();
  when(property.getItem()).thenReturn(item);
  ResourcesManager resManager=mock(ResourcesManager.class);
  basicHandler.checkAndSetProject(resManager,ImportItem);
  Assert.assertFalse(ImportItem.getErrors().isEmpty());
  Assert.assertFalse(ImportItem.isValid());
  Assert.assertTrue(ImportItem.getErrors().size() == 1);
}
Program: 126632
Project: 126632
Buggy source:
@Test public void testCreateResource() throws Exception {
  ImportBasicHandler basicHandler=new ImportBasicHandler();
  ItemRecord processItemRecord=new ItemRecord(processItemPath1);
  Resource processItemResource=basicHandler.createResource(processItemRecord,processItemPath1,false);
  Assert.assertTrue(processItemResource != null);
  Assert.assertTrue(processItemResource.getURI().fileExtension().equals("String_Node_Str"));
  ItemRecord propertyRecord=new ItemRecord(processPropPath1);
  Resource propertyResource=basicHandler.createResource(propertyRecord,processPropPath1,false);
  Assert.assertTrue(propertyResource != null);
  Assert.assertTrue(propertyResource.getURI().fileExtension().equals("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testCreateResource() throws Exception {
  ImportBasicHandler basicHandler=new ImportBasicHandler();
  ImportItem processImportItem=new ImportItem(processItemPath1);
  Resource processItemResource=basicHandler.createResource(processImportItem,processItemPath1,false);
  Assert.assertTrue(processItemResource != null);
  Assert.assertTrue(processItemResource.getURI().fileExtension().equals("String_Node_Str"));
  ImportItem propertyRecord=new ImportItem(processPropPath1);
  Resource propertyResource=basicHandler.createResource(propertyRecord,processPropPath1,false);
  Assert.assertTrue(propertyResource != null);
  Assert.assertTrue(propertyResource.getURI().fileExtension().equals("String_Node_Str"));
}