Andrii Mazurian [Tue, 13 Aug 2019 09:59:44 +0000 (12:59 +0300)]
Rename AnyXmlNode to DOMSourceAnyxmlNode
Rename AnyXmlNode to DOMSourceAnyxmlNode, as that reflects its place
in the object hierarchy. NormalizedNodeWriter is extended with stub
support for other object models, yet DOMSource is the only one
supported at this time.
JIRA: YANGTOOLS-976
Change-Id: I962c910557a14dad5f88fa4e69146606e21fddc4
Signed-off-by: Andrii Mazurian <a.mazuryan@gmail.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 24 Sep 2019 06:44:29 +0000 (08:44 +0200)]
Bump odlparent to 6.0.0
This switches to using a released version of odlparent.
Change-Id: Ia9f2c27b38b851abe98f9b90b13d38dee1d46c59
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 15 Sep 2019 22:02:49 +0000 (00:02 +0200)]
Get rid of Strings.repeat()
Java 11 is giving us String.repeat(), which has better performance
characteristics than Guava's Strings.repeat(). Ditch Guava in favor
of Java 11.
Change-Id: Ic5b8b507802f577a28b6b8df7c79e1e50efa779b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 15 Sep 2019 22:10:56 +0000 (00:10 +0200)]
Take advantage of ValueNode in NormalizedNodes
We can perform a single instanceof check instead of two to check
for LeafNode and LeafSetEntryNode. Also cleanup checks to remove
superfluous type arguments.
Change-Id: Id9964088ff0751217175cf1a8c6f13009a0276e8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 15 Sep 2019 22:07:49 +0000 (00:07 +0200)]
Cleanup requireNonNull() use in NormalizedNodes
Take advantage of the non-null return to save a tiny bit of bytecode.
Change-Id: Ie43b7ccc15dd96cd320eb74c0b0a2d5a0dd8a4da
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 15 Sep 2019 22:02:02 +0000 (00:02 +0200)]
Add missing @Override
LoggingNormalizedNodeStreamWriter.domSourceValue() is missing
an annotation for some reason. Fix that.
Change-Id: I01741c2a28de11f2a86562e588db15882dbe0912
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 15 Sep 2019 17:48:10 +0000 (19:48 +0200)]
Simplify Uint range checks
This saves a single instruction (and a stack slot) in the hot path,
while penalizing exceptional path, by not giving it the constant
string.
As exceptions are expected to be (relatively) rare, this should not
hurt much and if for some reason it does, we can always revert.
Change-Id: Ibd926732f49b0d0692f0c894166f4427a49d7f7d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 15 Sep 2019 17:31:20 +0000 (19:31 +0200)]
Remove unneeded masking in Uint{8,16}.valueOf()
As we are checking the range of the input, we can just narrow input
value, saving us a few instructions in the process.
Change-Id: I2ff52b1a75565da76804e4f02114249200e7d841
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 15 Sep 2019 17:02:28 +0000 (19:02 +0200)]
Change Uint* IAE messages
As we are rolling out Uint* as replacements to widened binding
representations, there is a potential useability regression in that
the excepion reported no longer contains the range of allowed
values.
This patch changes the reporting structure, so that the binding
format is retained, while also optimizing the checks a bit.
While we are in the area, fix Uint32/Uint64's failure to throw
NPE on null strings.
Change-Id: Ib482d2e632e7e4f4fbc16f047e70d8077aa9341a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 12 Sep 2019 15:16:05 +0000 (17:16 +0200)]
Add NodeIdentifierWithPredicates.containsKey()
This is a useful check, which can be performed via getValue()
and checking for null return, but implementations can perform
it a wee bit more quickly.
Change-Id: I2182870ca3cfba082c6cebafe947643d5e191f4a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 10 Sep 2019 13:08:57 +0000 (15:08 +0200)]
Use Optional.isEmpty()
This is Java 11 addition, a shorthand for !isPresent(). This allows
us to be a bit more concise.
Change-Id: I99461863e8ae292d0ebea9cc40a5bab2e0805dfb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 10 Sep 2019 04:47:42 +0000 (06:47 +0200)]
Use {Byte,Short}.compareUnsigned
Java 9 has these utility methods, use them instead of custom-brewing
an equivalent.
Change-Id: I774f2c0dcfa9f602830a1c98761b36520613bd52
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 9 Sep 2019 05:00:40 +0000 (07:00 +0200)]
Expose NodeIdentifierWithPredicates.Singleton
Exposing this implementation allows users dealing with serialization
to use Singleton.singleEntry() and skip allocation of a Set.
Change-Id: I3d5941fc62a9ce9766b3bb15eb86e5c9f45af60b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 6 Sep 2019 18:32:22 +0000 (20:32 +0200)]
Update uint implementations a bit
Constructor should be private and Integer.toString() is better
than String.valueOf() because it is an intrinsic.
Change-Id: I7e5da76b90add67e479c8d673ad0c696a74907dc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 5 Sep 2019 09:35:19 +0000 (11:35 +0200)]
Migrate Class.newInstance() user
Class.newInstance() is deprecated since Java 9, migrate to explicit
constructor invocation.
Change-Id: Ifc2e67aa4a56a9ccc306eb540100ebc299eb00c9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 5 Sep 2019 07:56:46 +0000 (09:56 +0200)]
Add UintConversions
This adds utility conversion methods for Java/Guava equivalents,
so that transitioning to/from these is easier on the users.
JIRA: YANGTOOLS-1018
Change-Id: Ibcd0cd908cd85c0f038206f96e667a144569582b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 3 Sep 2019 11:35:38 +0000 (13:35 +0200)]
Update and document Uint
This updates Uint classes to expose ZERO/ONE/MAX_VALUE and documents
their methods.
Caching is reworked to work on tunable statically-populated caches,
where Uint8 is always fully cached. This mirrors what is being done
for boxing purposes on java.lang.Byte, etc.
On top of the statically-populated caches, each type has a dedicated
Interner instance, which can be efficiently consulted using intern().
JIRA: YANGTOOLS-1018
Change-Id: Ic25b5ac685c920f7d82d588309a543f9a8eb43b7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 23 Aug 2019 17:42:34 +0000 (19:42 +0200)]
Switch encoding unsigned type normalization to Uint* types
Using Java native types for unsigned values is wasteful especially
in case of uint32 and uint64. Furthermore it leads to uncertainty
between int16/uint8, int32/uint16 and int64/uint32.
This is a partial switch, where we retain java.lang types for
signed entities, but switch the unsigned ones.
JIRA: YANGTOOLS-1018
Change-Id: I0eeb1d343d77d05c4e00cb6919c128042ab31eb1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 2 Sep 2019 15:28:10 +0000 (17:28 +0200)]
Hide Immutables.KNOWN_IMMUTABLES
This constant should not be leaked to the outside world, hide it
and make it an ImmutableSet.
Change-Id: If05dc0bb5b9915a371913bd6cc0c9ecb0d253c89
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 2 Sep 2019 15:25:37 +0000 (17:25 +0200)]
Optimize immutable lookups
We have a number of private Set/Map/Lists which we are using for
lookups. These typically are backed by Immutable implementations,
hence we can propagate the type knowledge to improve bytecode
generation and make JIT's life easier.
Change-Id: I7f90393b8bc76196deced50f1800c3f99424fa1c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 30 Aug 2019 12:11:09 +0000 (14:11 +0200)]
Verify leaf node squashing
There is a very slight possiblity of somebody playing tricks
to inject Leaf node with a DataContainerChild value, in which case
decoding would break. Verify this does not happen.
JIRA: YANGTOOLS-1019
Change-Id: Idbd6457817b9db5f2b2d4b3fafce57169ace6ec1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 30 Aug 2019 08:58:33 +0000 (10:58 +0200)]
Fixup LazyLeafOperations
LazyLeafOperations.isEnabled() allows code to query whether leaf nodes
are being treated as expendable, hence assumptions about them being
equal on identity can be violated. We retrofit the check into tests we
modified before.
Furthermore users of getValue() expect it to work with identities,
even when it is being specialized to a Collection. The expectation here
is that the same collection will be returned from NormalizedNode,
which we are violating. Fix this up by introducing a new implementation
class, which hides this difference and defers equality to the backing
map.
JIRA: YANGTOOLS-1019
Change-Id: Icf62619c3ea5a1c994c6547a0674b36d707248d3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 29 Aug 2019 15:28:41 +0000 (17:28 +0200)]
Fixup RpcResult definitions
The 'errors' are a List and the list is always present, which
has goodness for users.
Change-Id: I44fad2f48fe8882eb5cb98b1c099a547659f77c0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 29 Aug 2019 13:46:53 +0000 (15:46 +0200)]
Remove useless method generic arguments
These arguments are not used, remove them.
Change-Id: Ibd8140b68d012c662a7670ab0ae8639d9a0134fb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 27 Aug 2019 14:04:55 +0000 (16:04 +0200)]
Do not retain leaf nodes in containers by default
Leaf nodes are observed to dominate our memory footprint. This
patch modifies immutable implementations of NormalizedNodeContainers
such that they eliminate any leaf nodes when they are stored, retaining
only the encapsulated value. Leaf nodes are then re-created on access
as needed.
Note this changes two aspects of operation:
1) looking up a leaf will yield a new object every time it is invoked,
hence callers must not rely on on returned objects to be identical.
2) getValue() is operating on the backing map's entrySet() and requires
its transformation. This means that multiple iterations over values
will not necessarily yield same objects.
Neither of these violates effective immutability contract of NormalizeNode,
as the returned objects will compare as equal.
This behavior can be switched off at runtime by setting the system property:
org.opendaylight.yangtools.yang.data.impl.schema.nodes.lazy-leaves=false
JIRA: YANGTOOLS-1019
Change-Id: I00fc3ac0b64290068e8a6e4c8972454729fa9011
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 28 Aug 2019 18:59:36 +0000 (20:59 +0200)]
Remove YangInstanceIdentifier.EMPTY
This constannt has been deprecated for removal -- now we remove it.
Change-Id: I0808a8e8ebe455275bf6fcc24edae8126a4087c2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 28 Aug 2019 20:40:14 +0000 (22:40 +0200)]
Remove references to YangInstanceIdentifier.EMPTY
The constant is going away, update javadocs to reflect that.
Change-Id: Ie0415cbd1afd375b14a6c62d097f288ed2193613
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 28 Aug 2019 18:57:15 +0000 (20:57 +0200)]
Deprecate YangInstanceIdentifier.EMPTY for removal
As a JDK9 extension, mark the constant for removal.
Change-Id: I931d870cedef109526bef2f3c6336b1bc2256158
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 28 Aug 2019 18:21:39 +0000 (20:21 +0200)]
Deprecate YangInstanceIdentifier.EMPTY
This runtime constant forces instantiation of a subclass, leading
to a SpotBugs warning. A static accessor works just as well --
hence YangInstanceIdentifier.empty()
Change-Id: I67b562b176f17d3c327b4589b673017f513f98f5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 28 Aug 2019 14:24:23 +0000 (16:24 +0200)]
Add Builder.build() override
This override stops the unchecked exception from leaking into
IDE-generated implementations.
Change-Id: I7c4fc039e6d0c468ce08cf1647c82473cf6d9096
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 28 Aug 2019 14:01:09 +0000 (16:01 +0200)]
Migrate away from @ConstructorProperties
ListenerNotificationQueueStats is meant for consumption in
java.management and therefore it does not need java.desktop
to work -- this is very important for JDK 9+ modular deployments.
Change-Id: I0e7715113ede968db05aacef136e35649cdfa492
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 9 Jul 2019 20:27:30 +0000 (22:27 +0200)]
Hide AbstractIdentifier.getValue()
AbstractIdentifier is a utility wrapper class, hence it should not
have a public surface users should be interested it. Anybody relying
on .getValue() who is not a subclass should expose a domain-specific
getter method.
Change-Id: I64af4b385055d92c6499d62879c77e77216d4b39
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 28 Aug 2019 09:05:19 +0000 (11:05 +0200)]
Correct cache sizing for Uint types
There is an off-by-one error in these, fix that up.
Change-Id: I7031e8b59bc2c35741d53d663aba3951f6ee2862
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 28 Aug 2019 00:19:20 +0000 (02:19 +0200)]
Expose Uint*.{MIN,MAX}_VALUE constants
These contants are useful for outside users, as they allow them
to reference known invariants.
Change-Id: I28467737a2dfe5cac811e7ecbc9ead75c47d1344
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 26 Aug 2019 14:33:49 +0000 (16:33 +0200)]
Fix SchemaContextProvider nullness
SchemaContextProvider needs to return a schemacontext, or throw
an ISE.
Change-Id: I098c09a77a261f81b2b4b31207733169563aa936
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 20 Jun 2019 14:12:07 +0000 (16:12 +0200)]
Add a singleton NodeIdentifierWithPredicates
Heap dumps from OFP-centric load shows that single-predicate
identifiers are dominating the workload. This adds a dedicated
class to handle those cases.
The upshot of a dedicated class vs. a singleton map is a reduction
of one object, i.e. with SharedSingletonMap we get:
NodeIdentifierWithPredicates (24/32b)
SharedSingletonMap (24/32b)
whereas a dedicated class does only:
NodeIdentifierWithPredicates.Singleton (32/40b)
Which reduces total storage requirements from 48/64 bytes down to
32/40 bytes, saving 16/24 bytes (33/37.5%).
Change-Id: I3172ab9435d67adc12ae1734f9ad35f1dc8f891f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 27 Aug 2019 14:13:19 +0000 (16:13 +0200)]
Optimize ImmutableNodes.leafNode()
This eliminates instantiation of a temporary builder and shortcuts
to creating the leaf node directly.
Change-Id: I66256b46ef0de1aa3745bb90e70d41a2bd29d419
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 27 Aug 2019 10:30:10 +0000 (12:30 +0200)]
Fix YangInstanceIdentifier.PathArgument definition
Javadoc and nullness guarantees do not match implementation behaviour,
align them.
Change-Id: Ifd981021a9261f06fc605d15d6790518e3915735
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 21 Jun 2019 23:51:14 +0000 (01:51 +0200)]
Switch serialization format to NIPv2
This format retains control over the entries being emitted,
so that we are in control of what implementation is being used
for retaining the entries. We adopt a reconstruction strategy,
where the maps are constructed the same way they are in production
code.
Change-Id: Ic08267c4b2424307a60d2fdccc9b6896c487c29a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 26 Aug 2019 12:32:46 +0000 (14:32 +0200)]
Add utility PotentialSchemaSource constructor
It is useful for users to use pre-defined acquisition costs, this
adds a utility so users do not have to call Costs.getValue().
Change-Id: Ib44352784076493a317dcee0aa64d108301a6305
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 26 Aug 2019 09:15:13 +0000 (11:15 +0200)]
Centralize serializeImpl()
All subclasses of AbstractIntegerStringCodec are doing the same
thing in the serialization path, make sure we squash them to
the same implementation.
Change-Id: I98cc8738720ccf38a441a09a069dc48edb5b25ed
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 23 Aug 2019 18:43:01 +0000 (20:43 +0200)]
Fix Serializer/Deserializer/Codec concepts
Base Codec/Serializer/Deserializer classes need to express the fact
the an implementation can throw an exception. This is important for
proper use of checked exception in implementation domains -- for example
it is natural to throw a XMLStreamException when executing in the
context of StAX streaming.
This prevents user surprises when an XML stream throws an unhandled
IAE exception. All implementations are converted with prejudice to
explicitly not allow null.
JIRA: YANGTOOLS-1017
Change-Id: I5d24a36028ae6aef5b244e13c5f9e8b0643f14f4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 23 Aug 2019 19:30:14 +0000 (21:30 +0200)]
Update TypeDefinitionAwareCodec
Note that the factory can return null, annotate as such and document
that @Nullable should be eliminated.
Change-Id: I63c4703ef9b63ce1a7fccb70b32beb23398be748
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 22 Aug 2019 13:02:53 +0000 (15:02 +0200)]
Fix a theoretical IM_BAD_CHECK_FOR_ODD
While the size of a collection cannot be negative, this keeps
SpotBugs happy about the check.
Change-Id: Ic84a9f147b9d933efc66766617f6271fcf1eddc1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 22 Aug 2019 12:57:38 +0000 (14:57 +0200)]
Rely on framework to unregister XPathParserFactory
This simplifies the code a bit while also squashing two SpotBug
violations.
Change-Id: Ie3f146568510a949e3c7d332c95c59b90f17c7b0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 22 Aug 2019 12:44:39 +0000 (14:44 +0200)]
Enable spotbugs in yang-model-export
SpotBugs is getting confused by our use of checkArgument, not
understanding we will catch nulls. Refactor the code removing
the violation and remove enforcement override.
Change-Id: I787359c01f2761448cb4f3d33aea0baf5e642ed8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 22 Aug 2019 12:41:07 +0000 (14:41 +0200)]
Remome YinExportUtils.prefixToNamespace()
This method is correctly flagged as unused, remove it along with
getModuleNamespace() which is orphaned after its removal.
Change-Id: I3f410ef802a7e9c4dc89d5671fde775030683353
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 22 Aug 2019 10:57:31 +0000 (12:57 +0200)]
Remove unneeded spotbugs/checkstyle declarations
checkstyle/spotbugs are enabled by default by odlparent, there is
no point in keeping these declarations.
Change-Id: I2852f8521457785afb70aee4ac379e099f6fb153
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 22 Aug 2019 10:42:41 +0000 (12:42 +0200)]
Disable SpotBugs enforcement on select artifacts
odlparent has started enforcing SpotBugs by default, but some of
our artifacts are not ready for that. Disable enforcement through
the odlparent property and document why we are disabling it.
Change-Id: Ie8d3e43b26efd75e70223dde2b4555865ce25001
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 22 Aug 2019 10:41:27 +0000 (12:41 +0200)]
Fix checkstyle
This fixes issues found by checkstyle.
Change-Id: Iecab9171c2d4d63cf564139c714a4552d069636b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 20 Aug 2019 12:17:21 +0000 (14:17 +0200)]
Expand MapAdaptor javadoc
This fixes a few warnings around javadoc completes of MapAdaptor.
Change-Id: I6bb7b6354530b4ad47a07b4b0358c720b80b4230
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 20 Aug 2019 11:49:28 +0000 (13:49 +0200)]
Make sure readOnly field is initialized
Make sure the readOnly field is forced to be initialed to null
by making it a volatile.
Change-Id: I366835a8009fe6fe21992b374f959bfcefcde18e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 19 Aug 2019 15:07:09 +0000 (17:07 +0200)]
Relax read-only snapshot memory fencing
With Java 9 we can use VarHandles to reduce memory ordering guarantees
from volatile to acquire/releases.
Use this facility to disconnect ReadOnlyTrieMap from other volatiles,
potentially helping the compiler to do a better job optimizing.
Change-Id: Ibd266a5a341bcdaae25702476610c10eeb0ea374
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 5 Aug 2019 09:27:39 +0000 (11:27 +0200)]
Bump odlparent to 6.0.0-SNAPSHOT
We will need some JDK11 work done, for that we'll use odlparent
snapshots for a while.
Due to MJAVADOC (and underlying JDK-
8220702) we keep the target of
yang-data-impl and yang-parser-rfc7950 at 8.
Change-Id: I3da91a8a6b1dfd4cc40c7e0e9fdd527733da5331
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 16 Aug 2019 17:01:18 +0000 (19:01 +0200)]
Generalize ForwardingIdentityObject
Wrapping objects in identity comparison is useful, and there
seems to be no readily-avaible utility. This introduces an
extension to ForwardingObject and a simple utility class to
implement its construct.
JIRA: YANGTOOLS-1016
Change-Id: If0d7a2f731b0a294570f8ba39ce5da7236e2c752
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Anna Bencurova [Thu, 15 Aug 2019 12:17:34 +0000 (14:17 +0200)]
Fix schema-ref traversal
When traversing schema-mount definitions, we need to account for
schema-ref being a choice and hence its children are not directly
reachable.
JIRA: YANGTOOLS-1015
Change-Id: Iaa9ddbf33c172c433cb323166e5b1bcea5eea649
Signed-off-by: Anna Bencurova <Anna.Bencurova@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 6 Aug 2019 08:42:49 +0000 (10:42 +0200)]
Add @SuppressModernizer
We are mucking with modernizable constructs on purpose, add
suppressions to keep modernizer quiet.
Change-Id: Ia25640be14f1943a976c4edda6247124986a9d15
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 6 Aug 2019 07:24:24 +0000 (09:24 +0200)]
Remove PrefixToModule.isPreLinkageMap()
This property is not used anywhere, remove it.
Change-Id: I4e1674f5b4a00b68e6d3b40b62ebc2a3fcc95573
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 6 Aug 2019 10:43:54 +0000 (12:43 +0200)]
Switch to using java.util.Base64
This follows modernizer recommendation of using java.util.Base64
instead of Guava's BaseEncoding.
Change-Id: I72a49503980fb615ce27d2e3d0a84cbb1b033236
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 6 Aug 2019 11:16:15 +0000 (13:16 +0200)]
Add more modernization
This nails down a missed use of Lists.newArrayList(), fix that.
Change-Id: I0587e92bed503e642b1d003cb10a6947b98ff7a1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 6 Aug 2019 08:39:43 +0000 (10:39 +0200)]
Apply modernization
This fixes up use of old constructs pointed out by maven modernizer
plugin.
Change-Id: I3f926678763f72b195ae961ce7f220a1845fef52
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 5 Aug 2019 16:04:11 +0000 (18:04 +0200)]
Move Decimal64.toInt() method
This utility is only used in nested class, move it to keep SpotBugs
happy under Java 11.
Change-Id: I405718bf3db9ebcdd972ae5a71c47570c424f730
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 6 Aug 2019 06:23:59 +0000 (08:23 +0200)]
Fix checkArgument constructor
This adds a missing argument and removes the need for synthetic
accessors.
Change-Id: I7e293036b35b86c9ac555f2880747748b8c35443
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 5 Aug 2019 18:34:27 +0000 (20:34 +0200)]
Fix stmt.compat Java 11 compilation
Java 11 inference does not like the implicit cast, although it is
supposed to be safe. We do not really need it, remove it.
Change-Id: Ic2b89a523eb91cb86cd669dc9670c6acba214dca
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 5 Aug 2019 14:14:49 +0000 (16:14 +0200)]
Fix checkstyle errors
Upgraded checkstyle plugin is finding some more errors, fix them
up.
Change-Id: Id58302b1dcd0574fa94340965c15259621a9156d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 6 Aug 2019 08:52:51 +0000 (10:52 +0200)]
Bump odlparent to 5.0.2-SNAPSHOT
This is an intermediate bump to fix javadoc/jdk11 issues.
Change-Id: I407c6e1712b304cef4d0a46e223094f16903e04a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 5 Aug 2019 14:14:49 +0000 (16:14 +0200)]
Fix checkstyle errors
Upgraded checkstyle plugin is finding some more errors, fix them
up.
Change-Id: I755c73be82230cb1a1a22fd776322b7a1d2afc4f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 5 Aug 2019 09:25:58 +0000 (11:25 +0200)]
Remove javadoc plugin version override
odlparent is using a newer plugin, remove the unneeded override.
Change-Id: I6afb495233e3959364c45eb3189cabe20ebdcf5a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 20 Jun 2019 13:52:01 +0000 (15:52 +0200)]
Remove NodeIdentifierWithPredicates.getKeyValues()
This method has been deprecated, with entrySet()/keySet() being
its replacements.
Change-Id: Ie1d2a61539fd86584aff9d6aea8d11f63f1908e1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 7 Mar 2018 12:03:02 +0000 (13:03 +0100)]
Hide effective statement implementations
Remove deprecated tags and address the 3.0.0 guidance instructions,
hiding the implementation classes.
Change-Id: I42d2e580a513e02657fd7f927b025e329e067104
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 20 Jun 2019 13:48:31 +0000 (15:48 +0200)]
Remove public NodeIdentifierWithPredicates constructors
This removes constructors in favor of static factory methods.
Change-Id: I0881f42ed2a0599bf48e0a84a9dcd06194f32f83
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 21 Mar 2019 09:09:17 +0000 (10:09 +0100)]
Make QName subclass AbstractQName
This breaks serialization format compatibility with all versions
older than 3.0.0 by changing the QName class hierarchy.
JIRA: YANGTOOLS-970
Change-Id: I7e1b655ceb06186ca82f34b6c6d3f6adb12b30f8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 30 Jul 2019 10:20:54 +0000 (12:20 +0200)]
Bump version to 4.0.0-SNAPSHOT
This starts next major version development.
Change-Id: I9c0ced5fc5341b432b3d206157f801d30d03f9b1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 29 Jul 2019 15:25:54 +0000 (17:25 +0200)]
Teach DataSchemaContextNode about anydata
We failed to account for anydata nodes, which should behave the
same way as anyxml nodes.
Change-Id: Id8a2aff60921094e149f58c8b7bba1822587c96f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 29 Jul 2019 09:10:20 +0000 (11:10 +0200)]
Bump version to 3.0.5-SNAPSHOT
This starts the next development iteration.
Change-Id: Iaf21895aadee2433c1bba42e0b3fa8097f4ae8e4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 29 Jul 2019 08:41:59 +0000 (10:41 +0200)]
Revert "Check for nested augmentations"
This reverts commit
759e69d85991edb987a760165adb83fa3f2ab67b.
JIRA: YANGTOOLS-956
Change-Id: I3c80751043a101de77292bc91e0c1c4178d16f44
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 19 Feb 2019 10:22:49 +0000 (11:22 +0100)]
Check for nested augmentations
When we are augmenting an already-conditional-augmented node from
the same module, we should inherit the previous when statement.
JIRA: YANGTOOLS-956
Change-Id: Ia3c04d60f4975bd721406b26aa4c2e7d8b05122b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 25 Jul 2019 15:59:35 +0000 (17:59 +0200)]
Add support for writing mountpoints to JSON
This adds basic support for emitting mountpoints into JSON documents,
as otherwise we cannot translate XML-to-JSON, which hampers the usual
use case of NETCONF-to-RESTCONF transformation.
JIRA: YANGTOOLS-1013
Change-Id: I9e29050384ba344804538d4155175908c9ed6697
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 25 Jul 2019 15:53:15 +0000 (17:53 +0200)]
Add rename fixmes to NormalizedNodeStreamWriterExtensions
The extension for Anydata is known as AnydataExtension, it makes
sense to keep naming consistent. Drop a few FIXMEs to that effect.
Change-Id: Ic2b848cd96d0d32a540bb2d10d82a80e0f0d2648
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 25 Jul 2019 15:40:19 +0000 (17:40 +0200)]
Add DatastoreIdentifier
This is a type-safe manifestation of RFC8342 datastore identity
for the purposes of yang-data-api. While this identifier not
immediately used in any contracts, it will be required for
RFC8525/RFC8528 interoperation where codecs are concerned.
JIRA: YANGTOOLS-1012
Change-Id: Ief45ed176d5751dc22249d3c40da2473f648bbc6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 25 Jul 2019 13:28:19 +0000 (15:28 +0200)]
Package RFC8528 extensions in odl-yangtools-data-api
These are pulled into the implementation package, whereas we really
want to have them in the api package.
Change-Id: Ibfaa05586da9e7b8abb2aea13db24775ba285ffc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 24 Jul 2019 16:48:27 +0000 (18:48 +0200)]
Add MountPointNormalizedNodeWriter
With the advent of MountMointNode a NormalizedNode tree can contain
nested mount point data, which is not quite a regular node.
This patch introduces a utility NormalizedNodeWriter, which can
either filter or forward MountPointNodes through a NormalizedNode
stream.
JIRA: YANGTOOLS-1010
Change-Id: Ie8cf6efa0874864461aa761b8a9c6e74a250bbac
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 24 Jul 2019 15:18:47 +0000 (17:18 +0200)]
Teach InstandIdToNodes about AnydataNode
This mirrors the capability of anyxml nodes, hence the data can
be queried.
Change-Id: Ib4b1f13ebbc1a6b8eb8b41ab6cc918d5533a59b6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 24 Jul 2019 10:23:33 +0000 (12:23 +0200)]
Add NodeIdentifierWithPredicates.getValue()
Acquiring a particular value is useful for code which extracts
values out of a YangInstanceIdentifier -- as these mirror corresponding
leaves.
Change-Id: I6a1613315489cb0219225b344f266cf31cd88815
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 23 Jul 2019 23:58:44 +0000 (01:58 +0200)]
Add AbstractMountPointContextFactory
This factory has model-specific information about RFC8528, so that
it is able to form an accurate view of mount points defined by inline
data.
Change-Id: I3350403c3fb3e1e074649536511eb7935f0ff6c9
JIRA: YANGTOOLS-1010
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 18 Jul 2019 05:37:50 +0000 (07:37 +0200)]
Bump versions for 3.0.4-SNAPSHOT
This starts the next development iteration.
Change-Id: I1c5be6a304bbdbae706fb39b4cbcb6b9510cca25
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 16 Jul 2019 13:23:14 +0000 (15:23 +0200)]
Refactor MountPoint-related definitions
At data-api level we have an opinionated view of how
the underlying mount point looks like and unify the semantics
of a mount point.
Notably we have a MountPointContext, which provides an entrypoint
into the mount point resolution process, which can be dynamically
constructed from inlinee parser data.
This simplifies things by quite a bit, getting rid of unneeded
abstractions in the process.
JIRA: YANGTOOLS-1007
Change-Id: I6419d13b8a84a4cdf5cc7707dba039c33f8d3f39
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 16 Jul 2019 13:10:10 +0000 (15:10 +0200)]
Move MountPointChild to rfc8528-data-api
This concept encapsulates a potential NormalizedNode and is needed
for mount point schema resolution. Move it to data-api.
Change-Id: I26917007488070dbb664eaaf82d11eeae62ae425
JIRA: YANGTOOLS-1007
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 16 Jul 2019 09:56:50 +0000 (11:56 +0200)]
Special-case schema-mount nodes
We need to recognize yangmnt:schema-mounts before we start emitting
the mount point data, as it may be required for nested mountpoint
resolution.
JIRA: YANGTOOLS-1007
Change-Id: Iee2b3ab7ddc4f2ae2416d01a8554fc7ec11cc6ce
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 16 Jul 2019 08:36:38 +0000 (10:36 +0200)]
Move YangLibraryConstants
These constants are only needed at data-api layer, move them.
JIRA: YANGTOOLS-1007
Change-Id: I2f53b5dcf8302d833e252f1022396ddbc5d0cb94
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 10 Jul 2019 22:22:25 +0000 (00:22 +0200)]
Add ImmutableMountPointNormalizedNodeStreamWriter
This is an immutable writer, which is able to receive mount points
from a stream and turns them into MountPointNodes.
JIRA: YANGTOOLS-1010
Change-Id: I1c89c757b25ac58632d8183df12e77427511ee9e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 15 Jul 2019 20:12:32 +0000 (22:12 +0200)]
Eliminate MountPointSchemaResolver
MountPointSchemaResolver really deals with mount point data
instantiation. This means is really needs to live at the data-api
layer instead of model-api layer -- but it turns out we have a
mirror in MountPointNodeFactory, hence we just converge on that
interface instead.
JIRA: YANGTOOLS-1007
Change-Id: I69f1d2c11239f48d22a0d2d184604e5518e50354
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 15 Jul 2019 20:14:23 +0000 (22:14 +0200)]
Include RFC85258 API documentation
This was missed, add the corresponding sections.
JIRA: YANGTOOLS-1007
Change-Id: Icc6a2c20f350ef29deacec90a579ba61d329e7aa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 26 Jun 2019 13:06:12 +0000 (15:06 +0200)]
Add XML support for parsing schema-mount data
When we cannot find a direct descendant of a particular schema,
we can still interpret it as a schema-mounted element, if the
corresponding schema allows for that.
JIRA: YANGTOOLS-1007
Change-Id: I1e595fafcc0aa1cd41c2cc6afc469d5152953dc6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 9 Jul 2019 20:29:38 +0000 (22:29 +0200)]
Add MountPointNode and its specializations
MountPointNode is a utility construct to carry a NormalizedNode
tree with mount point content attached.
JIRA: YANGTOOLS-1010
Change-Id: Ie33cd6e566584191d20f942eeb87ce6145e30717
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 10 Jul 2019 19:25:17 +0000 (21:25 +0200)]
Introduce MountPointIdentifier
For the purposes of streaming mount points out, we need to form
a proper identifier namespace -- MountPointIdentifier does exactly
that, improving type-safety.
This is a first step in a larger-scale refactor to clean up the
interactions between the parser and the writer.
JIRA: YANGTOOLS-1007
Change-Id: Ie3d0125c3e6c4ff795f3492b025fa00bc2b145b7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 9 Jul 2019 10:57:04 +0000 (12:57 +0200)]
Retrofit mount-point awareness into yang-data-util
{Container,ListEntry}NodeDataWithSchema can potentially contain
out-of-band mount point data, which needs intermediate processing
once all data has been acquired.
We introduce AbstractMountPointDataWithSchema as a common superclass,
which optionally holds MountPointData.
MountPointData contains enough information to resolve the data nodes
in the context of a schema context supplied either statically or
dynamically (based on the mount data).
JIRA: YANGTOOLS-1007
Change-Id: I08ba4dcf3aaf758f12b42e625d9d17a774d07825
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 9 Jul 2019 22:41:35 +0000 (00:41 +0200)]
Add AbstractIdentifiable
This utility class allows us to share Identifiable implementation
subclasses. This reduces the number of implementations present.
Change-Id: I87132f0b434339a55c4911c96affabb2afb67602
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 9 Jul 2019 21:29:53 +0000 (23:29 +0200)]
Add AbstractSchemaContextProvider
In most SchemaContextProvider cases we are dealing with a constant
SchemaContext. Codify that in AbstractSchemaContextProvider.
Change-Id: If4e8fea593ab30d10da0d206b379aba407627677
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 9 Jul 2019 12:00:32 +0000 (14:00 +0200)]
Fix yang-parser-rfc7950 module name
The bundle has wrong Automatic-Module-Name, fix that up.
Change-Id: Ieb6821dac0ea8ab8130fc498b7e032eb174890b8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>