AugmentationIdentifiers allocated from BindingRuntimeContext
end up being used across the system. This ensures we squash
instances to system-wide cache.
Change-Id: I0d75dc8815f86cb1dda13ef118ceb9b6455a31e3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import java.util.AbstractMap.SimpleEntry;
import java.util.ArrayList;
import com.google.common.collect.Iterables;
import java.util.AbstractMap.SimpleEntry;
import java.util.ArrayList;
}
private static AugmentationIdentifier getAugmentationIdentifier(final AugmentationSchemaNode augment) {
}
private static AugmentationIdentifier getAugmentationIdentifier(final AugmentationSchemaNode augment) {
- final Set<QName> childNames = new HashSet<>();
- for (final DataSchemaNode child : augment.getChildNodes()) {
- childNames.add(child.getQName());
- }
- return new AugmentationIdentifier(childNames);
+ // FIXME: use DataSchemaContextNode.augmentationIdentifierFrom() once it does caching
+ return AugmentationIdentifier.create(augment.getChildNodes().stream().map(DataSchemaNode::getQName)
+ .collect(ImmutableSet.toImmutableSet()));
}
private static Type referencedType(final Class<?> type) {
}
private static Type referencedType(final Class<?> type) {