<commit_before>package gov.nih.nci.cabig.caaers.service.synchronizer;

import gov.nih.nci.cabig.caaers.domain.Study;
import gov.nih.nci.cabig.caaers.domain.TreatmentAssignment;
import gov.nih.nci.cabig.caaers.service.DomainObjectImportOutcome;
import gov.nih.nci.cabig.caaers.service.migrator.Migrator;

import java.util.ArrayList;
import java.util.List;

/**
 * This Class synchronizes all TreatmentAssignments 
 * @author <NAME>
 *
 */
public class TreatmentAssignmentSynchronizer implements Migrator<gov.nih.nci.cabig.caaers.domain.Study>  {

	public void migrate(Study dbStudy, Study xmlStudy,DomainObjectImportOutcome<Study> outcome) {
		
		List<TreatmentAssignment> newTreatmentAssignmentList = new ArrayList<TreatmentAssignment>();
		List<TreatmentAssignment> deleteTreatmentAssignmentList = new ArrayList<TreatmentAssignment>();
		TreatmentAssignment remTreatmentAssignment = null;
		
		//Identify New TreatmentAssignments and Also update existing ones.
		for(TreatmentAssignment xmlTreatmentAssignment : xmlStudy.getTreatmentAssignments()){
			for(TreatmentAssignment dbTreatmentAssignment : dbStudy.getTreatmentAssignments()){<commit_msg>Modified for empty TreatmentAssignment Lists<commit_after>package gov.nih.nci.cabig.caaers.service.synchronizer;

import gov.nih.nci.cabig.caaers.domain.Study;
import gov.nih.nci.cabig.caaers.domain.TreatmentAssignment;
import gov.nih.nci.cabig.caaers.service.DomainObjectImportOutcome;
import gov.nih.nci.cabig.caaers.service.migrator.Migrator;

import java.util.ArrayList;
import java.util.List;

/**
 * This Class synchronizes all TreatmentAssignments 
 * @author <NAME>
 *
 */
public class TreatmentAssignmentSynchronizer implements Migrator<gov.nih.nci.cabig.caaers.domain.Study>  {

	public void migrate(Study dbStudy, Study xmlStudy,DomainObjectImportOutcome<Study> outcome) {
		
		if(xmlStudy.getTreatmentAssignments() != null){
			if(xmlStudy.getTreatmentAssignments().size() == 0){
				if(dbStudy.getTreatmentAssignments() != null){
					dbStudy.getTreatmentAssignments().clear();
				}
				return;
			}
		}
		
		List<TreatmentAssignment> newTreatmentAssignmentList = new ArrayList<TreatmentAssignment>();
		List<TreatmentAssignment> deleteTreatmentAssignmentList = new ArrayList<TreatmentAssignment>();
		TreatmentAssignment remTreatmentAssignment = null;
		
		//Identify New TreatmentAssignments and Also update existing ones.
		for(TreatmentAssignment xmlTreatmentAssignment : xmlStudy.getTreatmentAssignments()){
			for(TreatmentAssignment dbTreatmentAssignment : dbStudy.getTreatmentAssignments()){
{'fraction_non_alphanumeric': 0.09839906286606795, 'fraction_numerical': 0.0003904724716907458, 'mean_word_length': 6.340974212034384, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6208530', 'n_tokens_mistral': 887, 'n_tokens_neox': 767, 'n_words': 127}