Projects >> atlas-persistence >>7cf5023462e558182b88eab92963a2002efb59d4

Chunk
Conflicting content
import static com.metabroadcast.common.persistence.mongo.MongoBuilders.where;

<<<<<<< HEAD
=======
import java.nio.channels.Channels;
>>>>>>> 865b74c6eadbac1dc9fd27ccdc35bdd23d38594d
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
Solution content
import static com.metabroadcast.common.persistence.mongo.MongoBuilders.where;

import java.util.Collections;
import java.util.Comparator;
import java.util.List;
File
MongoScheduleStore.java
Developer's decision
Version 1
Kind of conflict
Import
Chunk
Conflicting content
    @Override
    public void replaceScheduleBlock(Publisher publisher, Channel channel, Iterable itemsAndBroadcasts) {
    	
<<<<<<< HEAD
    	Interval interval = checkAndGetScheduleInterval(itemsAndBroadcasts, true);
=======
    	Interval interval = checkAndGetScheduleInterval(itemsAndBroadcasts, true, channel);
>>>>>>> 865b74c6eadbac1dc9fd27ccdc35bdd23d38594d
    	Map entries = getAdjacentScheduleEntries(channel, publisher, interval);
    	
    	for(ItemRefAndBroadcast itemAndBroadcast : itemsAndBroadcasts) {
Solution content
    @Override
    public void replaceScheduleBlock(Publisher publisher, Channel channel, Iterable itemsAndBroadcasts) {
    	
    	Interval interval = checkAndGetScheduleInterval(itemsAndBroadcasts, true, channel);
    	Map entries = getAdjacentScheduleEntries(channel, publisher, interval);
    	
    	for(ItemRefAndBroadcast itemAndBroadcast : itemsAndBroadcasts) {
File
MongoScheduleStore.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Variable
Chunk
Conflicting content
    	}
    }
    
<<<<<<< HEAD
    private Interval checkAndGetScheduleInterval(Iterable itemsAndBroadcasts, boolean allowGaps)
=======
    private Interval checkAndGetScheduleInterval(Iterable itemsAndBroadcasts, boolean allowGaps, Channel expectedChannel)
>>>>>>> 865b74c6eadbac1dc9fd27ccdc35bdd23d38594d
    {
		List broadcasts = Lists.newArrayList();
		for(ItemRefAndBroadcast itemAndBroadcast : itemsAndBroadcasts) {
Solution content
    	}
    }
    
    private Interval checkAndGetScheduleInterval(Iterable itemsAndBroadcasts, boolean allowGaps, Channel expectedChannel)
    {
		List broadcasts = Lists.newArrayList();
		for(ItemRefAndBroadcast itemAndBroadcast : itemsAndBroadcasts) {
File
MongoScheduleStore.java
Developer's decision
Version 2
Kind of conflict
Method signature
Chunk
Conflicting content
		
		for(Broadcast b : broadcasts) {
			
<<<<<<< HEAD
			if(channel != null && !channel.equals(b.getBroadcastOn())) {
=======
			if(expectedChannel != Channel.fromUri(b.getBroadcastOn()).requireValue()) {
>>>>>>> 865b74c6eadbac1dc9fd27ccdc35bdd23d38594d
				throw new IllegalArgumentException("All broadcasts must be on the same channel");
			}	
			channel = b.getBroadcastOn();
Solution content
		
		for(Broadcast b : broadcasts) {
			
			if(expectedChannel != Channel.fromUri(b.getBroadcastOn()).requireValue()) {
				throw new IllegalArgumentException("All broadcasts must be on the same channel");
			}	
File
MongoScheduleStore.java
Developer's decision
Version 2
Kind of conflict
If statement
Chunk
Conflicting content
    
    private final static long BIN_MILLIS = Duration.standardHours(1).getMillis();
    
<<<<<<< HEAD
=======
    private final Duration maxBroadcastAge;

    public ScheduleEntryBuilder(Duration maxBroadcastAge) {
        this.maxBroadcastAge = maxBroadcastAge;
    }
    
    public ScheduleEntryBuilder() {
        this(Duration.standardDays(28));
    }
    
>>>>>>> 865b74c6eadbac1dc9fd27ccdc35bdd23d38594d
    public Map toScheduleEntries(Iterable items) {
    	Map entries = new HashMap();
    	
Solution content
    
    private final static long BIN_MILLIS = Duration.standardHours(1).getMillis();
    
    private final Duration maxBroadcastAge;

    public ScheduleEntryBuilder(Duration maxBroadcastAge) {
        this.maxBroadcastAge = maxBroadcastAge;
    }
    
    public ScheduleEntryBuilder() {
        this(Duration.standardDays(28));
    }
    
    public Map toScheduleEntries(Iterable items) {
    	Map entries = new HashMap();
    	
File
ScheduleEntryBuilder.java
Developer's decision
Version 2
Kind of conflict
Attribute
Method declaration