示例#1
0
 private void collectConflictingRootAdds() {
   Tuples._2<Map<SNodeId, AddRootChange>, Map<SNodeId, AddRootChange>> arranged;
   arranged =
       this.<SNodeId, AddRootChange>arrangeChanges(
           new _FunctionTypes._return_P1_E0<SNodeId, AddRootChange>() {
             public SNodeId invoke(AddRootChange drc) {
               return drc.getRootId();
             }
           },
           AddRootChange.class);
   for (SNodeId addedRoot :
       SetSequence.fromSet(MapSequence.fromMap(arranged._0()).keySet())
           .intersect(SetSequence.fromSet(MapSequence.fromMap(arranged._1()).keySet()))) {
     AddRootChange mine = MapSequence.fromMap(arranged._0()).get(addedRoot);
     AddRootChange repository = MapSequence.fromMap(arranged._1()).get(addedRoot);
     if (SNodeCompare.nodeEquals(
         myMyModel.getNode(mine.getRootId()), myRepositoryModel.getNode(repository.getRootId()))) {
       addSymmetric(mine, repository);
     } else {
       addPossibleConflict(mine, repository);
     }
   }
 }
示例#2
0
 private boolean nodeGroupChangesSymmetric(NodeGroupChange mine, NodeGroupChange repository) {
   if (mine.getBegin() == repository.getBegin() && mine.getEnd() == repository.getEnd()) {
     if (mine.getResultEnd() - mine.getResultBegin()
         == repository.getResultEnd() - repository.getResultBegin()) {
       List<? extends SNode> myChildren =
           IterableUtil.asList(
               myMyModel.getNode(mine.getParentNodeId()).getChildren(mine.getRole()));
       List<? extends SNode> repositoryChildren =
           IterableUtil.asList(
               myRepositoryModel
                   .getNode(repository.getParentNodeId())
                   .getChildren(repository.getRole()));
       for (int o = 0; o < mine.getResultEnd() - mine.getResultBegin(); o++) {
         if (!(SNodeCompare.nodeEquals(
             myChildren.get(mine.getResultBegin() + o),
             repositoryChildren.get(repository.getResultBegin() + o)))) {
           return false;
         }
       }
       return true;
     }
   }
   return false;
 }