@Override
protected boolean valueEquals(final AbstractImmutableNormalizedNode<?, ?> other) {
- return Collections.EMPTY_LIST.equals(other.getValue());
+ return Collections.emptyList().equals(other.getValue());
}
@Override
protected int valueHashCode() {
- return Collections.EMPTY_LIST.hashCode();
+ return 1;
}
}
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSet.Builder;
import com.google.common.collect.ImmutableSetMultimap;
-import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Multimap;
import com.google.common.collect.Multimaps;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
private static Collection<Module> getImportedModules(final Map<ModuleId, Module> allModules,
final Set<Module> baseModules, final TreeMultimap<String, Module> nameToModulesAll) {
- List<Module> relatedModules = Lists.newLinkedList();
+ List<Module> relatedModules = new LinkedList<>();
for (Module module : baseModules) {
for (ModuleImport moduleImport : module.getImports()) {
assertEquals(Optional.empty(), bitsType.getDefaultValue());
assertEquals("getPath should equal schemaPath", schemaPath, bitsType.getPath());
assertEquals("Status should be CURRENT", Status.CURRENT, bitsType.getStatus());
- assertEquals("Should be empty list", Collections.EMPTY_LIST, bitsType.getUnknownSchemaNodes());
+ assertEquals("Should be empty list", Collections.emptyList(), bitsType.getUnknownSchemaNodes());
assertEquals("Values should be [enumPair]", Collections.singletonList(bit), bitsType.getBits());
assertEquals("Hash code of bitsType should be equal",
assertEquals("Base type is null", null, boolType.getBaseType());
assertEquals(Optional.empty(), boolType.getDefaultValue());
assertEquals("Status CURRENT", Status.CURRENT, boolType.getStatus());
- assertEquals("Should contain empty list", Collections.EMPTY_LIST, boolType.getUnknownSchemaNodes());
+ assertEquals("Should contain empty list", Collections.emptyList(), boolType.getUnknownSchemaNodes());
}
}
@Test
public void createDataNodeIteratorWith() {
assertFalse("Has no next", dataNodeIterator.hasNext());
- assertEquals("Should be empty list", Collections.EMPTY_LIST, dataNodeIterator.allChoices());
- assertEquals("Should be empty list", Collections.EMPTY_LIST, dataNodeIterator.allContainers());
- assertEquals("Should be empty list", Collections.EMPTY_LIST, dataNodeIterator.allTypedefs());
- assertEquals("Should be empty list", Collections.EMPTY_LIST, dataNodeIterator.allGroupings());
- assertEquals("Should be empty list", Collections.EMPTY_LIST, dataNodeIterator.allLists());
+ assertEquals("Should be empty list", Collections.emptyList(), dataNodeIterator.allChoices());
+ assertEquals("Should be empty list", Collections.emptyList(), dataNodeIterator.allContainers());
+ assertEquals("Should be empty list", Collections.emptyList(), dataNodeIterator.allTypedefs());
+ assertEquals("Should be empty list", Collections.emptyList(), dataNodeIterator.allGroupings());
+ assertEquals("Should be empty list", Collections.emptyList(), dataNodeIterator.allLists());
}
@Test
assertFalse(emptyType.getReference().isPresent());
assertEquals("Units", Optional.empty(), emptyType.getUnits());
assertFalse(emptyType.getDescription().isPresent());
- assertEquals("UnknownSchemaNodes", Collections.EMPTY_LIST, emptyType.getUnknownSchemaNodes());
+ assertEquals("UnknownSchemaNodes", Collections.emptyList(), emptyType.getUnknownSchemaNodes());
assertTrue("toString", emptyType.toString().contains("empty"));
}
}
final Collection<ModifierImpl> currentPhaseModifiers = modifiers.get(phase);
boolean hasProgressed = tryToProgress(currentPhaseModifiers);
-
- checkNotNull(this.root, "Malformed source. Valid root element is missing.");
- final boolean phaseCompleted = root.tryToCompletePhase(phase);
+ final boolean phaseCompleted = requireNonNull(root, "Malformed source. Valid root element is missing.")
+ .tryToCompletePhase(phase);
hasProgressed |= tryToProgress(currentPhaseModifiers);