Robert Varga [Tue, 16 Feb 2016 19:15:45 +0000 (20:15 +0100)]
Use String.indexOf(char) instead of String
Fixes sonar warnings and improves performance just bit.
Change-Id: I5b8ce70077af7ba5e13a74e9bdd00aca8822dcc2
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Robert Varga [Sun, 14 Feb 2016 22:29:41 +0000 (23:29 +0100)]
Remove an unneeded null check
instanceof performs a null check, hence we do not have to do it
ourselves. Saves a branch.
Change-Id: Icb4e29c5adb94a1c971fa8019064324ef1cadbf2
Signed-off-by: Robert Varga <rovarga@cisco.com>
Jakub Toth [Fri, 12 Feb 2016 11:59:51 +0000 (12:59 +0100)]
Bug 3899: Milestone: Increase test coverage for Yangtools
YangToSourcesProcessorTest
Change-Id: Ia82b733cad2308524da0e1ded9b5a9ef3b03571f
Signed-off-by: Jakub Toth <jatoth@cisco.com>
Jakub Toth [Fri, 12 Feb 2016 10:31:31 +0000 (11:31 +0100)]
Bug 3899: Milestone: Increase test coverage for Yangtools
YangSourceFromFileTest
Change-Id: I6f0330bc6411c46e5dac9677a44952d648e0bd70
Signed-off-by: Jakub Toth <jatoth@cisco.com>
Jakub Toth [Thu, 11 Feb 2016 09:04:51 +0000 (10:04 +0100)]
Bug 3899: Milestone: Increase test coverage for Yangtools
FilesystemSchemaSourceCacheTest
Change-Id: I2f9276ce1cb3e3742115819192b28abcef95eb17
Signed-off-by: Jakub Toth <jatoth@cisco.com>
Jakub Toth [Tue, 9 Feb 2016 15:19:01 +0000 (16:19 +0100)]
Bug 3899: Milestone: Increase test coverage for Yangtools
SchemaSourceTransformerTest
Change-Id: I12892be51e74a37faaa7cc513385229f208018e6
Signed-off-by: Jakub Toth <jatoth@cisco.com>
Filip Gregor [Thu, 11 Feb 2016 11:48:18 +0000 (12:48 +0100)]
Bug 3899: Milestone Increase test coverage for YangTools - Types
tests for types
Change-Id: Ifd2ba78eb2c1bb915c3f172d51d6f4c42421278c
Signed-off-by: Filip Gregor <fgregor@cisco.com>
Jakub Toth [Thu, 11 Feb 2016 10:00:33 +0000 (11:00 +0100)]
Bug 3899: Milestone: Increase test coverage for Yangtools
InMemorySchemaSourceCacheTest
Change-Id: I883e053884c514c0c9ac343e1d6485bc9424e7ac
Signed-off-by: Jakub Toth <jatoth@cisco.com>
Filip Gregor [Mon, 1 Feb 2016 15:25:12 +0000 (16:25 +0100)]
Bug 3899: Milestone Increase test coverage for YangTools
Tests for Dom serializer, builders
Change-Id: Id60b0f8572a64e01a8a0ff3b7792a0e38cbdce65
Signed-off-by: Filip Gregor <fgregor@cisco.com>
Robert Varga [Fri, 12 Feb 2016 17:31:50 +0000 (18:31 +0100)]
Do not use String.split()
Instead of straight array split, use a Splitter and split to list.
Change-Id: If40131a97be64b1bc92e723d5e257e520aea32b4
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Fri, 12 Feb 2016 15:15:02 +0000 (16:15 +0100)]
features-test is no longer published from yangtools
It got moved to odlparent, reflect this fact.
Change-Id: I3db53f520a12617e9cc6894fbc7b8e96bac76a3f
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Fri, 12 Feb 2016 13:12:20 +0000 (14:12 +0100)]
NoddeWithValue is generic
This fixes warnings with use of the raw type. Also cleans up references
to YangInstanceIdentifier inner classes.
Change-Id: If2f88f14e14c9b0b858187ba99a491af485e19d2
Signed-off-by: Robert Varga <rovarga@cisco.com>
Igor Foltin [Wed, 10 Feb 2016 15:24:51 +0000 (16:24 +0100)]
Bug 3899: Milestone: Increase test coverage for Yangtools
Added unit test for DomToNormalizedNodeParserFactory.
Added unit test for declared anyxml statement.
More tests for declared yang statements will be added in the future.
Change-Id: If98d5fe6a4ac634c9060d2bbe186e0cb90482a35
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Jakub Toth [Fri, 5 Feb 2016 16:02:14 +0000 (17:02 +0100)]
Bug 3899: Milestone: Increase test coverage for Yangtools
test XmlDocumentUtilsTest
Change-Id: I8d4958b048e1bf392182b409d4998429712781b6
Signed-off-by: Jakub Toth <jatoth@cisco.com>
Jakub Toth [Mon, 8 Feb 2016 15:08:11 +0000 (16:08 +0100)]
Bug 3899: Milestone: Increase test coverage for Yangtools
test InstanceIdentifierForXmlCodecTest
Change-Id: I3dc7f58309ae900825a10d5ea0a878cf037c24e5
Signed-off-by: Jakub Toth <jatoth@cisco.com>
Igor Foltin [Wed, 10 Feb 2016 11:09:12 +0000 (12:09 +0100)]
Bug 4079: Unable to compile pattern defined in module
when using Unicode blocks
The original patch for this bug fixed the problem
only in the old yang parser.
This patch fixes the issue in the new yang parser.
Change-Id: I07c7ad8d00ab0f8f39888afd1468054e74574cb4
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Jakub Toth [Tue, 9 Feb 2016 13:51:34 +0000 (14:51 +0100)]
Bug 3899: Milestone: Increase test coverage for Yangtools
test RefcountedRegistrationTest
Change-Id: Ie3053de3422ec5ffe4bb8ae7e7bf23b147ac4a4d
Signed-off-by: Jakub Toth <jatoth@cisco.com>
Igor Foltin [Tue, 9 Feb 2016 10:52:34 +0000 (11:52 +0100)]
Bug 3899: Milestone: Increase test coverage for Yangtools
Added unit test for StringPatternCheckingCodec.
Change-Id: I95883efa82d0e987fa0b5b6e507513e105aca267
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Robert Varga [Fri, 5 Feb 2016 08:51:04 +0000 (09:51 +0100)]
BUG-2646: downgrade warnings to debug
Stop flooding logs with warnings until we find an acceptable solution
for adding augmentations and refines to unknown extensions.
Change-Id: I74a942347690cecc94c4022d7c0a1e397a042d5a
Signed-off-by: Robert Varga <rovarga@cisco.com>
Igor Foltin [Fri, 5 Feb 2016 12:58:34 +0000 (13:58 +0100)]
Bug 3899: Milestone: Increase test coverage for Yangtools
Added unit tests for data tree operations with ordered list
Change-Id: I82314d98fbb04ad336de9e7a15a433ab78454180
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Thanh Ha [Wed, 30 Sep 2015 22:20:11 +0000 (18:20 -0400)]
Enable site generation for yangtools
See:
https://nexus.opendaylight.org/content/sites/site/org.opendaylight.releng.builder/master/maven-site.html
Change-Id: I280ca59132c90326f43615f9eb5d5ea601a423ae
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Thanh Ha [Thu, 4 Feb 2016 02:30:26 +0000 (21:30 -0500)]
Fix javadoc formatting issues
- Fix javadoc '<' and '>' to < and > escape characters
- Add missing @throws
Change-Id: Idcbc8217f931de655e38687df6a89cc94b346cb2
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Robert Varga [Wed, 13 Jan 2016 00:12:15 +0000 (01:12 +0100)]
BUG-4662: introduce the SemVer concept
This is a very simple DTO concept for semantic versions.
Change-Id: I752f36198b03c37ef4116088baf1938248a01fd2
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Robert Varga [Tue, 2 Feb 2016 12:24:11 +0000 (13:24 +0100)]
Fix compatibility with Java 8 type inference
Add a raw cast to side-step inference rules being more strict.
Change-Id: I855a687cc2d7141383c6aff57dba6adf0a5eef91
Signed-off-by: Robert Varga <rovarga@cisco.com>
Stephen Kitt [Fri, 13 Nov 2015 15:29:52 +0000 (16:29 +0100)]
opendalight -> opendaylight
and delete a couple of commented lines of code.
Change-Id: Ia27a2e9f049876da04894896f7befff00bf44279
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Peter Kajsa [Mon, 1 Feb 2016 13:00:10 +0000 (14:00 +0100)]
Bug 4969: Unable to find base type of leafref for old yang parser types.
Added backward compatibility with old yang parser into
the method SchemaContextUtil.findParentModuleOfReferencingType.
Change-Id: I3e49296cb8beb45c67cda99986bffa7a8ba1a022
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Peter Kajsa [Fri, 29 Jan 2016 13:56:10 +0000 (14:56 +0100)]
Bug 4969: Invalid regex pattern for xpath conditions stripping.
Original regex pattern performed greedy match.
The fix excludes square brackets inside a match.
Change-Id: I3a95a041ab87f6d9d7d4c1e1bcf70095ece24fff
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Stephen Kitt [Mon, 25 Jan 2016 16:32:41 +0000 (17:32 +0100)]
yang.data.impl.schema.tree clean-up
* Propagate @Nonnull and @Nullable declarations.
* Suppress unused warnings for AbstractCursor's closed field.
* Remove redundant generic type declarations.
* In AbstractDataTreeCandidateNode, make sure that either newData or
oldData is not null (or both).
* Remove CaseEnforcer::enforceOnTreeNode() which is unused.
* Remove unnecessary semi-colons in MandatoryLeafEnforcer.
* Remove MinMaxElementsValidation::checkOriginalPresent() which is
unused.
* SchemaAwareApplyOperation::checkConflicting indicates its result
using an exception, so drop the return value which is always true
(this method isn't used anywhere else in Boron).
* SchemaAwareApplyOperation::checkNotConflicting is static, so its
final modifier is redundant.
Change-Id: I7f1ebe53753edd0b0ec5c333ac0cc2850c959f15
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Peter Kajsa [Fri, 29 Jan 2016 12:35:40 +0000 (13:35 +0100)]
Bug 5101: Status deprecated must not be propagated via uses statement
Status of grouping statement is not propagated via uses statement.
Change-Id: I2c2bf9d9222ea1be78b440c5c52ea675dcaeb89d
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Peter Kajsa [Fri, 22 Jan 2016 10:39:37 +0000 (11:39 +0100)]
Bug 4969: NPE in JSONCodecFactory by attempt to find codec for a leafref
Attempt to find codec for a leafref results in NPE in JSONCodecFactory, because
SchemaContextUtils cannot find baseType of derived leafref type.
Change-Id: If5288210b4f4d200b18063cf58fdf873b1d12be1
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Peter Kajsa [Tue, 26 Jan 2016 14:13:23 +0000 (15:13 +0100)]
Bug 5059: Do not fail when 'refine' targets an extension.
Yang parser does not fail when 'refine' targets an extension, but
the parser logs a warning and the refine statement is ignored.
Change-Id: I9a4ad46ac254c36b64b44903162361c1e14f4e71
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Tom Pantelis [Thu, 21 Jan 2016 15:35:29 +0000 (10:35 -0500)]
Bug 5019: Add QName param to NormalizedNodeWriter#leafSetEntryNode
NormalizedNodeWriter allows us to emit a single LeafSetEntryNode, which
breaks assumptions in NormalizedNodeStreamWriter -- specifically that
the receiver has seen its parent LeafsetNode.
In this case this is not true, so we need to supply the QName to pass
down the identity of the entry.
Change-Id: I45187800c62ec36b276724d230a922634c556a9b
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Wed, 27 Jan 2016 09:47:35 +0000 (10:47 +0100)]
Fix compilation failure with Java 8 target
Java 8 is more strict about generic inference, hence it does not allow
to play shenanigans.
Change-Id: I84d80e2910099dec98c8106540e1b349f47f41c2
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Fri, 15 Jan 2016 20:53:29 +0000 (21:53 +0100)]
Remove YinSchemaSource
This interface has been superseded, remove it.
Change-Id: If05eba38827746f9d98007b497c744c59e56fed2
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Robert Varga [Fri, 15 Jan 2016 20:56:12 +0000 (21:56 +0100)]
Remove of/copyOf factory methods
These have been deprecated in favor of their ordered/unordered
counterparts, remove them.
Change-Id: Ide5ecfb1141b03597f72757fc91d56715d18c308
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Robert Varga [Sat, 2 Jan 2016 15:41:36 +0000 (16:41 +0100)]
Simplify RevisionAwareXPathImpl
Java 8 has a Boolean.hashCode(), which supplies the functionality which
we have open-coded. Reuse implementation to reduce overhead.
Change-Id: I2d0424ec354816bcac470e385f4507de3a1f6054
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Robert Varga [Mon, 25 Jan 2016 09:58:55 +0000 (10:58 +0100)]
BUG-4295: fix merge callsite
This is a fixup of the previous patch. The problem was expanding a merge
into a new node, which used a direct value propagation with a merge.
That is not correct, as the merge should be pushed via
ModificationApplyOperation, which in case of unkeyed lists will turn it
into a write.
Change-Id: I93c8be80e4467b5d3a1e20f26f5576bd701b1375
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Tue, 19 Jan 2016 20:50:35 +0000 (21:50 +0100)]
BUG-4684: validate changes against effective state
In order to deal with merges, we would have to concoct a very fragile
machinery, which would perform the equivalent of apply(), except it
would not produce merged data.
Instead of that let us pass down version, which is all we need to run
the apply operation. Once applied, we will have a preliminary result of
apply, which we can reuse under some circumstances -- which is if the
observed current metadata node does not change and if the SchemaContext
(and hence the associated SchemaAwareApplyOperation object) does not
change.
If either does, we re-calculate the result -- but that may not be
accurate at this point.
Change-Id: I145969e47136b324c07868bd00ded0764ef634f4
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Signed-off-by: Filip.Gregor <fgregor@cisco.com>
Robert Varga [Fri, 22 Jan 2016 17:56:06 +0000 (18:56 +0100)]
Add leaf context when value deserialization fails
When the codecs throw an IllegalArgumentException, it is useful to know
which leaf has failed to parse. Catch the exception and chain it to an
exception which gives more context.
Change-Id: I6466b5d86294a1f0116477081267a80c0a696bfb
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Robert Varga [Mon, 25 Jan 2016 09:58:55 +0000 (10:58 +0100)]
BUG-4295: handle merge into unkeyed list
A merge into an unkeyed list equals to a write.
Change-Id: Iaded1cab2bdf38ee9595ebfe579dbb566b2beae4
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Fri, 15 Jan 2016 20:57:57 +0000 (21:57 +0100)]
Remove deprecated concepts
These concepts are unused, remove them.
Change-Id: I3501427445c7a30bbc6ce78c904545be9cacef23
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Robert Varga [Fri, 15 Jan 2016 20:59:58 +0000 (21:59 +0100)]
Bump yangtools to 1.0.0-SNAPSHOT
As per Boron versioning plan, yangtools should be 1.0.0-SNAPSHOT.
Change-Id: I128fcc0647066eda3e27ab49abf853c6a71107fc
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Tony Tkacik [Wed, 20 Jan 2016 17:20:32 +0000 (18:20 +0100)]
Bug 4295: Fixed incorrectly introduced nodes when MERGE was followed by DELETE
ModificationNode lost state in situations when
parent node was MERGE which indroduced child nodes
and child node was deleted. That resulted into recording NONE,
which during apply of MERGE was expanded back to original MERGE
which caused reintroduction of deleted node.
Change-Id: Ia2085f5475b49957ef8ac7ab6c629ca3eef803f2
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Robert Varga [Wed, 20 Jan 2016 12:32:42 +0000 (13:32 +0100)]
Fix yang-maven-plugin generating superfluous files
Logic detecting whether a file belongs to the current project has been
broken in change I75c8b67af01212a8ac5b832625f9405bb0108455. It works
most of the time with 'mvn clean install', but fails if there is a
generate-sources phase before dependency projects are
packaged/installed. This typically happens when invoked from IDE such as
Eclipse.
Perform correct checks to see if a particular file was injected from
current project.
The correct fix is to use SchemaContextResolver, where we inject local
files, capture their SchemaSourceIdentifiers, then inject any
dependencies. That way we can perform the lookup based on
ModuleIdentifiers and not rely on the particulars what form was used to
get the source.
Change-Id: I2392dc05bfbc94d613ec896d38fac21734a5bc81
Signed-off-by: Robert Varga <rovarga@cisco.com>
Peter Kajsa [Tue, 5 Jan 2016 09:14:00 +0000 (10:14 +0100)]
BUG-4295: instantiate MERGE operations lazily
This patch reworks how merges are done in a DataTreeModification by
moving the logic to SchemaAwareApplyOperation, which is the final
recipient of the resulting ModifiedNode.
This way the code is co-located and can be specialized based on
information available for that particular node, and the container merge
code is cleanly separated from the leaf node code, which turns each
merge into a write.
When a merge occurs on a previously-written node, we graft all merged
children onto the write, using recursion only when necessary.
checkPresentChild method renamed.
Fix of ModifiedNode and added unit test.
Change-Id: I674e3d2150e796472e831abdcfa0fad582b69759
Signed-off-by: Robert Varga <rovarga@cisco.com>
Signed-off-by: Filip.Gregor <fgregor@cisco.com>
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Robert Varga [Tue, 19 Jan 2016 20:03:20 +0000 (21:03 +0100)]
Include identityref leaves in interner
Identitrefs, while being extensible, have an upper bound on possible
values. Intern them just as we do enums.
Change-Id: I86a0411cfcce6a83616fe04e20bd97921c80bb21
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Robert Varga [Tue, 19 Jan 2016 21:21:31 +0000 (22:21 +0100)]
Add a bit of documentation in AbstractReadyIterator
Some of the comments have been lost. This class implements a depth-first
tree iterator, which does not use stack for keeping state, hence its
code flow should be better commented.
Change-Id: I604b0cef6f402c0e10403a7c29d272939ba2e8bd
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Robert Varga [Mon, 4 Jan 2016 23:46:14 +0000 (00:46 +0100)]
Introduce formatting methods for SourceException
- throwIf() is similar to Preconditions.checkArgument(), but checks the
inverse condition
- throwIfNull() is similar to Preconditions.checkNotNull()
- new constructors with string formatting
- fix {Invalid,Missing}SubstatementException not having a version
Change-Id: I95d15fb6a591f77b0be17d9ca50f51d3636c80ed
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Robert Varga [Sat, 16 Jan 2016 01:05:31 +0000 (02:05 +0100)]
BUG-865: deprecate recursive node instantiation
Recursive create() method forces a full materialization, which is slow
and not memory-efficient. Lazily-instantiated nodes work equally well
using less memory.
Change-Id: I320f375090df480c1b376f543cb0b00649b44234
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Peter Kajsa [Tue, 13 Oct 2015 15:29:24 +0000 (17:29 +0200)]
Bug 4459 - Parser fails when enum contains illegal characters for QName.
RFC6020 defines enum argument as string, but we need to parse QName from it
due to binding part of yangtools. However, parsing of the enum containing
illegal characters for QName causes IllegalArgumentException.
Change-Id: Iccd5523e12ca9bdfa44efd0fab09ef764990b837
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Igor Foltin [Wed, 9 Dec 2015 14:27:20 +0000 (15:27 +0100)]
Bug 4540: Yang parser exceptions should follow consistent path
Replaced FileInputStream with NamedFileInputStream
in order to provide source path.
Replaced several standard Java exceptions with
yang-parser-impl exceptions where appropriate.
Added StatementSourceReference object into error messages.
Code refactoring based on codestyle rules.
Change-Id: I7e0c80d1d1c4644fa8c61a420ba0055ae84d2398
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Tony Tkacik [Fri, 8 Jan 2016 10:54:31 +0000 (11:54 +0100)]
Added support for root in create(TreeType, YangInstanceIdentifier)
Change-Id: If31258a2e9d88f94cde835106d12b3b2ca6a12d5
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Thanh Ha [Fri, 15 Jan 2016 00:48:17 +0000 (19:48 -0500)]
Version bump ietf.topology.version to 9
This was missed in the previous version bump commit.
Change-Id: I7077d20d28f82283eb8a7f801c55ab683cf0d6b6
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Thanh Ha [Fri, 15 Jan 2016 00:22:55 +0000 (19:22 -0500)]
Bumping versions by 0.1.0 for next dev cycle
Change-Id: If160e96c378f527e83147cfc24f26de3b3c080ba
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Peter Kajsa [Tue, 12 Jan 2016 12:45:30 +0000 (13:45 +0100)]
Bug 4933: Yang parser does not accept deviate "not-supported"
The method parseDeviateFromString does not parse input string
to Deviate enum correctly. This problem occurs when yang keyword
does not match java indentifier of Deviate enum.
Change-Id: I188b9539c804a561b13adac9df247fd57fab8599
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Robert Varga [Sat, 22 Aug 2015 09:17:02 +0000 (11:17 +0200)]
Make NodeWithValue generic
Retaining the type of contained value is useful in various places, which
means we don't have to add an explicit cast.
Change-Id: Ibf3b16fd7b3348730f3efb3e284a345e69003e30
Signed-off-by: Robert Varga <rovarga@cisco.com>
Peter Kajsa [Mon, 16 Nov 2015 10:28:29 +0000 (11:28 +0100)]
Bug 3874: Support of yang modeled AnyXML - JSON deserialization
- added support of yang modeled anyXml deserialization from JSON
- basic unit tests
Change-Id: Idd52bfe900a52d5d1b30d2cf25449f606e339d50
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Robert Varga [Tue, 12 Jan 2016 21:13:07 +0000 (22:13 +0100)]
Simplify Utils.parseStatus()
No need for a local variable, and use proper log formatting instead of
string concat.
Change-Id: Id5fd1dba61cf984a3aa08f4b2b7ee367ff24e307
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Jan Hajnar [Fri, 7 Aug 2015 12:20:01 +0000 (14:20 +0200)]
Bug 2062 - StreamWriter APIs loses information about leaf-set ordering
* added start methods for OrderedLeafSet
* modified classes that use NormalizedNodeStreamWriter to use
startOrderedLeafSet when needed.
Change-Id: I890a338313229b1600adcf5ac2ef1c8b440a220d
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Peter Kajsa [Mon, 16 Nov 2015 10:00:47 +0000 (11:00 +0100)]
Bug 3874: Support of yang modeled AnyXML - serialization XML/JSON
- added support of yang modeled anyXml serialization to XML and JSON
- basic unit tests
Change-Id: I60ed3782cd9852c8e2be69c8b8abf825738d16e6
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Peter Kajsa [Mon, 16 Nov 2015 09:31:59 +0000 (10:31 +0100)]
Bug 3874: Support of yang modeled AnyXML - XML deserialization
- added support of yang modeled anyXml deserialization from XML
- basic unit tests
- added anyxml-schema-location extension support and removed
hardcoded extension name from AnyxmlStatementImpl
Change-Id: I2add4bd5613417514d84b52be786074e2cc75f4f
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Tony Tkacik [Fri, 8 Jan 2016 09:08:29 +0000 (10:08 +0100)]
Bug 4657: Added handling of APPEARED, DISAPPEARED.
In the context of applying candidate to cursor
state APPEARED and DISPAPPEARED should be handled
same way as SUBTREE_MODIFIED.
Change-Id: I220aab3fc94fdec9cf3a158bf4c756c120d9120d
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Peter Kajsa [Tue, 1 Dec 2015 10:25:17 +0000 (11:25 +0100)]
BUG-4355: mandatory node presence enforcement
Introduce mandatory leaf validation as specified in RFC6020. Mandatory
node presence is enforced whenever a presence container, a list entry,
and a case node.
The presence of mandatory leaves which do not have any ancestors other
than structural containers are not enforced as mandatory. The reason for
this is that the first transaction on such a DataTree would have to
introduce all mandatory leaves, as their non-presence would make other
transactions fail consistency checks.
Change-Id: I19df441026854955fd37f6e1ff7b4ea3c48c60b8
Signed-off-by: Robert Varga <rovarga@cisco.com>
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Tony Tkacik [Fri, 8 Jan 2016 08:41:06 +0000 (09:41 +0100)]
Bug 4896: Use HashMap instead of ImmutableMap.Builder in ChoiceModification
Change-Id: Id5f851c65476d9cce94aeec54ccf483d979b2f1a
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Robert Varga [Thu, 22 Oct 2015 20:41:47 +0000 (22:41 +0200)]
Enforce case uniqueness
Validate case leaf exclusion. RFC6020 requires that at most once case
inside a choice is present at any time. This means we must not allow
leaves which belong to different case statements exist at the same point
in time.
Change-Id: If8235ffc4aff87fd96d5071158b7e794ef8c3c5e
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Tue, 5 Jan 2016 13:27:06 +0000 (14:27 +0100)]
BUG-865: deprecate SourceStreamAware
This interface is only used by Module, where it is a violation of
effective moidel separation from declared model.
Change-Id: I7de48f2c585f8daa7a29bc5b4e6a5ac33c994bbf
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 4 Jan 2016 15:54:38 +0000 (16:54 +0100)]
BUG-865: deprecate pre-Beryllium parser elements
This deprecates YangContextParser (in favor of the repository APIs) and
implementation elements of the old parser. These are scheduled for
removal in Boron.
Change-Id: I4ec68576af0a7909a3d8705664d901a62ffcd7a0
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 4 Jan 2016 15:53:09 +0000 (16:53 +0100)]
Do not use deprecated junit API
Change-Id: Ifcc09ece789c245f8db9e55e5919a6b3cd46e6db
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 4 Jan 2016 15:52:47 +0000 (16:52 +0100)]
Remove an unused import
Change-Id: I5aaf5fa5498c3122a33efe138b441389cae950da
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 4 Jan 2016 15:52:17 +0000 (16:52 +0100)]
Private method can be made static
Fixes a strict eclipse warning.
Change-Id: Ie0c0f73cb6f01090505ac09f89d787af5d1116a1
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 4 Jan 2016 15:51:46 +0000 (16:51 +0100)]
Exceptions should have serialVersionUid
Add missing field to fix an eclipse warning.
Change-Id: Ice3d94150c29d0c69a4a6794576f5754191e184d
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 4 Jan 2016 15:51:12 +0000 (16:51 +0100)]
Do not override antlr plugin version
Fixes a maven warning.
Change-Id: I0ec07c469f9a577c841a445e3ac6979574084088
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sat, 2 Jan 2016 12:05:45 +0000 (13:05 +0100)]
Do not instantiate new maps in LeafRefContextBuilder
LeafRefContext already picks up a constant copy, there is no need to
instantiate new maps. Also adjust names to proper English.
Change-Id: I59c7e0c86bb5eb3580b3f7db8649fca69d7987fe
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Robert Varga [Sat, 2 Jan 2016 12:45:09 +0000 (13:45 +0100)]
Clean LeafRefValidation up
- do not use LinkedList
- do not not use single-use temporaries
- do not instantiate YangInstanceIdentifier for PathArgument
- do not use entrySet() where values() is enough
- make temporaries final to indicate when they are initialized
Change-Id: I5859ca886a60bc7cd5c4c109619af6f5a479f3e2
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Robert Varga [Sat, 2 Jan 2016 12:55:34 +0000 (13:55 +0100)]
QNameWithPredicateBuilder should use an ArrayList
Also fix QNameWithPredicateImpl's promise of being Immutable, by copying
the predicates. Otherwise these could be modified by the leaked
collection.
Change-Id: I46105644986bb7a99faf4bd3d6f8b9ff3ff84592
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Robert Varga [Sat, 2 Jan 2016 12:48:00 +0000 (13:48 +0100)]
QNamePredicate should extends Identifiable<QName>
The interface's getIdentifier() is already matching such a result, reuse
the basic concept.
Change-Id: Id099e90ec0103ef2cdc4c400317caee65060d8e3
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Robert Varga [Sat, 2 Jan 2016 13:35:36 +0000 (14:35 +0100)]
BUG-865: deprecate Module#getSource()
This method requires implementation to provide YANG text, which is not
always available. SchemaRepository provides the right abstractions for
acquiring the source in the required representation.
Change-Id: Ib769948e3fefc4f1a086f3620a7326fb076f7f95
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Robert Varga [Sat, 2 Jan 2016 13:47:29 +0000 (14:47 +0100)]
Spell-check Status and UsesNode
Fixes spell-checking warnings.
Change-Id: I97bf10e188b07084c39b48e10e3affb7e8d2c5f8
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Robert Varga [Sat, 2 Jan 2016 13:52:02 +0000 (14:52 +0100)]
Cleanup yang.model.api.meta
Add proper separators, trim unneeded empty lines, clarify non-null
return of getEffectiveSubstatements().
Change-Id: Ie756cdcf26105556c8be84ccd0df271200c6a968
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Robert Varga [Sat, 2 Jan 2016 14:14:51 +0000 (15:14 +0100)]
Make getSearchRoot() static
Private method does not reverence object state, it should be static.
Change-Id: If5456a13d07396477db5d323e95a4288b51cd404
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Robert Varga [Sat, 2 Jan 2016 15:39:01 +0000 (16:39 +0100)]
BUG-865: deprecate internal implementation classes
Derived*Type and Abstract*Integer are used as DerivedType subclasses and
for realization of deprecated base types. Eventhough they are not
externally visible, deprecate them to make their fate explicit.
Change-Id: Idffbcde09f16942605b66043144c0668557961ba
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Filip.Gregor [Tue, 22 Dec 2015 14:31:13 +0000 (15:31 +0100)]
Bug 4656: Yang parser does not determine configuration true or false properly
minor fix
Change-Id: I2e58387fcd3012a70d302323b6bd533c285a0211
Signed-off-by: Filip.Gregor <fgregor@cisco.com>
Robert Varga [Tue, 22 Dec 2015 15:21:31 +0000 (16:21 +0100)]
BUG-4803: optimize unordered cache
This patch side-steps the need to perform kopu operations when the
offsets are already constructed. It also optimizes the number of
ImmutableSet instances present in the system.
Change-Id: I8a9b42e053d88c85bf5e75eb5a58da9bd08ce6d0
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 21 Dec 2015 18:42:25 +0000 (19:42 +0100)]
BUG-4803: introduce unordered offset maps
This patch introduces the static factories and methods which allow users
to select the appropriate implementation, either to retain or to ignore
iteration order.
Change-Id: I07dcf77927660461cbd266439463e8d64a1c89db
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 21 Dec 2015 17:06:55 +0000 (18:06 +0100)]
BUG-4803: fix MutableOffsetMap's insertion order
When a pairing backed by the array is removed, the order of pairings
would not follow the insertion order. This patch introduces an explicit
removal marker object and when the marker is present we defer to
newKeys map.
Change-Id: Ib27313e0df44754f5219d64126e0ec2a472a503f
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Tue, 22 Dec 2015 11:04:10 +0000 (12:04 +0100)]
BUG-4803: invalidate cache before each test
Running tests will pollute the cache, so we need to clear it before each
test.
Change-Id: I0cc171c22409d81092d82d5570a3c0068bbfc889
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 21 Dec 2015 14:46:21 +0000 (15:46 +0100)]
BUG-4803: introduce ordered/unordered offsets
This patch makes an explicit copy of the offset map, ensuring we do not
retain the input reference in copyOf(). We introduce two versions, one
for ordered and one for unordered maps.
This fixes ImmutableOffsetMap potentially not honoring the input
iteration order.
Change-Id: Iff835e2a5028c0dde6de2f39b298b7b4b334826a
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 21 Dec 2015 14:16:34 +0000 (15:16 +0100)]
BUG-4803: make MutableOffsetMap abstract
We will need two implementations, one Ordered and Unordered, have make
the base class abstract and implement the Ordered version.
Change-Id: I26826c30470b47aba88ddfb106fd6e7afcd7f288
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 21 Dec 2015 14:11:49 +0000 (15:11 +0100)]
BUG-4803: make ImmutableOffsetMap abstract
We will need two implementations, ordered and unordered. Make
ImmutableOffsetMap abstract and introduce the Ordered implementation.
Change-Id: I082512d71496c98e2ec3fd8b308ff897703ae01b
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 21 Dec 2015 13:26:43 +0000 (14:26 +0100)]
BUG-4803: make SharedSingletonMap abstract
SharedSingletonMap needs to have two implementations, ordered and
unordered. Start off with making the class abstract and introducing the
Ordered version.
Change-Id: Ide1c7abc533e925114fc9452adf04e9f5bd09091
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Thu, 17 Dec 2015 16:18:47 +0000 (17:18 +0100)]
BUG-4803: fix equals() method
The implementation required the map's ordering to be the same, which is
a violation of the Map contract.
Change-Id: I8f3308b9cabd5c011e7c2dadfe520407ad2c4672
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sat, 26 Dec 2015 16:07:30 +0000 (17:07 +0100)]
Use QNameModule#intern()
QNameModule#cachedReference() is deprecated, use #intern() instead.
Change-Id: Ic60eb4f3968f3e3251e2b798c385043a717c5089
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Robert Varga [Sat, 2 Jan 2016 15:36:31 +0000 (16:36 +0100)]
Make BitImpl.unknownNodes final
This field is really constant, so let's make it final and adjust
hashCode accordingly.
Change-Id: I598b238cadbe74102dcce6db9f7939080db98e92
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Robert Varga [Sat, 2 Jan 2016 15:07:00 +0000 (16:07 +0100)]
Log attempts to override fraction-digits
We should emit a warning when a model attempts to override
fraction-digits from a base type.
Change-Id: I2aa801288fff8894cc8b8afe22f27c19630e2331
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Robert Varga [Sat, 2 Jan 2016 11:28:42 +0000 (12:28 +0100)]
Use a constant Charset
Instead of looking the charset up, use StandardCharsets.
Change-Id: I8d3b00f3472e1a82f705ecb4743b6122c45f752b
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Robert Varga [Sat, 2 Jan 2016 10:41:19 +0000 (11:41 +0100)]
Add raw type suppression
The builder cannot be parameterized without additional casts, add
warning suppression.
Change-Id: I8dab4e0b22143e23d9cfd97d816aca746c2a324e
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Robert Varga [Sat, 2 Jan 2016 10:28:42 +0000 (11:28 +0100)]
Clean codecs up
Add markers for lookups which are not needed with new type
implementation. Also use preconditions instead of explicit if/throw
pairs. Eliminate unneded local variables.
Change-Id: Ifdce997d985276984311fd78c58277d5a1ea738d
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Robert Varga [Sat, 2 Jan 2016 09:59:22 +0000 (10:59 +0100)]
BUG-865: deprecate XmlUtils.resolveBaseTypeFrom()
This method was needed with ExtendedType, which did not preserve the
identity of the type. Since the new parser uses yang.model.util.type,
performing an instanceof check on the type directly works as expected.
Change-Id: Ie31aea38cdd70857726e2df20f102a0c6648c11f
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Robert Varga [Sat, 2 Jan 2016 10:33:04 +0000 (11:33 +0100)]
Remove unused writeElement variant
TypeDefinition-enabled writeElemnent() is not used anywhere, removed it.
Change-Id: Icd98fed7a49522b95b26c5550c43a1199a9ce01d
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Robert Varga [Sat, 2 Jan 2016 10:06:22 +0000 (11:06 +0100)]
Clean GSON-based codec
Place a deprecation marker, make test methods static, reorder imports.
Change-Id: I0979f9f15d231debc53b978ef2534c2f3cf8f14e
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>