test_class.declarator: resolver
test_class.modifier: private
test_class.original_string: private IInconsistencyResolver<Versioned<String>> resolver;
test_class.type: IInconsistencyResolver<Versioned<String>>
test_class.var_name: resolver
test_class.declarator: later
test_class.modifier: private
test_class.original_string: private Versioned<String> later;
test_class.type: Versioned<String>
test_class.var_name: later
test_class.declarator: prior
test_class.modifier: private
test_class.original_string: private Versioned<String> prior;
test_class.type: Versioned<String>
test_class.var_name: prior
test_class.declarator: current
test_class.modifier: private
test_class.original_string: private Versioned<String> current;
test_class.type: Versioned<String>
test_class.var_name: current
test_class.declarator: concurrent
test_class.modifier: private
test_class.original_string: private Versioned<String> concurrent;
test_class.type: Versioned<String>
test_class.var_name: concurrent
test_class.declarator: concurrent2
test_class.modifier: private
test_class.original_string: private Versioned<String> concurrent2;
test_class.type: Versioned<String>
test_class.var_name: concurrent2
test_class.file: src/agents/apps/floodlight/floodlight-1.0/src/test/java/org/sdnplatform/sync/internal/version/VectorClockInconsistencyResolverTest.java
test_class.identifier: VectorClockInconsistencyResolverTest
test_case.body: @Test
      public void testResolveConcurrent() {
          List<Versioned<String>> resolved = resolver.resolveConflicts(Arrays.asList(current,
                                                                                     concurrent,
                                                                                     prior));
          assertEquals(2, resolved.size());
          assertTrue("Version not found", resolved.contains(current));
          assertTrue("Version not found", resolved.contains(concurrent));
      }
test_case.class_method_signature: VectorClockInconsistencyResolverTest.testResolveConcurrent()
test_case.full_signature: @Test public void testResolveConcurrent()
test_case.identifier: testResolveConcurrent
test_case.invocations: resolveConflicts asList assertEquals size assertTrue contains assertTrue contains
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testResolveConcurrent()
focal_class.file: src/agents/apps/floodlight/floodlight-1.0/src/main/java/org/sdnplatform/sync/internal/version/VectorClockInconsistencyResolver.java
focal_class.identifier: VectorClockInconsistencyResolver
focal_class.interfaces: implements IInconsistencyResolver<Versioned<T>>
focal_class.class_method_signature: VectorClockInconsistencyResolver.resolveConflicts(List<Versioned<T>> items)
focal_class.full_signature: public List<Versioned<T>> resolveConflicts(List<Versioned<T>> items)
focal_class.identifier: resolveConflicts
focal_class.modifiers: public
focal_class.parameters: (List<Versioned<T>> items)
focal_class.return: List<Versioned<T>>
focal_class.signature: List<Versioned<T>> resolveConflicts(List<Versioned<T>> items)
focal_class.class_method_signature: VectorClockInconsistencyResolver.equals(Object o)
focal_class.full_signature: @Override public boolean equals(Object o)
focal_class.identifier: equals
focal_class.modifiers: @Override public
focal_class.parameters: (Object o)
focal_class.return: boolean
focal_class.signature: boolean equals(Object o)
focal_class.class_method_signature: VectorClockInconsistencyResolver.hashCode()
focal_class.full_signature: @Override public int hashCode()
focal_class.identifier: hashCode
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int hashCode()
focal_method.body: public List<Versioned<T>> resolveConflicts(List<Versioned<T>> items) {
          int size = items.size();
          if(size <= 1)
              return items;
  
          List<Versioned<T>> newItems = Lists.newArrayList();
          for(Versioned<T> v1: items) {
              boolean found = false;
              for(ListIterator<Versioned<T>> it2 =
                      newItems.listIterator(); it2.hasNext();) {
                  Versioned<T> v2 = it2.next();
                  Occurred compare = v1.getVersion().compare(v2.getVersion());
                  if(compare == Occurred.AFTER) {
                      if(found)
                          it2.remove();
                      else
                          it2.set(v1);
                  }
                  if(compare != Occurred.CONCURRENTLY)
                      found = true;
              }
              if(!found)
                  newItems.add(v1);
          }
          return newItems;
      }
focal_method.class_method_signature: VectorClockInconsistencyResolver.resolveConflicts(List<Versioned<T>> items)
focal_method.full_signature: public List<Versioned<T>> resolveConflicts(List<Versioned<T>> items)
focal_method.identifier: resolveConflicts
focal_method.invocations: size newArrayList listIterator hasNext next compare getVersion getVersion remove set add
focal_method.modifiers: public
focal_method.parameters: (List<Versioned<T>> items)
focal_method.return: List<Versioned<T>>
focal_method.signature: List<Versioned<T>> resolveConflicts(List<Versioned<T>> items)