Skip to content

Commit

Permalink
[fix] Fix broken isRootConflict method
Browse files Browse the repository at this point in the history
  • Loading branch information
slarse committed Mar 24, 2020
1 parent 69b5816 commit 1bebf1f
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions src/main/java/se/kth/spork/spoon/PcsInterpreter.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,29 @@
package se.kth.spork.spoon;

import se.kth.spork.base3dm.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.TreeMap;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import se.kth.spork.base3dm.ChangeSet;
import se.kth.spork.base3dm.Content;
import se.kth.spork.base3dm.ListNode;
import se.kth.spork.base3dm.Pcs;
import se.kth.spork.base3dm.Revision;
import se.kth.spork.base3dm.TdmMerge;
import spoon.reflect.code.CtExpression;
import spoon.reflect.declaration.CtAnnotation;
import spoon.reflect.declaration.CtElement;
import spoon.reflect.path.CtRole;

import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
* Class for interpreting a merged PCS structure into a Spoon tree.
*
Expand Down Expand Up @@ -71,8 +85,8 @@ private static <T extends ListNode> Map<T, Map<T, Pcs<T>>> buildRootToChildren(S

private static boolean isRootConflict(Pcs<?> left, Pcs<?> right) {
return !Objects.equals(left.getRoot(), right.getRoot()) &&
Objects.equals(left.getPredecessor(), right.getPredecessor()) ||
Objects.equals(left.getSuccessor(), right.getSuccessor());
(Objects.equals(left.getPredecessor(), right.getPredecessor()) ||
Objects.equals(left.getSuccessor(), right.getSuccessor()));
}

private static boolean isPredecessorConflict(Pcs<?> left, Pcs<?> right) {
Expand Down

0 comments on commit 1bebf1f

Please sign in to comment.