Program: 139856
Project: 139856
Buggy source:
private void synchronize(){
  final ResourceSet resourceSet=new ResourceSetImpl();
  try {
    final EObject alreadySavedModel=ModelUtils.load(selectedFileObject.toString(),resourceSet);
    TypedReturnCode<TdDataProvider> rc=null;
    EList<ProviderConnection> connections=((TdDataProvider)alreadySavedModel).getResourceConnection();
    ListIterator<ProviderConnection> li=connections.listIterator();
    if (li.hasNext()) {
      TdProviderConnection pc=(TdProviderConnection)li.next();
      String dbUrl=pc.getConnectionString();
      String driverClassName=pc.getDriverClassName();
      EList<EObject> pcObjects=pc.eContents();
      ListIterator<EObject> liEObject=pcObjects.listIterator();
      Properties parameters=new Properties();
      while (liEObject.hasNext()) {
        EObject eo=liEObject.next();
        if (eo instanceof TaggedValue) {
          String tag=((TaggedValue)eo).getTag();
          System.out.print(tag);
          String value=((TaggedValue)eo).getValue();
          System.out.println("String_Node_Str" + value);
          parameters.put(tag,value);
        }
      }
      System.out.println(dbUrl);
      System.out.println(driverClassName);
      DBConnectionParameter dbcp=new DBConnectionParameter();
      dbcp.setName(pc.getName());
      dbcp.setAuthor(TaggedValueHelper.getAuthor(pc));
      dbcp.setDescription(TaggedValueHelper.getDescription(pc));
      dbcp.setPurpose(TaggedValueHelper.getPurpose(pc));
      dbcp.setStatus(TaggedValueHelper.getValue("String_Node_Str",pc));
      dbcp.setDriverClassName(driverClassName);
      dbcp.setJdbcUrl(dbUrl);
      dbcp.setParameters(parameters);
      rc=ConnectionService.createConnection(dbcp);
    }
    System.out.println(alreadySavedModel.toString());
    IFolder folder=ResourcesPlugin.getWorkspace().getRoot().getProject(org.talend.dataquality.PluginConstant.getRootProjectName()).getFolder(DQStructureManager.getMetaData()).getFolder(DQStructureManager.DB_CONNECTIONS);
    FolderProvider fp=new FolderProvider();
    fp.setFolderResource(folder);
    IFile file2=loadDataProviderAndStructureInMemory(rc.getObject(),fp);
    final EObject model2=ModelUtils.load(file2.toString(),resourceSet);
    Map<String,Object> options=new HashMap<String,Object>();
    options.put(MatchOptions.OPTION_IGNORE_XMI_ID,true);
    options.put(MatchOptions.OPTION_SEARCH_WINDOW,500);
    final MatchModel match=MatchService.doMatch(alreadySavedModel,model2,options);
    final DiffModel diff=DiffService.doDiff(match,false);
    EList<UnMatchElement> unMatchedElements=match.getUnMatchedElements();
    for (    Object object : unMatchedElements) {
      UnMatchElement unMatched=(UnMatchElement)object;
      ModelElement modelElt=(ModelElement)unMatched.getElement();
      System.out.println("String_Node_Str" + modelElt.getName());
    }
    System.out.println("String_Node_Str" + match.getLeftModel());
    EList<DiffElement> ownedElements=diff.getOwnedElements();
    try {
      System.out.println(ModelUtils.serialize(match));
      System.out.println(ModelUtils.serialize(diff));
    }
 catch (    IOException e) {
      log.error(e,e);
    }
    String outputFile="String_Node_Str";
    System.out.println("String_Node_Str" + outputFile + "String_Node_Str");
    final ModelInputSnapshot snapshot=DiffFactory.eINSTANCE.createModelInputSnapshot();
    snapshot.setDate(Calendar.getInstance().getTime());
    snapshot.setMatch(match);
    snapshot.setDiff(diff);
    ModelUtils.save(snapshot,outputFile);
  }
 catch (  IOException e) {
    System.out.print(e.getMessage());
  }
catch (  InterruptedException e) {
    System.out.print(e.getMessage());
    log.error(e,e);
  }
}

Fixed version (ground truth):
private void synchronize(){
  final ResourceSet resourceSet=new ResourceSetImpl();
  try {
    final EObject alreadySavedModel=ModelUtils.load(selectedFileObject.toString(),resourceSet);
    TypedReturnCode<TdDataProvider> rc=null;
    EList<ProviderConnection> connections=((TdDataProvider)alreadySavedModel).getResourceConnection();
    ListIterator<ProviderConnection> li=connections.listIterator();
    if (li.hasNext()) {
      TdProviderConnection pc=(TdProviderConnection)li.next();
      String dbUrl=pc.getConnectionString();
      String driverClassName=pc.getDriverClassName();
      EList<EObject> pcObjects=pc.eContents();
      ListIterator<EObject> liEObject=pcObjects.listIterator();
      Properties parameters=new Properties();
      while (liEObject.hasNext()) {
        EObject eo=liEObject.next();
        if (eo instanceof TaggedValue) {
          String tag=((TaggedValue)eo).getTag();
          System.out.print(tag);
          String value=((TaggedValue)eo).getValue();
          System.out.println("String_Node_Str" + value);
          parameters.put(tag,value);
        }
      }
      System.out.println(dbUrl);
      System.out.println(driverClassName);
      DBConnectionParameter dbcp=new DBConnectionParameter();
      dbcp.setName(pc.getName());
      dbcp.setAuthor(TaggedValueHelper.getAuthor(pc));
      dbcp.setDescription(TaggedValueHelper.getDescription(pc));
      dbcp.setPurpose(TaggedValueHelper.getPurpose(pc));
      dbcp.setStatus(TaggedValueHelper.getValue("String_Node_Str",pc));
      dbcp.setDriverClassName(driverClassName);
      dbcp.setJdbcUrl(dbUrl);
      dbcp.setParameters(parameters);
      rc=ConnectionService.createConnection(dbcp);
    }
    System.out.println(alreadySavedModel.toString());
    IFolder folder=ResourceManager.getMetadataFolder().getFolder(DQStructureManager.DB_CONNECTIONS);
    FolderProvider fp=new FolderProvider();
    fp.setFolderResource(folder);
    IFile file2=loadDataProviderAndStructureInMemory(rc.getObject(),fp);
    final EObject model2=ModelUtils.load(file2.toString(),resourceSet);
    Map<String,Object> options=new HashMap<String,Object>();
    options.put(MatchOptions.OPTION_IGNORE_XMI_ID,true);
    options.put(MatchOptions.OPTION_SEARCH_WINDOW,500);
    final MatchModel match=MatchService.doMatch(alreadySavedModel,model2,options);
    final DiffModel diff=DiffService.doDiff(match,false);
    EList<UnMatchElement> unMatchedElements=match.getUnMatchedElements();
    for (    Object object : unMatchedElements) {
      UnMatchElement unMatched=(UnMatchElement)object;
      ModelElement modelElt=(ModelElement)unMatched.getElement();
      System.out.println("String_Node_Str" + modelElt.getName());
    }
    System.out.println("String_Node_Str" + match.getLeftModel());
    EList<DiffElement> ownedElements=diff.getOwnedElements();
    try {
      System.out.println(ModelUtils.serialize(match));
      System.out.println(ModelUtils.serialize(diff));
    }
 catch (    IOException e) {
      log.error(e,e);
    }
    String outputFile="String_Node_Str";
    System.out.println("String_Node_Str" + outputFile + "String_Node_Str");
    final ModelInputSnapshot snapshot=DiffFactory.eINSTANCE.createModelInputSnapshot();
    snapshot.setDate(Calendar.getInstance().getTime());
    snapshot.setMatch(match);
    snapshot.setDiff(diff);
    ModelUtils.save(snapshot,outputFile);
  }
 catch (  IOException e) {
    System.out.print(e.getMessage());
  }
catch (  InterruptedException e) {
    System.out.print(e.getMessage());
    log.error(e,e);
  }
}