yangtools.git
5 years agoDo not clutter logs with a thrown exception 58/76258/2
Robert Varga [Wed, 19 Sep 2018 10:48:17 +0000 (12:48 +0200)]
Do not clutter logs with a thrown exception

SourceException is an unchecked exception which we handle at a higher
layer. The logging statement does not add anything useful, so let's
remove it.

Change-Id: I8a4654b44469a2193996d1d90e982d01a1a62bf3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix TypedefEffectiveStatementImpl double-checked load 56/76256/2
Robert Varga [Wed, 19 Sep 2018 10:46:46 +0000 (12:46 +0200)]
Fix TypedefEffectiveStatementImpl double-checked load

We really need a volatile read here to make things alright, make
the field volatile.

Change-Id: Id04917a04f9f1fdba6ded2c773571d90106e877f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove unneeded interface declaration 55/76255/1
Robert Varga [Wed, 19 Sep 2018 10:45:59 +0000 (12:45 +0200)]
Remove unneeded interface declaration

DataNodeContainer is already specified by superclass, no need to
repeat that declaration.

Change-Id: I9a409662d87b02ec9b4abcba88c90bccf684829a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump version for 2.0.6.4 13/76213/1
Robert Varga [Tue, 18 Sep 2018 12:30:45 +0000 (14:30 +0200)]
Bump version for 2.0.6.4

This bumps versions to next development cycle.

Change-Id: I3c659625d7582014bc8182980f37b5a35957cf2a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix logging template 29/76029/2
Robert Varga [Wed, 12 Sep 2018 09:31:27 +0000 (11:31 +0200)]
Fix logging template

Logger template is missing a placeholder, add it.

Change-Id: Ib1068bc4e122affc69e408da87378230607b7408
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit cac1831a621574716e403afe7997360308758fa6)

5 years agoConsider AugmentationNodes when direct descendant is not found 40/75940/1
Marek Gradzki [Tue, 14 Aug 2018 08:05:37 +0000 (10:05 +0200)]
Consider AugmentationNodes when direct descendant is not found

With previous refactors it is quite easy to arrive at a simple
solution to take augmentations into account. This also

This includes a unit test from upstream based on afi-safi-name
with bgp-openconfig-extensions.

JIRA: YANGTOOLS-892
Change-Id: I237ed2c6cbed458a2109a48b468a30650f103a48
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEliminate LeafRefValidation.forEachChoice() 38/75938/2
Robert Varga [Mon, 10 Sep 2018 15:19:51 +0000 (17:19 +0200)]
Eliminate LeafRefValidation.forEachChoice()

As it turns out the two call sites can share more code. Introduce
processChildNode(), inlining forEachChoice() and its surrounding
lookup logic.

JIRA: YANGTOOLS-892
Change-Id: I2091abcd579ce1d48a628c3bdea9b4514b050e29
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoSplit up LeafRefValidation.validateNodeData() 19/75919/1
Robert Varga [Mon, 10 Sep 2018 10:02:20 +0000 (12:02 +0200)]
Split up LeafRefValidation.validateNodeData()

Turn this method into a dispatch and move logic into dedicated
methods. This makes it easier to follow the code flow and eliminate
duplicates.

JIRA: YANGTOOLS-892
Change-Id: I840fa0d2e8c7ea86efa05c1afea825e85d890837
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 3d22aba92422b08413d95b372ac11a2b26296a01)

5 years agoMinor code cleanups 16/75916/1
Robert Varga [Mon, 10 Sep 2018 09:43:07 +0000 (11:43 +0200)]
Minor code cleanups

- static private method
- reduce use of ChoiceSchemaNode.getCaseNodeByName()
- QNameWithPredicateBuilder(QName)

Change-Id: I9cf97ba4c6ef667e39212f511e17bb18b4002bc3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit ef795628f150556ddc8c93b865d1c3c0b9b0109c)

5 years agoUse Iterables.filter() instead of FluentIterable 12/75912/1
Robert Varga [Mon, 10 Sep 2018 08:36:12 +0000 (10:36 +0200)]
Use Iterables.filter() instead of FluentIterable

This removes allocation of one instance of FluentIterable, reducing
the amount of garbage we produce.

Change-Id: I93953f1263426f7fff20e579e56f82506fb423d4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit ca61467e9c4e802584a1475da15c01cc5ea8e83a)

5 years agoRename LeafRefValidatation to LeafRefValidation 39/75839/1
Robert Varga [Fri, 7 Sep 2018 10:22:25 +0000 (12:22 +0200)]
Rename LeafRefValidatation to LeafRefValidation

This is a naming typo which went unnoticed for quite some time,
rename the implementation class and instantiate a proxy for
compatibility.

JIRA: YANGTOOLS-892
Change-Id: I3ec77d7df41942502394047e9e13007c6693d3af
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 2d5b39317c3c5db3fa9c4c258175340d3e347c38)

5 years agoRework choice iteration in LeafRefValidatation 37/75837/1
Robert Varga [Fri, 7 Sep 2018 09:14:48 +0000 (11:14 +0200)]
Rework choice iteration in LeafRefValidatation

Rather than extracting ChoiceNodes into a temporary list, use
a consumer which will be invoked for each of them.

JIRA: YANGTOOLS-892
Change-Id: I0956bed6e446c1ee4bf44c88fcc361abe8a508e5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 4a29fdd9dadf755ff6b3b6e34e9ff43c22a6b765)

5 years agoCleanup map iteration in LeafRefValidatation 34/75834/1
Robert Varga [Fri, 7 Sep 2018 09:07:09 +0000 (11:07 +0200)]
Cleanup map iteration in LeafRefValidatation

We have two codepaths for non-filtered and filtered map entry case,
which end up iterating over map entries. Rewrite the code in terms
of an optionally-filtered stream, reducing code duplication.

JIRA: YANGTOOLS-892
Change-Id: I3ca37edb66373cc5ab4632210980cd4a467fd198
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRework path LeafRefValidatation path tracking 32/75832/1
Robert Varga [Fri, 7 Sep 2018 08:36:20 +0000 (10:36 +0200)]
Rework path LeafRefValidatation path tracking

Rather than using a plain iterable sourced from LeafRefPath.getPathFromRoot(),
maintain a Deque sourced via getPathTowardsRoot(). This eliminates the need
for Iterables.skip() as well as not forcing getPathFromRoot() being initialized.

Change-Id: I23c054a63b2c0ceed24fcf48d2636508ee13d568
JIRA: YANGTOOLS-892
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoPass down predicates instead of the entire predicate node 10/75810/1
Robert Varga [Wed, 5 Sep 2018 22:15:47 +0000 (00:15 +0200)]
Pass down predicates instead of the entire predicate node

Since we are not using the rest of the data, it is much simpler
to just pass down predicates. It also reduces confusion as to
what state we are propagating.

Change-Id: If790fcc2a8d023cb863d09162b25d644b0dd4638
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit e8ecfb6f906dfd7e7bff791abf0b601eb71766a8)

5 years agoDo not validate non-existent roots 09/75809/1
Robert Varga [Wed, 5 Sep 2018 21:39:18 +0000 (23:39 +0200)]
Do not validate non-existent roots

If we have no data there is no point to validate anything, and
having the root value as an invariant makes code a lot simpler.

JIRA: YANGTOOLS-892
Change-Id: Ifd68b09c03d90c8881381809047e59f3fe92682b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit d2e80009970418f4755854f0918c5d80afb21a34)

5 years agoAdd LeafRefValidatation.computeValues() 08/75808/1
Robert Varga [Wed, 5 Sep 2018 21:24:30 +0000 (23:24 +0200)]
Add LeafRefValidatation.computeValues()

This separates out the heavy-weight value computation, simplifying
callers a bit.

JIRA: YANGTOOLS-892
Change-Id: I218659f830aec822f80decd3622c9890df832379
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit dd1f03b367b7fcec4d3a0a10bc81d4126d7c88f4)

5 years agoEliminate leafRefTargetNodeDataLog() 02/75802/1
Robert Varga [Wed, 5 Sep 2018 20:12:02 +0000 (22:12 +0200)]
Eliminate leafRefTargetNodeDataLog()

Now that we captured invariants, we can proceed to turn
leafRefTargetNodeDataLog() into a simpler lambda form.

JIRA: YANGTOOLS-892
Change-Id: I4644d0f3bc31f9f9cb3643e8443159522f14ccaa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 86e7fb7d83ea73633b4e50bfbe95ded122b69a85)

5 years agoUntangle result processing logic. 00/75800/1
Robert Varga [Wed, 5 Sep 2018 19:33:55 +0000 (21:33 +0200)]
Untangle result processing logic.

leafRefTargetNodeDataLog() is needlessly complex, where it is called
with 3 different sets of arguments from validateLeafRefTargetNodeData()
only.

Inline two of those callers, reducing nesting significantly and
making the code flow more obvious.

Change-Id: I68205d58677e2392989a5fc064a986f5c1716666
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit a538bafb5db59101206a5d1fd2a1d31e79c08de0)

5 years agoMove LeafRefPath creation from fast path 99/75799/1
Robert Varga [Wed, 5 Sep 2018 18:15:00 +0000 (20:15 +0200)]
Move LeafRefPath creation from fast path

LeafRefValidation is the fast path and LeafRefPath we are creating
is in an invariant. Cache it in LeafRefContext as needed.

JIRA: YANGTOOLS-892
Change-Id: I40ef136630b7cdacca84b2f08a9e0491daa03c14
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 4b7393b11151722f44c19236684c661cf5f8edd0)

5 years agoCleanup leafref path parsing 96/75796/1
Robert Varga [Wed, 5 Sep 2018 17:39:45 +0000 (19:39 +0200)]
Cleanup leafref path parsing

We have a String on input and LeafRefPathParserImpl uses ANTLR's
CharStreams -- hence it makes no sense to bounce input through
an InputStream.

Remove this atrocity, eliminating an IOException/IllegalStateException
error path in process.

JIRA: YANGTOOLS-892
Change-Id: I78eadf30da6a1e64621ca4c14dfa13e84524b591
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 23b7ff7e2e39e0d520e249ae5b256746acef5abd)

5 years agoCleanup LeafRefContext(Tree)Builder 82/75782/1
Robert Varga [Wed, 5 Sep 2018 17:28:16 +0000 (19:28 +0200)]
Cleanup LeafRefContext(Tree)Builder

These are package-private classes, make them final, eliminate
unneeded methods and improve code formatting.

JIRA: YANGTOOLS-892
Change-Id: I8a4925a665b1bcac7abd8088719e80f53229bafe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit d76c8ce876f2609dd9775eb58cfd2ee012b27ad9)

5 years agoDo not leak Optional in QNameWithPredicateImpl.toString() 66/75766/2
Robert Varga [Wed, 5 Sep 2018 15:19:49 +0000 (17:19 +0200)]
Do not leak Optional in QNameWithPredicateImpl.toString()

The toString() method blindly appends the revision, leading to
Optional[] being present in the result. Fix the method to look
at the returned version and append the query only when it is
present -- just like QName does.

Change-Id: I47dcdaa3c7ca7b3bfaf34898f76b10dfb2ddbe00
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 1951860b7c0ae2a74735a138b3227e09fd718745)

5 years agoCleanup LeafRefPath 64/75764/1
Robert Varga [Wed, 5 Sep 2018 15:46:13 +0000 (17:46 +0200)]
Cleanup LeafRefPath

Remove commented-out code and cleanup javadocs.

Change-Id: I7d6d62bd091191d3ab914a5767eaf4a2ab7830b4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 8f950a793a451558a137b4057b9680fccf408752)

5 years agoConsider namespace in namesakes 17/75717/3
Robert Varga [Wed, 5 Sep 2018 10:53:46 +0000 (12:53 +0200)]
Consider namespace in namesakes

XML (unlike JSON) has explicit namespaces which we need to take
into consideration when determining whether two elements have the
same name.

JIRA: YANGTOOLS-900
Change-Id: I0d53bee5d18d211343c094941985bd3f0b6a8776
Signed-off-by: Isabel Lloret <illoret@indra.es>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump versions for next version 06/75606/1
Robert Varga [Fri, 31 Aug 2018 08:06:20 +0000 (10:06 +0200)]
Bump versions for next version

This starts the 2.0.6.3 release cycle.

Change-Id: I6ee4d643d9118ec24525bd365d9569a85b39a088
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoOmit empty attributes in toString() 17/75517/1
Robert Varga [Mon, 27 Aug 2018 15:05:09 +0000 (17:05 +0200)]
Omit empty attributes in toString()

Do not emit attributes when they are empty, which brings
the verbosity down quite a bit -- as this is typically the case.

Change-Id: Icb2fa7abb02e9714fed640ec07af1623056a73db
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 032751054483c095a91eb3bf820b133a6b256dc5)

5 years agoDo not use SchemaNodeIdentifierBuildNamespace prerequisites 16/75516/1
Robert Varga [Thu, 12 Jul 2018 09:26:35 +0000 (11:26 +0200)]
Do not use SchemaNodeIdentifierBuildNamespace prerequisites

Incremental lookups on ChildSchemaNodeNamespace allow us to react
to childen being created, hence we do not have an assumption that
the target node must be instantiated by someone else (like eager
instantiation).

This will also allow us better recovery if the target node is not
going to appear due to being disabled by if-feature.

JIRA: YANGTOOLS-694
Change-Id: Ibc05e18037bb85d42ed7123293e7f83f896aad5d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 509988128ed9d5fe314a14906114f53778200e47)

5 years agoOptimize ImmutableNodes.fromInstanceId() 02/75502/1
Robert Varga [Mon, 27 Aug 2018 09:23:09 +0000 (11:23 +0200)]
Optimize ImmutableNodes.fromInstanceId()

We are doing a single pass over the YangInstanceIdentifier, hence
we can simply iterate over the nodes, without creating another
YangInstanceIdentifier at each step.

Also cleanup method visibility, mark methods final and merge some
common codepaths.

JIRA: YANGTOOLS-897
Change-Id: I7bd599436dd16f943bae71f3adce289164be25c2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 38c0fcab1667af91ef8ee0fc1e4b1cd9075f031a)

5 years agoFix unique argument parser 32/75232/1
Robert Varga [Thu, 16 Aug 2018 12:30:11 +0000 (14:30 +0200)]
Fix unique argument parser

Unique argument can use horizontal tabs and line-breaks as separators
in addition to spaces. Deal with them instead of rejecting input.

Change-Id: I5fb6137b9b73c5c844a05cc59fb9261868834a24
JIRA: YANGTOOLS-893
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 68de00c780737c1844f7d045d6f1ecfd0e83f957)

5 years agoLoosen RpcResultBuilder argument 31/75231/1
Robert Varga [Fri, 10 Aug 2018 10:57:10 +0000 (12:57 +0200)]
Loosen RpcResultBuilder argument

withRpcErrors can accept a collection of any RpcError subclasses,
express that in the API contract.

Change-Id: I8f302874cb509474e3a974e3b4730338984eda78
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 5bdf2e72626b1cd8c9e98a984e9fc28465d72454)

5 years agoAdd NamespaceBehaviour.toString() 30/75230/1
Robert Varga [Wed, 8 Aug 2018 15:54:06 +0000 (17:54 +0200)]
Add NamespaceBehaviour.toString()

A toString() method aids debugging immensely, define some basic
implementations.

Change-Id: I69c6b0027d81ae3a7c6a9304129feef6453e2f1f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 02833cf71885aa15743e44e20f4202269c59de3e)

5 years agoFix yang-data-jaxen dependencies 78/74878/1
Robert Varga [Mon, 6 Aug 2018 14:32:51 +0000 (16:32 +0200)]
Fix yang-data-jaxen dependencies

We should depend on yang-data-impl for testing only.

Change-Id: Ib7028a1e44f504c08fe5a41707e2089d7d770f27
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 720fcde7315091a4f867b4aa132b77257d96c9c9)

5 years agoAllows to find child of Operation definition (RPC, Action) 76/74876/1
Jakub Tóth [Mon, 6 Aug 2018 11:43:58 +0000 (13:43 +0200)]
Allows to find child of Operation definition (RPC, Action)

Change-Id: Ie1048ed6d294a507cc90c65ded7dbfb6d8c6018f
Signed-off-by: Jakub Tóth <jakub.toth@pantheon.tech>
(cherry picked from commit 4f68bd4311ed99056016241ed0e8c2763d021a91)

5 years agoMake sure we mark phase modification 75/74875/1
Robert Varga [Fri, 3 Aug 2018 18:23:46 +0000 (20:23 +0200)]
Make sure we mark phase modification

Once we resolve the target we need to paint it, so it does not
complete before our modification has had a chance to run.

JIRA: YANGTOOLS-859
Change-Id: I8b29a8eef4d01f8c02d13d759061e93c379029e5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit fe1b8d96db60a32df65f4eaabced39e87dc3db5b)

5 years agoMigrate @Nullable annotation 74/74874/1
Robert Varga [Fri, 3 Aug 2018 18:32:07 +0000 (20:32 +0200)]
Migrate @Nullable annotation

Migrating the annotation fixes an eclipse warning.

Change-Id: I8a07c05e4bf0b61c5dfa2b0ba1d15bb0a7ae89e8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit c9ca05f30cb2a61b4f92db6b324d29248d713326)

5 years agoCentralize AugmentationIdentifier instantiation 73/74873/1
Robert Varga [Fri, 3 Aug 2018 09:58:08 +0000 (11:58 +0200)]
Centralize AugmentationIdentifier instantiation

We have duplicate code all over the place, centralize this in
DataSchemaContextNode.

Change-Id: Icb79740b3a113d0383d583403d48e9a5f427eb66
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit e24054c832e38b877db653fc9bb77041b3b2c0ed)

5 years agoRemove duplicate instantiation of EffectiveAugmentationSchema 72/74872/1
Robert Varga [Fri, 3 Aug 2018 09:34:53 +0000 (11:34 +0200)]
Remove duplicate instantiation of EffectiveAugmentationSchema

We have four independent call sites, doing the same thing. Unify
all the callers behind EffectiveAugmentationSchema.create().

Change-Id: Ib4e4202cd64cff15d35cf275afbba7c00f853121
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 74ed5b525c1474eb10e3396a307578738bc38040)

5 years agoFix LeafRefContext for relative refs defined in external grouping 71/74871/1
Marek Gradzki [Mon, 30 Jul 2018 06:45:29 +0000 (08:45 +0200)]
Fix LeafRefContext for relative refs defined in external grouping

LeafRefPathParserListenerImpl builds LeafRefPath
using namespace of the module which contains leafref definition.

While it is valid approach for absolute paths with prefix (YANGTOOLS-749),
it cannot be used with groupings, because they are bound to namespace
when contents of the grouping is added to the schema tree.

This patch fixes the relative path case
by using the module which uses leafref.

JIRA: YANGTOOLS-891
Change-Id: Ia903138f80c437937374eb7d3460fdbe8b2a97c2
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
(cherry picked from commit b1feee95519d1bed1387ba417d7ab06eee86e3f9)

5 years agoUpdate toString() encapsulation 70/74870/1
Robert Varga [Wed, 1 Aug 2018 12:40:43 +0000 (14:40 +0200)]
Update toString() encapsulation

Since we do not know the contents/format of toString() return,
make sure we bracket it.

Change-Id: Id552bb59bf3beb62548d5860ab9abe2db062bf80
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit d5818ff79bca67d6a3e979f92cdd073c0eac9770)

5 years agoPropagate delegate.toString() as symbolic name 69/74869/1
Robert Varga [Wed, 1 Aug 2018 10:31:22 +0000 (12:31 +0200)]
Propagate delegate.toString() as symbolic name

With use of delegated ByteSources we are losing location of the
source, as there is no symbolic name being filled in.

Change-Id: Ie53207ca3af13de49a8b45d11b78ebb828145e66
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 80f0dd69c279acfe7bc067b89c55861956b4760f)

5 years agoRework identifier path subscription 68/74868/1
Robert Varga [Tue, 31 Jul 2018 13:21:19 +0000 (15:21 +0200)]
Rework identifier path subscription

Rather than creating multiple prerequisites, define the logic
inside a dedicated class, which gets reused.

JIRA: YANGTOOLS-859
Change-Id: I25259bd4571bc684b0f25d9d058efd5ff1d7798b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit bcd7ebad233e98d1774e861676149af63854bc48)

5 years agoAvoid depending on immutables.value at runtime 67/74867/1
Stephen Kitt [Tue, 31 Jul 2018 09:29:37 +0000 (11:29 +0200)]
Avoid depending on immutables.value at runtime

Change-Id: I7e4ffea6b51523341e46380c3754d788f676a664
Signed-off-by: Stephen Kitt <skitt@redhat.com>
(cherry picked from commit 8ed3332603523219d19bd8481664790db4d8acc7)

5 years agoIntroduce map-related ImmutableNodes operations 66/74866/1
Robert Varga [Mon, 30 Jul 2018 22:23:52 +0000 (00:23 +0200)]
Introduce map-related ImmutableNodes operations

These will come in handy for creating empty lists.

JIRA: YANGTOOLS-585
Change-Id: I3173baa03d540196caf50312652dba1876b8b1b9
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit c4ccd44a8fa713470f49f83c1cdb7b6c1cc72891)

5 years agoExpand CompatUtils to handle leaf-lists 65/74865/1
Robert Varga [Mon, 30 Jul 2018 05:21:55 +0000 (07:21 +0200)]
Expand CompatUtils to handle leaf-lists

The rules outlined in compatLeafType are applicable to leaf-lists,
too. Allow leaf-list types to be queried by adding a TypedDataSchemaNode
variant as compatType().

Change-Id: Ia6a3e4cf198069137c470008fde934de64b96996
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 1c444bb73ea2b53c299a8e779d1e804a5de1f05e)

5 years agoUpdate CursorAwareDataTree{Modification,Snapshot} API 64/74864/1
Robert Varga [Sat, 28 Jul 2018 08:26:56 +0000 (10:26 +0200)]
Update CursorAwareDataTree{Modification,Snapshot} API

Create an explicit openCursor() method and return Optional instead
of a Nullable.

Change-Id: I6a9f11726f85acb86e6aaf30b7ede12b8420da37
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 7aa7e29cda8726a9f05ee30a38be17a120e77644)

5 years agoBump versions for next version 57/74757/1
Robert Varga [Thu, 2 Aug 2018 08:20:50 +0000 (10:20 +0200)]
Bump versions for next version

This starts the 2.0.6.2 release.

Change-Id: If45b4209288df09320edff27542dfeacd66b7c24
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRevert "Add SchemaTreeAwareEffectiveStatement" 61/74661/1
Robert Varga [Mon, 30 Jul 2018 17:00:03 +0000 (19:00 +0200)]
Revert "Add SchemaTreeAwareEffectiveStatement"

This reverts commit eae57f9cd4605c5b13a24d843c0e4278d8b5deb2.

Change-Id: If651cc6d925c1f9ea616a75ffd426a49666b5ee1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRevert "Add DataTreeAwareEffectiveStatement" 60/74660/1
Robert Varga [Mon, 30 Jul 2018 17:00:01 +0000 (19:00 +0200)]
Revert "Add DataTreeAwareEffectiveStatement"

This reverts commit 29919477f00777a6e8b42560af159438d54847f4.

Change-Id: I8e75393bf0c6c1f56c8004ffed520b48f66af7f6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRevert "Fix JDK9 compilation" 59/74659/1
Robert Varga [Mon, 30 Jul 2018 16:59:59 +0000 (18:59 +0200)]
Revert "Fix JDK9 compilation"

This reverts commit 8092c5b5ee7c018ec4ad16246b98e55696662e70.

Change-Id: I210f8cef662f67a195ed1c079400987735989858
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoChange versions to 1.0.6.1/2.0.6.1-SNAPSHOT 58/74658/1
Robert Varga [Mon, 30 Jul 2018 16:57:44 +0000 (18:57 +0200)]
Change versions to 1.0.6.1/2.0.6.1-SNAPSHOT

Revert versions to their baselines for v2.0.6.x branch.

Change-Id: I65888093cf18c95bdad710891f7e2ea839fc6932
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix LeafRefValidatation for refs defined in augmentations 38/74338/2
Marek Gradzki [Tue, 17 Jul 2018 12:09:23 +0000 (14:09 +0200)]
Fix LeafRefValidatation for refs defined in augmentations

LeafRefValidatation.validateNodeData traverses
children of a NormalizedNode
that contain leafrefs or are leafrefs' targets.

Information about referencing nodes and nodes being referenced
is stored in LeafRefContext under QName key.

But AugmentationNode has no QName, so validation was failing
with UnsupportedOperationException.

As a fix, validateNodeData is recursively invoked on AugmentationNode,
to fall into DataContainerNode case.

JIRA: YANGTOOLS-821
Change-Id: I5de7c814f0abe0aec31cced24ea09692bd63a584
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
5 years agoBump to odlparent 3.1.3 34/74234/1
Stephen Kitt [Thu, 19 Jul 2018 12:56:35 +0000 (14:56 +0200)]
Bump to odlparent 3.1.3

Change-Id: I9bdc0215beda398b989bce092df37f3a84f9105a
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoBump to next development version 72/74072/1
Robert Varga [Mon, 16 Jul 2018 16:42:21 +0000 (18:42 +0200)]
Bump to next development version

This bumps artifacts 2.0.9/1.0.9-SNAPSHOT.

Change-Id: Ifb1d79ee70e02545b025d2929af7eead9f8958f3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRefactor YangFunctionContext 58/74058/5
Robert Varga [Mon, 16 Jul 2018 08:04:04 +0000 (10:04 +0200)]
Refactor YangFunctionContext

This fixes code duplication, making sonar happy.

Change-Id: I068b46d654d8f8df378fda7434eb97fba6b8e92f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd AbstractEffectiveOperationContainerSchemaNode 60/74060/4
Robert Varga [Mon, 16 Jul 2018 08:47:32 +0000 (10:47 +0200)]
Add AbstractEffectiveOperationContainerSchemaNode

InputEffectiveStatementImpl and OutputEffectiveStatementImpl are
pretty much exactly the same, add a common superclass to hold their
implementation.

Change-Id: I1b7b174a006da8430f233a1ac43591cdf6563912
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoIntroduce AbstractEffectiveOperationDefinition 59/74059/4
Robert Varga [Mon, 16 Jul 2018 08:35:38 +0000 (10:35 +0200)]
Introduce AbstractEffectiveOperationDefinition

RpcEffectiveStatementImpl and ActionEffectiveStatementImpl share
most of their implementation, extract it into a common class --
AbstractEffectiveOperationDefinition

Change-Id: I8ef70d065a0f5c667843613a2df939ce4a5fb5b3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDeclaredStatements can contain default implementations 54/74054/8
Robert Varga [Sun, 15 Jul 2018 23:51:59 +0000 (01:51 +0200)]
DeclaredStatements can contain default implementations

This eliminates code duplication in implementations, hence is useful
to centralize as a default method.

Change-Id: Icbb1c23018d0104d2e86cb309063b6f924b35337
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd ConfigStatementContainerDeclaredStatement 53/74053/2
Robert Varga [Sun, 15 Jul 2018 23:38:16 +0000 (01:38 +0200)]
Add ConfigStatementContainerDeclaredStatement

The missing link between ConfigContainerStatement and DeclaredStatement
is filled in, providing a default implementation getConfig().

Change-Id: Icc9c65b0d74bcb0a8a8d1db13514c3ffca86038d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd DeclaredStatement utility methods 52/74052/1
Robert Varga [Sun, 15 Jul 2018 23:17:09 +0000 (01:17 +0200)]
Add DeclaredStatement utility methods

Effective and Declared statements should share utility methods,
hence update DeclaredStatement to include them.

Change-Id: Ifb9a2b4aedd41ef93c02995e99dc51897dc57db1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoYANGTOOLS-890 - Fix XML parser bug 33/73933/4
Michal Cmarada [Wed, 11 Jul 2018 15:18:59 +0000 (17:18 +0200)]
YANGTOOLS-890 - Fix XML parser bug

When model contains list which has the same name as its
encapsulating parent container it leads to
IllegalStateException: Attributes can be extracted only
from START_ELEMENT. This is caused by list not beeing
processed correctly and one additional empty list item
is created. To fix this it is necessary to end the loop
when end list element is reached.

Change-Id: I0d6f6ec356e503fcfc941f18d9133ea0c9cebc6c
Signed-off-by: Michal Cmarada <michal.cmarada@pantheon.tech>
5 years agoFix inappropriate warning. 18/74018/1
Dana Kutenicsova [Fri, 13 Jul 2018 13:26:58 +0000 (15:26 +0200)]
Fix inappropriate warning.

Change-Id: Ib6545ec0ab3911050f9b8f34f81f240620b2f0ea
Signed-off-by: Dana Kutenicsova <dkutenicsova@frinx.io>
5 years agoAdd ObjectRegistry 59/73959/5
Robert Varga [Wed, 11 Jul 2018 21:48:29 +0000 (23:48 +0200)]
Add ObjectRegistry

This is a cleaned-up version of ListenerRegistry, providing a simple
API.

Change-Id: Ic98c702523530db746449d50e6d910cb278261a4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove CPD-reported copy&paste 77/73977/1
Robert Varga [Thu, 12 Jul 2018 11:50:22 +0000 (13:50 +0200)]
Remove CPD-reported copy&paste

This refactors methods to have a common utility, keeping CPD happy.

Change-Id: I94e003a8d06fb7047ddfc51ae12c78b348334de6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd support for incremental Prerequisites 71/73971/3
Robert Varga [Thu, 12 Jul 2018 09:14:45 +0000 (11:14 +0200)]
Add support for incremental Prerequisites

We really need a method which would allow us to follow a path,
hooking incrementally to each of the elements as they appear.

This patch adds the mechanics to support that lookup, rendering
SchemaNodeIdentifierBuildNamespace largely superfluous, as we
can perform equivalent lookups on ChildSchemaNodeNamespace.

JIRA: YANGTOOLS-859
Change-Id: I7dae9559555ee6ddc95faf1f874cebac9f915c1b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd AbstractDelegator.toString() 61/73961/1
Robert Varga [Wed, 11 Jul 2018 22:40:08 +0000 (00:40 +0200)]
Add AbstractDelegator.toString()

It is useful to provide a baseline identification, add the bits
needed.

Change-Id: I5d1c0e324672d150cf13a5de1a20f3aaa7d7dea4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUpdate ListenerRegistry implementation 57/73957/2
Robert Varga [Wed, 11 Jul 2018 20:31:26 +0000 (22:31 +0200)]
Update ListenerRegistry implementation

ListenerRegistry needs some usability improvements in the future,
as well as it can be written with better GC behavior.

Change-Id: Ibcef7af65816a0f084b8614718bade64a3f0f11d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDocument Delegator and AbstractDelegator 50/73950/1
Robert Varga [Wed, 11 Jul 2018 18:10:34 +0000 (20:10 +0200)]
Document Delegator and AbstractDelegator

Document Delegator.getDelegate() and add an abstract base class
for implementations.

Change-Id: I36426d1862b786fc5413baed7d6ded1fd3f5d4e5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoReduce sonar code smells 78/73878/1
Robert Varga [Tue, 10 Jul 2018 11:19:21 +0000 (13:19 +0200)]
Reduce sonar code smells

In an effort to get Sonar cleaned up, remove valid code smells
reported by it.

Change-Id: I4fc293fbc29c786699c247648b7c0af68044bded
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUpdate ModuleActionBuilder and StmtContext documentation 53/73853/1
Robert Varga [Mon, 9 Jul 2018 16:45:25 +0000 (18:45 +0200)]
Update ModuleActionBuilder and StmtContext documentation

This patch clarifies the API contract around reactor primitives,
so it is clearer as to what the arguments and methods mean.

JIRA: YANGTOOLS-859
Change-Id: I8c4eed7c43dc217547cce57855768b342a698b90
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoLimit namespace lookps of import prefixes 52/73852/2
Robert Varga [Mon, 9 Jul 2018 16:34:28 +0000 (18:34 +0200)]
Limit namespace lookps of import prefixes

Namespace definitions of ImpPrefixToNamespace, ImportPrefixToModuleCtx
and ImportPrefixToSemVerSourceIdentifier are wrong in that they include
search within other imported modules.

This is overreaching and results in false-positive lookups on these
namespaces -- i.e. even prefixes which are not declared in the local
source are lookup up successfully if a matching definition is found
in any of the modules which are imported by local module.

JIRA: YANGTOOLS-889
Change-Id: I28adefef4651a15b191915d7d50d5359d78cb9fe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix ModificationPath.toString() reference 11/73711/1
Robert Varga [Tue, 3 Jul 2018 15:25:37 +0000 (17:25 +0200)]
Fix ModificationPath.toString() reference

Adding ModificationPath unfortunately broke message reporting
in ModifiedNodeDoesNotExistException. Fix that by capturing
YangInstanceIdentifier and reuse it for String.format().

Change-Id: I0e35bdc1362913d6c2794b2187f8152846a913a5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump version for next development cycle 56/73456/1
Robert Varga [Tue, 26 Jun 2018 17:03:21 +0000 (19:03 +0200)]
Bump version for next development cycle

This patch starts the 2.0.8 development cycle.

Change-Id: I1f82ddc6375b0dd3690b6844fce1e3932e801745
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump odlparent to 3.1.2 02/72502/3
Stephen Kitt [Wed, 30 May 2018 13:54:04 +0000 (15:54 +0200)]
Bump odlparent to 3.1.2

Change-Id: I9da9e4659105f76e2c60574a2af7c9dd7c8515cd
Signed-off-by: Stephen Kitt <skitt@redhat.com>
5 years agoFix JDK9 pattern handling 01/73301/1
Robert Varga [Thu, 21 Jun 2018 11:04:11 +0000 (13:04 +0200)]
Fix JDK9 pattern handling

Java 9's Pattern is reporting different error strings, deal with
that.

Change-Id: I8f3035530f10a77b23f1531c0ced0b0532795608
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix JDK9 compilation 00/73300/1
Robert Varga [Thu, 21 Jun 2018 11:03:43 +0000 (13:03 +0200)]
Fix JDK9 compilation

We need an explicit cast here to suppress javac9 error.

Change-Id: I82b2d6b06a26eebc773863c217a044c56e9432e4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd DataTreeAwareEffectiveStatement 07/72907/18
Robert Varga [Tue, 27 Feb 2018 08:25:29 +0000 (09:25 +0100)]
Add DataTreeAwareEffectiveStatement

YANG defines two distinct ways to look at a YANG model:
- schema tree: The definition hierarchy specified within a module.
- data tree: An instantiated tree of any data modeled with YANG,
             e.g., configuration data, state data, combined
             configuration and state data, RPC or action input,
             RPC or action output, or notification.

This means that there really are two notions of 'a child node',
based on schema tree, or based on data tree. The data tree is
a strict subset of schema tree. The layout of the data tree is
such that it does not include RPCs, actions nor notifications --
addressing data tree nodes encapsulated in these requires
first reaching the encapsulation point via schema tree walk.

This patch introduces DataTreeAwareEffectiveStatement
and its companion DataTreeEffectiveStatement, updating extant
statements to support it.

Construction of this namespace has a side-effect of finding
duplicate data nodes within each level of hierarchy, thus fixing
YANGTOOLS-883.

JIRA: YANGTOOLS-853
JIRA: YANGTOOLS-883
Change-Id: Id02bb2557845000fe7fa90d1bf56c8425cce24fb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Jie Han <han.jie@zte.com.cn>
5 years agoAdd SchemaTreeAwareEffectiveStatement 17/69217/22
Robert Varga [Tue, 27 Feb 2018 08:25:29 +0000 (09:25 +0100)]
Add SchemaTreeAwareEffectiveStatement

YANG defines two distinct ways to look at a YANG model:
- schema tree: The definition hierarchy specified within a module.
- data tree: An instantiated tree of any data modeled with YANG,
             e.g., configuration data, state data, combined
             configuration and state data, RPC or action input,
             RPC or action output, or notification.

This means that there really are two notions of 'a child node',
based on schema tree, or based on data tree. The data tree is
a strict subset of schema tree.

This patch introduces SchemaTreeAwareEffectiveStatement
and its companion SchemaTreeEffectiveStatement, updating extant
statements to support it.

JIRA: YANGTOOLS-853
Change-Id: Id2c41bb30c4376a846e4e974033b6d621ecfb155
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump version for next development version 89/72889/1
Robert Varga [Tue, 12 Jun 2018 16:01:08 +0000 (18:01 +0200)]
Bump version for next development version

This is start of yangtools-2.0.7.

Change-Id: I8d4bbd2b5a2cab84e67cb74d71a83ec85f289b68
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoImprove FilesystemSchemaSourceCache mkdirs handling 93/72793/1
Tom Pantelis [Fri, 8 Jun 2018 13:34:19 +0000 (09:34 -0400)]
Improve FilesystemSchemaSourceCache mkdirs handling

mkdirs returns false if the directory already exists. Although
it check exists prior to mkdirs, it's possible for the dir to be
created by another thread in between the calls so make it robust
by checking isDirectory (which also checks exists) if mkdirs returns
false.

Change-Id: If63a2d20400c3093f0aea4c22192fa0e01fde748
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
5 years agoFix SchemaContextUtil RevisionAwareXPath resolution 22/72722/7
Robert Varga [Wed, 6 Jun 2018 11:37:04 +0000 (13:37 +0200)]
Fix SchemaContextUtil RevisionAwareXPath resolution

The mapping of yang-model-api SchemaNode hierarchy to YANG namespaces
is confusing, which is compounded by naming -- invoking notions
of equivalence when there is none.

This is very much evident when dealing with children identified by
QName in various contexts -- they usually work, but break down when
choice/case nodes are encountered, because their addressability is
different based on context -- they are addressable via 'node identifier',
but are invisble to XPath contexts.

Document the difference in extant DataNodeContainer and DataSchemaNode
API and introduce DataNodeContainer.findDataNode(), which follows
RFC7950 'data tree', not 'schema tree'.

Change-Id: Ic570da8dd97a686423c7e2b28e0db0d9c6907271
JIRA: YANGTOOLS-885
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoImprove SingletonSet.spliterator() 69/72469/4
Robert Varga [Wed, 30 May 2018 10:31:24 +0000 (12:31 +0200)]
Improve SingletonSet.spliterator()

We can use a Iterator-less version of the spliterator, adding
further characteristics. Expose these spliterators via
SingletonSpliterators utility class.

Change-Id: I3d7e19cc303c2f0c9c9d79d173bb78d8d5b77eac
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd util.concurrent.FluentFutures 54/72454/3
Robert Varga [Tue, 29 May 2018 23:26:05 +0000 (01:26 +0200)]
Add util.concurrent.FluentFutures

FluentFuture provides a lot of ergonomy for API users, so we should
promulgate its use. Unfortunately Guava does not provide convenient
enough APIs and lacks some common constants which are useful.

JIRA: YANGTOOLS-884
Change-Id: I5989f5b3cb78e2e7e8c87183e6ebb08981cae378
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoCorrect Spliterator characteristics 51/72451/1
Robert Varga [Tue, 29 May 2018 19:40:51 +0000 (21:40 +0200)]
Correct Spliterator characteristics

Mutable KeySet/EntrySet versions should report Spliterator.CONCURRENT
rather than Spliterator.IMMUTABLE. Fix that.

Change-Id: I592f79e7ac7b5d401f852ba6981efd490df5c36d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove ClassLoaderUtils.findFirstGenericArgumentTask() 06/72406/1
Robert Varga [Tue, 29 May 2018 12:13:06 +0000 (14:13 +0200)]
Remove ClassLoaderUtils.findFirstGenericArgumentTask()

This has a single caller, inline it there, eliminating a warning.

Change-Id: I8c472df53dec83547b074657343754ed3d75b56a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix YangModelDependencyInfo handling of arguments 73/72373/1
Robert Varga [Mon, 28 May 2018 16:49:34 +0000 (18:49 +0200)]
Fix YangModelDependencyInfo handling of arguments

Malformed YANG models could cause a NPE, let's be careful around
them and report IAE instead.

Change-Id: Idf31e2e383142e1283c978eccdf123faa7e40617
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump versions to next development cycle 47/72347/1
Robert Varga [Mon, 28 May 2018 07:43:15 +0000 (09:43 +0200)]
Bump versions to next development cycle

1.0.6-SNAPSHOT/2.0.6-SNAPSHOT.

Change-Id: Idb57c0481550a55630b8f401905e207404d9751f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoTrack current path in a stack 34/72134/10
Robert Varga [Mon, 21 May 2018 21:02:12 +0000 (23:02 +0200)]
Track current path in a stack

Rather than creating temporary InstanceIdentifiers, which eagerly
calculate hashCode and cost 32-64 bytes each, use a dedicated stack,
which costs 72-112 bytes without the need for hash code computations.

Since a DataTree may not start at YangInstanceIdentifier.EMPTY, we
need to have a dedicated subclass to properly report the full path.

The contents of the stack are converted to a YangInstanceIdentifier
when needed -- which is only in error paths.

Change-Id: Ifd77a79e6d7481a4355ecb052c9fc2d2c3c1f463
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoIntroduce RequiredElementCountException 49/72149/2
Robert Varga [Tue, 22 May 2018 09:07:47 +0000 (11:07 +0200)]
Introduce RequiredElementCountException

This exception captures min-elements/max-elements validation failure,
allowing users to recognize it.

Change-Id: Ia3a8a9a4f90978bac1cf7ced24980fc82cd8582c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEliminate synthetic bridge methods in DataValidationException 48/72148/2
Robert Varga [Tue, 22 May 2018 09:03:46 +0000 (11:03 +0200)]
Eliminate synthetic bridge methods in DataValidationException

Having private constructors requires the compiler to create bridge
methods, relax constructor visibility.

Change-Id: Ibc584b8970d1f288794a45a8df7cf74412b47cac
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoCleanup yang-data-impl tests 21/72121/7
Robert Varga [Mon, 21 May 2018 17:07:23 +0000 (19:07 +0200)]
Cleanup yang-data-impl tests

- remove unneded throws
- do not store SchemaContext when not needed
- cache SchemaContext when it is used for multiple tests

Change-Id: I7a9ce0bcd08454409e371ca72957b1a4015dedbb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix min/max validation inside written value 03/71803/16
Robert Varga [Fri, 4 May 2018 16:25:35 +0000 (18:25 +0200)]
Fix min/max validation inside written value

When the user is writing a complete tree min/max elements
validation needs to occur inside validateStructure(), as that
runs when the data is being introduced. If we fail to validate
it then, the parent will be committed with the assumption that
the written value actually conforms to the schema.

Fix MinMaxElementsValidation to check the number of elements
inside verifyStructure(), so we flat out reject invalid writes.

JIRA: YANGTOOLS-776
Change-Id: Ie804463612403c578f0f9230884ae53641ba76c6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoClean up AbstractDataTreeTip 32/72132/6
Robert Varga [Mon, 21 May 2018 19:44:08 +0000 (21:44 +0200)]
Clean up AbstractDataTreeTip

Remove duplicate code and use static imports for checkArgument()
and checkState().

Change-Id: Ief1bc003e4bdca87188447e11cf3bd7d20c90fae
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd cursor benchmarks 40/72140/2
Robert Varga [Tue, 22 May 2018 02:05:33 +0000 (04:05 +0200)]
Add cursor benchmarks

Cursor operations are supposedly more efficient as they do not need
to go through YangInstanceIdentifier. Add a microbenchmark to test
that theory.

Change-Id: Ic98b5219bfe5629b0edf6f4cbf8265695afa25f0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix benchmarks 38/72138/4
Robert Varga [Mon, 21 May 2018 22:01:53 +0000 (00:01 +0200)]
Fix benchmarks

Benchmarks have been in a state of disarray, fix them up:
- use yang-test-utils
- properly ready modifications
- upgrade JMH to 1.21

Change-Id: I8fa90cdde3b56664935685ad62452bb7c272cf3d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove checkstyle-logging 39/72139/1
Robert Varga [Tue, 22 May 2018 01:29:33 +0000 (03:29 +0200)]
Remove checkstyle-logging

Aggregator poms should not be doing checkstyle, remove it.

Change-Id: Ie4560db89d5f03f40a8b28ce1db911c8aec245b2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoExpose ImmutableNodes.mapNodeBuilder(NodeIdentifier) 37/72137/1
Robert Varga [Tue, 22 May 2018 00:42:04 +0000 (02:42 +0200)]
Expose ImmutableNodes.mapNodeBuilder(NodeIdentifier)

This utility is useful for users who have a NodeIdentifier handy,
bypassing NodeIdentifier.create().

Change-Id: I10f16ce5048ccb3b646761694b38f431447e09f2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd a few 3.0.0 FIXMEs 33/72133/2
Robert Varga [Mon, 21 May 2018 20:09:42 +0000 (22:09 +0200)]
Add a few 3.0.0 FIXMEs

Clarify thrown exceptions and nullness, as well as the need to use
Optional.

Change-Id: I8a960b2593b87552f24d0de3d28cb75a1d4fb040
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix a raw type user 23/72123/2
Robert Varga [Mon, 21 May 2018 17:21:40 +0000 (19:21 +0200)]
Fix a raw type user

We don't really need to use raw types -- qualify the case and remove
corresponding @SuppressWarnings.

Change-Id: I0797b26bb40059654b718beeaf20095aebd9c3c0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix AbstractValueNodeModificationStrategy message typos 24/72124/2
Robert Varga [Mon, 21 May 2018 17:32:41 +0000 (19:32 +0200)]
Fix AbstractValueNodeModificationStrategy message typos

We are missing a space in the message, fix that.

Change-Id: Iddc718ebd04d41fa6f994aa9310e9f8bf9b55e5c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>