X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=yang%2Fyang-parser-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fyang%2Fparser%2Fspi%2Fmeta%2FStatementSupportBundle.java;h=08e723ecce63c70dc872675997e61c765d4c2606;hb=4968d735af48cd6b0ea91b37fbd238316c7cb46c;hp=01435600334c555d263c69ded77d1dff597b2452;hpb=481a692d463636bbcf75f023da71703913e1b605;p=yangtools.git diff --git a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/StatementSupportBundle.java b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/StatementSupportBundle.java index 0143560033..08e723ecce 100644 --- a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/StatementSupportBundle.java +++ b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/StatementSupportBundle.java @@ -17,24 +17,24 @@ import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace; public final class StatementSupportBundle implements Immutable,NamespaceBehaviour.Registry { - private static final StatementSupportBundle EMPTY = new StatementSupportBundle(null, ImmutableMap.>of(), ImmutableMap., NamespaceBehaviour>of()); + private static final StatementSupportBundle EMPTY = new StatementSupportBundle(null, ImmutableMap.of(), ImmutableMap.of()); private final StatementSupportBundle parent; private final ImmutableMap> definitions; private final ImmutableMap, NamespaceBehaviour> namespaceDefinitions; - public ImmutableMap> getDefinitions() { - return definitions; - } - private StatementSupportBundle(StatementSupportBundle parent, - ImmutableMap> statements, - ImmutableMap, NamespaceBehaviour> namespaces) { + ImmutableMap> statements, + ImmutableMap, NamespaceBehaviour> namespaces) { this.parent = parent; this.definitions = statements; this.namespaceDefinitions = namespaces; } + public ImmutableMap> getDefinitions() { + return definitions; + } + public static Builder builder() { return new Builder(EMPTY); } @@ -54,9 +54,7 @@ public final class StatementSupportBundle implements Immutable,NamespaceBehaviou * Safe cast, previous checkState checks equivalence of key from * which type argument are derived */ - @SuppressWarnings("unchecked") - NamespaceBehaviour casted = (NamespaceBehaviour) potential; - return casted; + return (NamespaceBehaviour) potential; } if (parent != null) { return parent.getNamespaceBehaviour(namespace);