Projects >> atlas >>1e53a1d3627d973fe26287751e1c8fc2c37299e4

Chunk
Conflicting content
    private Location findExistingLocation(Location fetched, Set existingLocations) {
        for (Location existing : existingLocations) {
            if (existing.getUri() != null && existing.getUri().equals(fetched.getUri())
<<<<<<< HEAD
                || existing.getEmbedId() != null && existing.getEmbedId().equals(existing.getEmbedId())) {
=======
                || existing.getEmbedId() != null && existing.getEmbedId().equals(fetched.getEmbedId())) {
>>>>>>> f5e1a43fcb941c197a95b1901031b50f0d95a765
                return existing;
            }
        }
Solution content
    private Location findExistingLocation(Location fetched, Set existingLocations) {
        for (Location existing : existingLocations) {
            if (existing.getUri() != null && existing.getUri().equals(fetched.getUri())
                || existing.getEmbedId() != null && existing.getEmbedId().equals(fetched.getEmbedId())) {
                return existing;
            }
        }
File
C4AtomBackedBrandUpdater.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Variable
Chunk
Conflicting content
import org.atlasapi.persistence.logging.AdapterLogEntry;
import org.atlasapi.persistence.logging.AdapterLogEntry.Severity;
import org.atlasapi.remotesite.HttpClients;
<<<<<<< HEAD
=======
import org.atlasapi.remotesite.channel4.epg.C4EpgChannelDayUpdater;
import org.atlasapi.remotesite.channel4.epg.C4EpgClient;
>>>>>>> f5e1a43fcb941c197a95b1901031b50f0d95a765
import org.atlasapi.remotesite.channel4.epg.C4EpgUpdater;
import org.atlasapi.remotesite.channel4.epg.ScheduleResolverBroadcastTrimmer;
import org.joda.time.Duration;
Solution content
import org.atlasapi.persistence.logging.AdapterLogEntry;
import org.atlasapi.persistence.logging.AdapterLogEntry.Severity;
import org.atlasapi.remotesite.HttpClients;
import org.atlasapi.remotesite.channel4.epg.C4EpgChannelDayUpdater;
import org.atlasapi.remotesite.channel4.epg.C4EpgClient;
import org.atlasapi.remotesite.channel4.epg.C4EpgUpdater;
import org.atlasapi.remotesite.channel4.epg.ScheduleResolverBroadcastTrimmer;
import org.joda.time.Duration;
File
C4Module.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
    }
    
	@Bean public C4EpgUpdater c4EpgUpdater() {
<<<<<<< HEAD
	    ScheduleResolverBroadcastTrimmer trimmer = new ScheduleResolverBroadcastTrimmer(C4, scheduleResolver, contentResolver, lastUpdatedSettingContentWriter());
        return new C4EpgUpdater(atomApi(), httpsClient(), lastUpdatedSettingContentWriter(),
                contentResolver, c4BrandFetcher(Optional.absent()), trimmer, log, new DayRangeGenerator().withLookAhead(7).withLookBack(7));
    }
	
	@Bean protected C4AtoZAtomContentUpdateTask pcC4AtozUpdater() {
		return new C4AtoZAtomContentUpdateTask(httpsClient(), ATOZ_BASE, c4BrandFetcher(Optional.absent()));
	}
	
	@Bean protected C4AtoZAtomContentUpdateTask xboxC4AtozUpdater() {
	    return new C4AtoZAtomContentUpdateTask(httpsClient(), ATOZ_BASE, Optional.of(Platform.XBOX), c4BrandFetcher(Optional.of(Platform.XBOX)));
	}
	
    @Bean protected SimpleHttpClient httpsClient() {
	    try {
	        URL jksFile = new File(keyStorePath).toURI().toURL();
            return HttpClients.httpsClient(jksFile, keyStorePass);
        } catch (Exception e) {
            throw Throwables.propagate(e);
        }
	}
	
	protected C4AtomBackedBrandUpdater c4BrandFetcher(Optional platform) {
	    Optional platformParam = platform.isPresent() ? Optional.of(platform.get().toString().toLowerCase()) : Optional.absent();
	    C4AtomApiClient client = new C4AtomApiClient(httpsClient(), ATOZ_BASE, platformParam);
	    C4BrandExtractor extractor = new C4BrandExtractor(client, platform, channelResolver);
		return new C4AtomBackedBrandUpdater(client, platform, contentResolver, lastUpdatedSettingContentWriter(), extractor);
	}
	
	@Bean protected C4BrandUpdateController c4BrandUpdateController() {
	    return new C4BrandUpdateController(c4BrandFetcher(Optional.absent()), ImmutableMap.of(Platform.XBOX, c4BrandFetcher(Optional.of(Platform.XBOX))));
=======
	    return new C4EpgUpdater(atomApi(), c4EpgChannelDayUpdater(), log, new DayRangeGenerator().withLookAhead(7).withLookBack(7));
    }
	
	@Bean public C4EpgChannelDayUpdater c4EpgChannelDayUpdater() {
	    ScheduleResolverBroadcastTrimmer trimmer = new ScheduleResolverBroadcastTrimmer(C4, scheduleResolver, contentResolver, lastUpdatedSettingContentWriter());
	    return new C4EpgChannelDayUpdater(new C4EpgClient(httpsClient()), lastUpdatedSettingContentWriter(),
                contentResolver, c4BrandFetcher(Optional.absent()), trimmer, log);
	}
	
	@Bean protected C4AtoZAtomContentUpdateTask pcC4AtozUpdater() {
		return new C4AtoZAtomContentUpdateTask(httpsClient(), ATOZ_BASE, c4BrandFetcher(Optional.absent()));
	}
	
	@Bean protected C4AtoZAtomContentUpdateTask xboxC4AtozUpdater() {
	    return new C4AtoZAtomContentUpdateTask(httpsClient(), ATOZ_BASE, Optional.of(Platform.XBOX), c4BrandFetcher(Optional.of(Platform.XBOX)));
	}
	
    @Bean protected SimpleHttpClient httpsClient() {
	    try {
	        URL jksFile = new File(keyStorePath).toURI().toURL();
            return HttpClients.httpsClient(jksFile, keyStorePass);
        } catch (Exception e) {
            throw Throwables.propagate(e);
        }
	}
	
	protected C4AtomBackedBrandUpdater c4BrandFetcher(Optional platform) {
	    Optional platformParam = platform.isPresent() ? Optional.of(platform.get().toString().toLowerCase()) : Optional.absent();
	    C4AtomApiClient client = new C4AtomApiClient(httpsClient(), ATOZ_BASE, platformParam);
	    C4BrandExtractor extractor = new C4BrandExtractor(client, platform, channelResolver);
		return new C4AtomBackedBrandUpdater(client, platform, contentResolver, lastUpdatedSettingContentWriter(), extractor);
	}
	
	@Bean protected C4BrandUpdateController c4BrandUpdateController() {
	    return new C4BrandUpdateController(c4BrandFetcher(Optional.absent()), ImmutableMap.of(Platform.XBOX, c4BrandFetcher(Optional.of(Platform.XBOX))));
	}
	
	@Bean protected C4EpgChannelDayUpdateController c4EpgChannelDayUpdateController() {
	    return new C4EpgChannelDayUpdateController(atomApi(), c4EpgChannelDayUpdater());
>>>>>>> f5e1a43fcb941c197a95b1901031b50f0d95a765
	}
	
    @Bean protected LastUpdatedSettingContentWriter lastUpdatedSettingContentWriter() {
Solution content
    }
    
	@Bean public C4EpgUpdater c4EpgUpdater() {
	    return new C4EpgUpdater(atomApi(), c4EpgChannelDayUpdater(), log, new DayRangeGenerator().withLookAhead(7).withLookBack(7));
    }
	
	@Bean public C4EpgChannelDayUpdater c4EpgChannelDayUpdater() {
	    ScheduleResolverBroadcastTrimmer trimmer = new ScheduleResolverBroadcastTrimmer(C4, scheduleResolver, contentResolver, lastUpdatedSettingContentWriter());
	    return new C4EpgChannelDayUpdater(new C4EpgClient(httpsClient()), lastUpdatedSettingContentWriter(),
                contentResolver, c4BrandFetcher(Optional.absent()), trimmer, log);
	}
	
	@Bean protected C4AtoZAtomContentUpdateTask pcC4AtozUpdater() {
		return new C4AtoZAtomContentUpdateTask(httpsClient(), ATOZ_BASE, c4BrandFetcher(Optional.absent()));
	}
	
	@Bean protected C4AtoZAtomContentUpdateTask xboxC4AtozUpdater() {
	    return new C4AtoZAtomContentUpdateTask(httpsClient(), ATOZ_BASE, Optional.of(Platform.XBOX), c4BrandFetcher(Optional.of(Platform.XBOX)));
	}
	
    @Bean protected SimpleHttpClient httpsClient() {
	    try {
	        URL jksFile = new File(keyStorePath).toURI().toURL();
            return HttpClients.httpsClient(jksFile, keyStorePass);
        } catch (Exception e) {
            throw Throwables.propagate(e);
        }
	}
	
	protected C4AtomBackedBrandUpdater c4BrandFetcher(Optional platform) {
	    Optional platformParam = platform.isPresent() ? Optional.of(platform.get().toString().toLowerCase()) : Optional.absent();
	    C4AtomApiClient client = new C4AtomApiClient(httpsClient(), ATOZ_BASE, platformParam);
	    C4BrandExtractor extractor = new C4BrandExtractor(client, platform, channelResolver);
		return new C4AtomBackedBrandUpdater(client, platform, contentResolver, lastUpdatedSettingContentWriter(), extractor);
	}
	
	@Bean protected C4BrandUpdateController c4BrandUpdateController() {
	    return new C4BrandUpdateController(c4BrandFetcher(Optional.absent()), ImmutableMap.of(Platform.XBOX, c4BrandFetcher(Optional.of(Platform.XBOX))));
	}
	
	@Bean protected C4EpgChannelDayUpdateController c4EpgChannelDayUpdateController() {
	    return new C4EpgChannelDayUpdateController(atomApi(), c4EpgChannelDayUpdater());
	}
	
    @Bean protected LastUpdatedSettingContentWriter lastUpdatedSettingContentWriter() {
File
C4Module.java
Developer's decision
Version 2
Kind of conflict
Method declaration
Method invocation
Method signature
Return statement
Variable
Chunk
Conflicting content
=======

import org.atlasapi.feeds.utils.UpdateProgress;
import org.atlasapi.media.channel.Channel;
<<<<<<< HEAD
import org.atlasapi.persistence.content.ContentResolver;
import org.atlasapi.persistence.content.ContentWriter;
>>>>>>> f5e1a43fcb941c197a95b1901031b50f0d95a765
import org.atlasapi.persistence.logging.AdapterLog;
import org.atlasapi.persistence.logging.AdapterLogEntry;
import org.atlasapi.persistence.logging.AdapterLogEntry.Severity;
Solution content
import org.atlasapi.feeds.utils.UpdateProgress;
import org.atlasapi.media.channel.Channel;
import org.atlasapi.persistence.logging.AdapterLog;
import org.atlasapi.persistence.logging.AdapterLogEntry;
import org.atlasapi.persistence.logging.AdapterLogEntry.Severity;
File
C4EpgUpdater.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
import com.google.common.collect.BiMap;
import com.google.common.collect.Iterables;
<<<<<<< HEAD
import com.metabroadcast.common.http.SimpleHttpClient;
=======
>>>>>>> f5e1a43fcb941c197a95b1901031b50f0d95a765
import com.metabroadcast.common.scheduling.ScheduledTask;
import com.metabroadcast.common.time.DateTimeZones;
import com.metabroadcast.common.time.DayRange;
Solution content
import com.google.common.collect.BiMap;
import com.google.common.collect.Iterables;
import com.metabroadcast.common.scheduling.ScheduledTask;
import com.metabroadcast.common.time.DateTimeZones;
import com.metabroadcast.common.time.DayRange;
File
C4EpgUpdater.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
    private C4EpgChannelDayUpdater channelDayUpdater;

<<<<<<< HEAD
    public C4EpgUpdater(C4AtomApi atomApi, SimpleHttpClient client, ContentWriter writer, ContentResolver resolver, C4BrandUpdater brandUpdater, BroadcastTrimmer trimmer, AdapterLog log, DayRangeGenerator generator) {
        this.c4AtomApi = atomApi;
        this.log = log;
        this.channelDayUpdater = new C4EpgChannelDayUpdater(new C4EpgClient(client), writer, resolver, brandUpdater, trimmer, log);
=======
    public C4EpgUpdater(C4AtomApi atomApi, C4EpgChannelDayUpdater updater, AdapterLog log, DayRangeGenerator generator) {
        this.c4AtomApi = atomApi;
        this.log = log;
        this.channelDayUpdater = updater;
>>>>>>> f5e1a43fcb941c197a95b1901031b50f0d95a765
        this.rangeGenerator = generator;
    }
Solution content
    private C4EpgChannelDayUpdater channelDayUpdater;

    public C4EpgUpdater(C4AtomApi atomApi, C4EpgChannelDayUpdater updater, AdapterLog log, DayRangeGenerator generator) {
        this.c4AtomApi = atomApi;
        this.log = log;
        this.channelDayUpdater = updater;
        this.rangeGenerator = generator;
    }
File
C4EpgUpdater.java
Developer's decision
Version 2
Kind of conflict
Attribute
Method invocation
Method signature
Variable
Chunk
Conflicting content
        
        for (Map.Entry channelEntry : channelMap.entrySet()) {
            for (LocalDate scheduleDay : dayRange) {
<<<<<<< HEAD
                reportStatus(String.format("Processing %s/%s. %s failures. %s broadcasts processed", processed++, total, progress.getFailures(), progress.getProcessed()));
=======
                reportStatus(progressReport("Processing", processed++, total, progress));
>>>>>>> f5e1a43fcb941c197a95b1901031b50f0d95a765
                progress = progress.reduce(channelDayUpdater.update(channelEntry.getKey(), channelEntry.getValue(), scheduleDay));
            }
        }
Solution content
        
        for (Map.Entry channelEntry : channelMap.entrySet()) {
            for (LocalDate scheduleDay : dayRange) {
                reportStatus(progressReport("Processing", processed++, total, progress));
                progress = progress.reduce(channelDayUpdater.update(channelEntry.getKey(), channelEntry.getValue(), scheduleDay));
            }
        }
File
C4EpgUpdater.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Chunk
Conflicting content
            }
        }
        
<<<<<<< HEAD
        reportStatus(String.format("Processed %s/%s. %s failures. %s broadcasts processed", processed++, total, progress.getFailures(), progress.getProcessed()));
        String runTime = new Period(start, new DateTime(DateTimeZones.UTC)).toString(PeriodFormat.getDefault());
        log.record(new AdapterLogEntry(Severity.INFO).withSource(getClass()).withDescription("C4 EPG Update finished in " + runTime));
=======
        reportStatus(progressReport("Processed", processed++, total, progress));
        String runTime = new Period(start, new DateTime(DateTimeZones.UTC)).toString(PeriodFormat.getDefault());
        log.record(new AdapterLogEntry(Severity.INFO).withSource(getClass()).withDescription("C4 EPG Update finished in " + runTime));
        
        if (progress.hasFailures()) {
            throw new IllegalStateException(String.format("Completed with %s failures", progress.getFailures()));
        }
    }

    private String progressReport(String prefix, int processed, int total, UpdateProgress progress) {
        return String.format("%s %s/%s. %s failures. %s broadcasts processed", prefix, processed, total, progress.getFailures(), progress.getProcessed());
>>>>>>> f5e1a43fcb941c197a95b1901031b50f0d95a765
    }

}
Solution content
            }
        }
        
        reportStatus(progressReport("Processed", processed++, total, progress));
        String runTime = new Period(start, new DateTime(DateTimeZones.UTC)).toString(PeriodFormat.getDefault());
        log.record(new AdapterLogEntry(Severity.INFO).withSource(getClass()).withDescription("C4 EPG Update finished in " + runTime));
        
        if (progress.hasFailures()) {
            throw new IllegalStateException(String.format("Completed with %s failures", progress.getFailures()));
        }
    }

    private String progressReport(String prefix, int processed, int total, UpdateProgress progress) {
        return String.format("%s %s/%s. %s failures. %s broadcasts processed", prefix, processed, total, progress.getFailures(), progress.getProcessed());
    }

}
File
C4EpgUpdater.java
Developer's decision
Version 2
Kind of conflict
If statement
Method invocation
Method signature
Return statement
Variable