Robert Varga [Fri, 21 Oct 2016 08:35:36 +0000 (10:35 +0200)]
Prevent boxing
Objects.equals() will force a boxing operation
followed by a null check. Instead of that use
Boolean.TRUE.equals().
Change-Id: Ied4c50fb700650965f695a6ec121fb2b64510b9a
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Thu, 20 Oct 2016 11:47:31 +0000 (13:47 +0200)]
BUG-3876: Add ExprListener and friends
This adds interfaces for walking the expression tree.
Change-Id: I1b3f9930c7a1ef70b6f2d87762683a86493bd698
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Thu, 20 Oct 2016 15:28:20 +0000 (17:28 +0200)]
Fix a few checkstyle warnings
Whitespace around =
Overload method distance
Change-Id: I96160154de4a2ea201305aec2a7d800b95a143b3
Signed-off-by: Robert Varga <rovarga@cisco.com>
Filip Gregor [Wed, 19 Oct 2016 13:57:33 +0000 (15:57 +0200)]
Bug 6491: Some imports are not exposed in Module.getImports
in case of no revision in module and imported module, method
getImports returns empty Set.
added tests, fixed Set with imports in AbstractEffectiveModule
Change-Id: Ie23196d9cbcca98266580d11a85d66c06ac8561c
Signed-off-by: Filip Gregor <fgregor@cisco.com>
Filip Gregor [Wed, 19 Oct 2016 11:41:28 +0000 (13:41 +0200)]
Bug 6961: SchemaContext.getAllModuleIdentifiers() doesnt work for submodules
added submodules to return value from method getAllModuleIdentifiers
Change-Id: I9f328d0050457b7094cbb420f0e0205b8034cf6f
Signed-off-by: Filip Gregor <fgregor@cisco.com>
Robert Varga [Tue, 18 Oct 2016 00:20:16 +0000 (02:20 +0200)]
Reuse cardinality constants
0..1, 0..MAX and 1..1 are common cardinalities. Instead of leaking the MAX constant
create additional builder methods which reuse Cardinality objects.
Change-Id: Ie11e1f4414c484ecd43f0b472f9df8f0d0c18d0e
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Tue, 18 Oct 2016 14:30:07 +0000 (16:30 +0200)]
Fix GroupingEffectiveStatementImpl's unknown nodes
Heap analysis has pointed out a linked list, which is both
a correctness problem (it should be immutable) and efficiency
issue, as most of the time this list should be empty.
Use ImmutableList.Builder to build an immutable list of
unknown statements.
Change-Id: I94a42cb75d8fa433bcae304728268b0873d14683
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Tue, 18 Oct 2016 14:28:35 +0000 (16:28 +0200)]
Fix inefficient ConstraintEffectiveStatements
Leaking a mutable ArrayList is incorrect, as the result
should be immutable. Furthermore not providing a hint
results in wasted space. Fix this by copying the temporary
ArrayList into an ImmutableList.
Change-Id: Ic6d1f1a72e6c045479a8b2e95b6b36f0b8d3aaaf
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 17 Oct 2016 21:58:54 +0000 (23:58 +0200)]
BUG-4456: add RecursiveExtensionResolver
This patch adds a hack which allows us to instantiate
recursive extensions. The solution is rather ugly, but
should be workable.
Change-Id: Ib5083804e5b49bd51c3b75c9905be39924e79ae5
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 17 Oct 2016 20:19:54 +0000 (22:19 +0200)]
BUG-6757: revert fix for BUG-4456
The fix has introduced a massive memory leak, which causes
all of temporary build objects to be retained in the final
SchemaContext.
Instead of the leak, add an explicit guard to detect
extensions (transitively) referencing themselves.
Change-Id: If90a4f9420866a6392ce97c71837915fa41ae0c8
Signed-off-by: Robert Varga <rovarga@cisco.com>
Igor Foltin [Tue, 18 Oct 2016 10:02:48 +0000 (12:02 +0200)]
Fix failing unit test in QueuedNotificationManagerTest
Change-Id: I6a8a467cb2b3965753dccbe9b8bdd8e81a9bce80
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Robert Varga [Mon, 5 Sep 2016 07:48:10 +0000 (09:48 +0200)]
BUG-5410: introduce RegularExpression.toPatternString()
This patch adds a method useful for converting a RegularExpression
into a Pattern-compatible string.
Change-Id: I6ab002dc6e9324967d41072ea46af4d65363bff0
Signed-off-by: Robert Varga <rovarga@cisco.com>
Stephen Kitt [Thu, 6 Oct 2016 08:13:58 +0000 (10:13 +0200)]
Support testing null against null in equalsHelper()
In its intended context, equalsHelper() should never be called with
two null parameters, but it's easy to support the general case — and
because this isn't SQL, null equals itself.
Change-Id: I826435e81a4dd59aaac72ad9ab07a80069f7a17f
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Robert Varga [Mon, 5 Sep 2016 09:43:47 +0000 (11:43 +0200)]
BUG-5410: optimize CaseInsensitiveMap
This propagates would-be constants to real constatants,
allowing them to be better optimized.
Change-Id: I500e8060db0f3e22ca19be4188169f74e9a03271
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 5 Sep 2016 07:15:43 +0000 (09:15 +0200)]
BUG-5410: import message catalogue
xsd-regex being an Apache source, it uses ResourceBundle
to load translations. Add them to ensure the project works.
Change-Id: If2615cec2edb99eca86e2a06dfc6b3c27b7ca7c5
Signed-off-by: Robert Varga <rovarga@cisco.com>
Michael Vorburger [Mon, 25 Jul 2016 23:26:14 +0000 (01:26 +0200)]
equalsHelper (MoreObjects2)
Moving this class "downwards" from mdsalutil, because this really is a
generic utility helper class, which probably best fits into
yangtools.utils.
Change-Id: I0d8c6dd44790a85f7efccd6f83d42e6bd7e084bb
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Igor Foltin [Sun, 2 Oct 2016 10:19:10 +0000 (12:19 +0200)]
Increase unit test coverage for Yangtools
Added test for YangTextSchemaContextResolver.
Extended test for declared statements.
Change-Id: Ibdf7e416287240cae8f673c3ecf817faaf275d5f
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Peter Kajsa [Tue, 27 Sep 2016 12:05:22 +0000 (14:05 +0200)]
Bug 6771: Problem with typedefs nested in augment
When a typedef is nested in a container that is in an augment,
the YANG parser produces an error. This is due to fact, that typedef
statements nested in augments are ignored in statement definition phase,
because AugmentStatement is supported only in full definition phase. The
same issue occurs also for Choice and Case statements. This patch
provides fix of these bugs.
Change-Id: I345fd50e7d9810bbedcc873241338fbdb3186b74
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Igor Foltin [Fri, 23 Sep 2016 13:18:12 +0000 (15:18 +0200)]
Increase unit test coverage for Yangtools
Added several unit tests.
Change-Id: I57b4b6c84fd489f2546189bb66bc03490ccf194f
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Peter Kajsa [Wed, 28 Sep 2016 09:43:30 +0000 (11:43 +0200)]
Naming convetion fix of some unit tests in yang-parser-impl
Change-Id: I2a609752a3f56a2129d4c54355ea347190a40fe1
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Robert Varga [Fri, 23 Sep 2016 13:44:25 +0000 (15:44 +0200)]
Use YangInstanceIdentifier.EMPTY
Eliminate an internal constant by referring to the well-known
public constant.
Change-Id: I2363714e1f694a352e0163a8c8054c27f22801f7
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Wed, 21 Sep 2016 15:29:57 +0000 (17:29 +0200)]
Allow QueuedNotificationManager to batch notifications
This patch reworks the queueing logic so that notifications
get completely read from the queue and then propagated to the
listener invoker in one go.
Change-Id: I1a4caaa75f7a206abf4ff5b6829918bd25d79551
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Tue, 20 Sep 2016 22:57:00 +0000 (00:57 +0200)]
Add batching to QueuedNotificationManager
Introduce BatchedInvoker, which allows multiple events to be
delivered in one go.
Change-Id: I3d4d054543fa29842d67f6f21f28ff0a47ed135d
Signed-off-by: Robert Varga <rovarga@cisco.com>
Peter Kajsa [Tue, 6 Sep 2016 12:35:02 +0000 (14:35 +0200)]
Bug 6551: Support for third-party Yang extensions implementation
Minor changes in yang statement parser in order to allow implementation
of custom inference pipeline.
- implementation of CustomStatementParserBuilder, which provides
construction of custom statement parser in user-friendly way.
- example and unit test of third-party extension plugin.
Change-Id: I0cdf0e28bd69af4cb41328be6e6a647df58f4fd9
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Robert Varga [Mon, 5 Sep 2016 06:54:47 +0000 (08:54 +0200)]
BUG-5410: use Deque instead of a Stack
java.util.Stack is superseded by Deque and its implementations,
which are not synchronized. Use an ArrayDeque instead of a Stack.
Change-Id: I4e7fca6bb77c7122c56d3a85c5de3d264699765a
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Tue, 20 Sep 2016 21:59:32 +0000 (23:59 +0200)]
Cleanup QueuedNotificationManager
Audit code for coding style and unnecessary checks.
Change-Id: Ifce7d4fa4febb7f63ce9014e350e69143508e5c7
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Tue, 20 Sep 2016 14:40:37 +0000 (16:40 +0200)]
Use LongAdder instead of an atomic long
LongAdder has better performance under contention,
use it for tracking counter.
Change-Id: If32e17a8e16b2a1418c744a54aaa84e8479f3852
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Tue, 20 Sep 2016 14:24:18 +0000 (16:24 +0200)]
Add YangInstanceIdentifier fast paths
Each YangInstanceIdentifier contains() itself and its
.toRelative() is always empty.
Change-Id: I15ef921b661ccd32b9e6308789624798af4d98cf
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 19 Sep 2016 12:49:42 +0000 (14:49 +0200)]
Fix ConstraintDefinition inconsistency
The API contract around min/max elements is unclear, but the intent
is to provide a simple 'no effective constraint' result. This is
represented by a null return, which is in fact what the users expect.
Clarify the API contract and fix the two implementations to follow
it instead of using 0/MAX_INT for constraints.
Change-Id: I84b2e2714ddd017f319be4fc6dd0f7bec02bbf0d
Signed-off-by: Robert Varga <rovarga@cisco.com>
Igor Foltin [Fri, 16 Sep 2016 17:30:10 +0000 (19:30 +0200)]
Increase unit test coverage for Yangtools
Added test for NormalizedNodes.
Added test for DataTreeCandidates
Added test for DataTreeConfiguration.
Added test for NormalizedNodeDataTreeCandidateNode.
Change-Id: I71773e12f5a4d12f38c034740e3622ba94089bbc
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Robert Varga [Mon, 5 Sep 2016 06:52:34 +0000 (08:52 +0200)]
BUG-5410: fixup javadocs
With the package being moved, full path of exceptions has
changed. Use imported name instead.
Change-Id: I09fb4f0a9f5a31426b65b489da999b5f3d7c4cde
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Fri, 20 May 2016 13:32:07 +0000 (15:32 +0200)]
BUG-5410: add minimal IntStack implementation
Using Stack<Integer> forces integer boxing, which costing us performance.
This patch adds a specialized primitive-based stack, which provides the
minimal needed implementation.
Change-Id: Iee0e977ab87ce32871ddb468dbda47c4afa4e086
Signed-off-by: Robert Varga <rovarga@cisco.com>
Igor Foltin [Sat, 10 Sep 2016 16:03:16 +0000 (18:03 +0200)]
Bug 3899: Milestone: Increase test coverage for Yangtools
Added test for DataTreeCandidateNodes.
Added test for EnumPairImpl.
Added test for ImmutableNormalizedNodeStreamWriter.
Change-Id: I784be5c9a657fefe53a1f37595b582f09d51f8a4
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Robert Varga [Mon, 5 Sep 2016 13:18:54 +0000 (15:18 +0200)]
BUG-5561: use canonical Bits order
This patch makes BitsTypeBuilder order the bit definitions
according to their position. It also adjusts BitsStringCodec
to normalize user input strings to the canonical ordering.
Change-Id: Ia4123a6275130619f9ef91d24b7340520707a67c
Signed-off-by: Robert Varga <rovarga@cisco.com>
Igor Foltin [Tue, 6 Sep 2016 07:12:15 +0000 (09:12 +0200)]
Yangtools documentation
Added more documentation to the semantic versioning section
Change-Id: I71554017ee11732ef6f6176ca70711c96ee22480
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Robert Varga [Fri, 2 Sep 2016 13:14:34 +0000 (15:14 +0200)]
Use lambdas instead of anonymous classes
This makes the code more concise.
Change-Id: I0ce9711d0cafcf4660b78d937e5e0c9fa072da5a
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Tue, 6 Sep 2016 08:18:20 +0000 (10:18 +0200)]
Fix a few warnings
Wrong javadoc and unused import.
Change-Id: I9c8a022d1289215cd50f0225bfa46b082984e668
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 5 Sep 2016 10:11:34 +0000 (12:11 +0200)]
Fix a bunch of warnings
- javadoc order
- unneeded casts
- static methods
Change-Id: I98344b7052eee1a58c709665e92d0cb1a0d72b46
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Tue, 30 Aug 2016 14:31:24 +0000 (16:31 +0200)]
Eliminate unneeded import
YangStatementParser is not used directly, only its inner class
is needed. Since it is already imported, shorten references
and clean up code.
Change-Id: Ia2298bdf20860bc936ba29234f6568adbe7462c0
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Tue, 30 Aug 2016 16:41:48 +0000 (18:41 +0200)]
BUG-6497: Do not lose augmentation statement order
This is a follow-up patch to keep augmentation order
in uses statement.
Change-Id: Iaef4aa949d225d914af3a04c111d0ec41aab6451
Signed-off-by: Robert Varga <rovarga@cisco.com>
Igor Foltin [Wed, 31 Aug 2016 14:53:01 +0000 (16:53 +0200)]
Yangtools documentation
Added documentation for new features introduced in boron:
- if-feature statement resolution
- semantic version processing
Change-Id: Ie31df99d428ab3eecdd40972a5977cd654c05a6b
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Robert Varga [Tue, 30 Aug 2016 16:41:48 +0000 (18:41 +0200)]
BUG-6497: Do not lose augmentation statement order
Using an interim HashSet can cause unpredictable order
of augmentations, which means the binding spec will not
assign consistent mapping at runtime.
Fix this by using a LinkedHashSet, which retains insertion
order.
Change-Id: I503102d8b61453cc9c8d35b07158cd97138cda42
Signed-off-by: Robert Varga <rovarga@cisco.com>
Igor Foltin [Tue, 16 Aug 2016 13:06:58 +0000 (15:06 +0200)]
BUG-6316: Fix Bit and EnumPair's position/value types
yang.model.api.type defines the effective model of the world,
where these attributes cannot ever be null, which is in contrast
to yang.model.api.stmt, which is the declared model -- where they
can in fact be null.
Fix this discrepancy by forcing the methods to return simple types
Change-Id: I27b9d6d283cd14b2044890d9ccd19bf92647f27e
Signed-off-by: Robert Varga <rovarga@cisco.com>
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Igor Foltin [Mon, 15 Aug 2016 11:16:54 +0000 (13:16 +0200)]
Bug 6420: Fixed SemVer's valueOf method
SemVer's valueOf method now works correctly when called
with a string that contains only major and minor version.
Change-Id: Ia9656fe121d1d73bbe2dc1de87cb7bd7b445961d
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Igor Foltin [Tue, 16 Aug 2016 08:10:32 +0000 (10:10 +0200)]
Bug 6410: Fixed initialization of typedefs in rpc
In the constructor of RpcEffectiveStatementImpl we initialize substatements
of an rpc statment. However, in the for loop we are incorrectly trying to
find type substatements instead of typedef substatements.
Typedef substatements in RpcEffectiveStatementImpl are now initialized correctly.
Change-Id: Ic9a02727ffb4b6e6c798360e2266dc99d77c79e7
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Igor Foltin [Mon, 15 Aug 2016 13:14:56 +0000 (15:14 +0200)]
Bug 6419: Fixed SchemaContextEmitter's emitContainer method
Method emitContainer now emits must statements only once
through the method emitConstraints.
Change-Id: Ib818d7dc25b07df3f35559166a0ef933d19808d0
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Igor Foltin [Fri, 12 Aug 2016 13:43:06 +0000 (15:43 +0200)]
Bug 3899: Milestone: Increase test coverage for Yangtools
Added tests to DataNodeIteratorTest and SchemaContextProxyTest.
Change-Id: If446a0cc0ff415c61b53cf53f96bc49dfaccef08
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Igor Foltin [Mon, 15 Aug 2016 12:41:52 +0000 (14:41 +0200)]
Bug 6416: Fixed SchemaContextEmitter's emitIdentityrefSpecification method
Method emitIdentityrefSpecification now passes proper argument to emitBase method.
Change-Id: I16eda69b03d7da1dbefd222c11514a66568d170b
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Igor Foltin [Mon, 15 Aug 2016 12:21:44 +0000 (14:21 +0200)]
Bug 6414: Fixed DataNodeIterator's traverseModule method
Method traverseModule now gets rpc output properly.
Change-Id: Ifdf6d2685ff63bc4548ac2e6b062412e1812ae40
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Robert Varga [Mon, 15 Aug 2016 12:12:18 +0000 (12:12 +0000)]
Revert "Bug 5968: Mandatory leaf enforcement does not work in some cases"
This reverts commit
1b987ae3e2484bbef1c9bdd7553bf0733ca06372, as it breaks lispflowmapping.
Change-Id: Ic1806c3f42dd73ecfe6357d9b7beea48c305520c
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 1 Aug 2016 10:09:24 +0000 (12:09 +0200)]
BUG-865: remove String-based getDataChildByName()
This method has been long-deprecated and should be used
only in tests. Remove it.
Change-Id: I4095154ebe83cb8df32b320db91784d509d86c11
Signed-off-by: Robert Varga <rovarga@cisco.com>
Peter Kajsa [Thu, 28 Jul 2016 13:05:16 +0000 (15:05 +0200)]
Bug 5968: Mandatory leaf enforcement does not work in some cases
When MapEntry nodes are directly written into datatree, mandatory leaf
enforcement works correctly. However, when a List, Container or any other
parent node containing MapEntry nodes as its children is written into datatree,
datatree does not check presence of mandatory nodes of in this way written
map entry nodes.
Change-Id: I366084f87011cc7519d4c2ef46dd61a2b2df7ceb
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Michael Vorburger [Tue, 26 Jul 2016 03:46:08 +0000 (05:46 +0200)]
Intro. new yangtools.testutils artifacts (incl. Mikito)
Seeding new project with proposed Mikito (new), and a
MockitoUnstubbedMethodExceptionAnswer (alternative to
yangtools.mockito-configuration; see the package-info.java in
mockito-configuration about why this is not being proposed in that
project).
Change-Id: I78237936924e0befc0ff17e7604e0fb33262d7cd
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Igor Foltin [Tue, 9 Aug 2016 13:20:11 +0000 (15:20 +0200)]
Bug 3899: Milestone: Increase test coverage for Yangtools
Added test for SchemaContextEmitter
Change-Id: If60531f0a84579519487075a340f73e68c2526eb
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Robert Varga [Mon, 8 Aug 2016 16:31:24 +0000 (18:31 +0200)]
Eliminate QNAME_FUNCTION
Use a method reference instead of a constant function.
Change-Id: Iaecd7a79cf86265cbb00fb60f612d2fe12577d63
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sun, 31 Jul 2016 19:18:06 +0000 (21:18 +0200)]
Use lambdas instead of StmtContextUtils.build{Declared,Effecive}
Using lambdas at actual call sites reduces verbosity and eliminates
the need for unchecked casts and temporary variables. It also makes
call sites for the two target methods a lot more visible.
Change-Id: I4016c9ba447e22a61aeff5ca98d3adb1b80ef81b
Signed-off-by: Robert Varga <rovarga@cisco.com>
Michael Vorburger [Tue, 9 Aug 2016 10:32:58 +0000 (12:32 +0200)]
Improve yang-maven-plugin error reporting for errors in dependencies
Instead of e.g. this: [ERROR] yang-to-sources: Unable to parse yang
files from
/home/vorburger/dev/ODL/git/netvirt/vpnservice/aclservice/impl/src/main/yang
java.util.zip.ZipException: invalid LOC header (bad signature) at
java.util.zip.ZipFile.read(Native Method)
it will now report the much more useful variation like this:
java.io.IOException: Exception when reading from:
/home/vorburger/.m2/repository/org/opendaylight/netvirt/neutronvpn-api/0.3.0-SNAPSHOT/neutronvpn-api-0.3.0-SNAPSHOT.jar::META-INF/yang/neutronvpn.yang
at (...)
Caused by: java.util.zip.ZipException: invalid LOC header (bad
signature)
similar to earlier https://git.opendaylight.org/gerrit/#/c/42193/
Change-Id: Ic5bcdc8597825cdc0506516618ec13ede6433bc7
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Thanh Ha [Tue, 9 Aug 2016 13:59:36 +0000 (09:59 -0400)]
Bump ietf versions to ...10-SNAPSHOT
Bump versions according to:
https://lists.opendaylight.org/pipermail/release/2016-August/007731.html
Change-Id: I30b795af5841d2f9043ffef6395423bf41ab6e09
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Thanh Ha [Mon, 8 Aug 2016 21:50:23 +0000 (17:50 -0400)]
Bump versions by 0.1.0 for next dev cycle
Change-Id: If7bd200bcf1b559e3fdb734af65e3547ee768d51
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Tomas Cere [Mon, 8 Aug 2016 12:26:57 +0000 (14:26 +0200)]
Fix list modification with DataTree rooted at MapEntryNode
Follow up to
d8f0f2b146500275441ab8ba0cd2e1907f4b4ce4
We also need to handle the building of the list when rooted
at a MapEntry and return the correct node.
Change-Id: I60390e3fee4e34a44ee9f8836c8b9c147047691b
Signed-off-by: Tomas Cere <tcere@cisco.com>
Igor Foltin [Thu, 4 Aug 2016 12:30:34 +0000 (14:30 +0200)]
Bug 6244: Add context to exceptions thrown by yang statement parser
Yang statement parser exceptions now contain information
about the failed module and its revision. This information is
represented by SourceIdentifier.
Change-Id: I4a48b5a1e38e0b91a76ac660b131511aefce14a5
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Tomas Cere [Fri, 5 Aug 2016 11:02:58 +0000 (13:02 +0200)]
Fix list modification with DataTree rooted at MapEntryNode
If we had a data tree that was rooted at a MapEntryNode the
node modification was incorrectly enforcing a MapEntryNode when
trying to write into the dataTree.
Change-Id: I9dc02a1917f38e8a0d62279843974b9869c48693
Signed-off-by: Tomas Cere <tcere@cisco.com>
Igor Foltin [Thu, 4 Aug 2016 14:03:37 +0000 (16:03 +0200)]
Bug 3899: Milestone: Increase test coverage for Yangtools
Added several unit tests.
Change-Id: I67d1b4fa4f879d4af186e6c42c724d66de9ca5d2
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Robert Varga [Sun, 31 Jul 2016 18:44:00 +0000 (20:44 +0200)]
Do not use revision in AbstractEffectiveDocumentedNode
Extracting reference from RevisionStatement inside any
DocumentedNode is invalid. RevisionStatements hold their
own reference and they are valid only for modules and
submodules -- which have a reference of their own.
Change-Id: I4522ebbc0449462f80609c1eb06f6a486f4af7af
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 1 Aug 2016 09:51:24 +0000 (11:51 +0200)]
BUG-865: hide SchemaPath constructor
SchemaPath should not be subclassed outside of this package,
hide its constructor.
Change-Id: I7d5a73dcc537572220a831a0804deccf0d9f6e9d
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 1 Aug 2016 09:51:02 +0000 (11:51 +0200)]
Fix wrong javadoc
This is a copy&paste error, correct it.
Change-Id: Ia48b02c6bf28c5e8ca9338ebbfef50e3c6a7f2bc
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 1 Aug 2016 09:45:04 +0000 (11:45 +0200)]
BUG-865: Remove deprecated XmlStreamUtils constructor
This constructor is no longer used and the class should not be subclassed.
Remove it.
Change-Id: If7b8d470ea66b2a99ec2fe9c4b978571c2413ff1
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 1 Aug 2016 09:39:01 +0000 (11:39 +0200)]
BUG-865: remove CloneableChildrenMap
This class has been deprecated and is not used anywhere. Remove
it.
Change-Id: I7d554de0b50e273a4468f247fdc73a10fdcb6e49
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sun, 31 Jul 2016 13:48:23 +0000 (15:48 +0200)]
BUG-865: remove JSONCodec.needQuotes()
This method is not anywhere and is part of internal contract,
remove it.
Change-Id: I9196b1257422598c97c12cabac97f87773d0993f
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sun, 31 Jul 2016 18:29:58 +0000 (20:29 +0200)]
Make Bit/EnumEffectiveStatementImpl inherit AbstractEffectiveDocumentedNode
This removes a bit of code duplication and also fixed EnumEffectiveStatement
not reporting UnknownSchemaNodes.
Change-Id: I7fd1c99d364c9f3d11dd49be77e3a6e650be4c16
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sun, 31 Jul 2016 14:45:47 +0000 (16:45 +0200)]
BUG-865: add proper nullness annotations
This fixes the mistake of making DocumentedNode.getStatus()
nullable and adds explicit annotations to DocumentedNode,
SchemaNode and UsesNode.
Change-Id: Ibc773feeca2a3f61d8a74c5b6cbc3028a2f4d260
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sun, 31 Jul 2016 14:25:01 +0000 (16:25 +0200)]
BUG-865: remove MustDefinitionImpl
This implementation is not used anywhere, remove it.
Change-Id: I10de6d971d6e2f7f66fbc073ba9272648ba2ddd8
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sun, 31 Jul 2016 14:20:43 +0000 (16:20 +0200)]
BUG-865: Move ModuleImportImpl and hide it
This implementation is used only in the parser,
move it to parser and hide it.
Change-Id: I9a469c01de5a5c077e6fd5aaf52ac6625fcce496
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Fri, 29 Jul 2016 12:30:40 +0000 (14:30 +0200)]
BUG-865: remove BitImpl
Introduce a BitBuilder and remove public BitImpl class.
Change-Id: Icf6297192cba21773a89b87bae817ebb0eebad9e
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Fri, 29 Jul 2016 12:11:08 +0000 (14:11 +0200)]
Propagate @Deprecated annotation
getDataChildByName(String) is deprecated, do not shadow
the annotation.
Change-Id: Ib1dbf3e7ea81bde65f79612854588315027398d8
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Thu, 28 Jul 2016 02:35:03 +0000 (04:35 +0200)]
BUG-865: remove deprecated EnumPairImpl
With all users migrated, this class can safely be removed.
Change-Id: I939ed0b1d127dabadd45134a83d50a7d3073ac74
Signed-off-by: Robert Varga <rovarga@cisco.com>
Peter Kajsa [Tue, 19 Jul 2016 13:17:36 +0000 (15:17 +0200)]
Bug 5518: Beryllium yangtools gives error parsing files with Tail-F deref statement
Added unit test which creates SchemaContext from yang model which contains call
of DEREF function in xpath expression of MUST statement. Both SchemaContext and
RevisionAwareXpath are created successfully.
Change-Id: I528da17dcd758d8c40904a6692603a833651d5e1
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Isaku Yamahata [Fri, 8 Jul 2016 00:23:04 +0000 (17:23 -0700)]
Bug 6112 - yang data impl: teach codec union+identityref
Identityref requires special handling on serialization/deserialization.
This patch teaches it to yang data codec.
Change-Id: Ib229e8cd5d65baff562945ecdac32982549a7cc6
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sun, 24 Jul 2016 22:21:42 +0000 (00:21 +0200)]
Refactor ModifyAction
Change-Id: I22356a00d1249f87c9c69af0945d51d8d80e9325
Signed-off-by: Robert Varga <rovarga@cisco.com>
Peter Kajsa [Thu, 14 Jul 2016 10:46:14 +0000 (12:46 +0200)]
Bug 6180 - Parser: Backslash double-quote in double-quoted string not recognized
Statement parser removes all double or single quotes from strings,
what is incorrect. This fix removes only first and last quotes if they are
present. All other quotes in the string should be escaped already, since the
ANTLR parser recognizes only correctly enclosed strings.
Further, substitution of backslash-escaped characters in
double-quoted strings is done.
Change-Id: I2f596c73be05178dc5cbebaed12e25e428454219
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Ajay [Mon, 25 Jul 2016 07:48:01 +0000 (07:48 +0000)]
Bug-6195: Fix issue with leafSetEntryNode in SchemaTracker
Changed SchemaTracker:leafSetEntryNode so that if LeafSetEntryNode
is present without it's parent LeafEntryNode in data-change notification,
it's serialization is handled properly.
Change-Id: I911eef98898f2269b31378b383617373c1b47903
Signed-off-by: Ajay <ajayl.bro@gmail.com>
Robert Varga [Thu, 28 Jul 2016 02:33:33 +0000 (04:33 +0200)]
BUG-865: Deprecate EnumPairImpl
Leaking implementation classes leads to badness when users
use them instead of interfaces. Deprecate EnumPairImpl and provide
an alternative available via EnumPairBuilder.
Change-Id: I9a11a6fa54da1ef9594fdb8318fea9482b0703c3
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Wed, 27 Jul 2016 22:15:54 +0000 (00:15 +0200)]
Use TypedSchemaNode
Now that we have introduced the concept, use it for common
codepaths.
Change-Id: I8dd9436fc270ee19661971b2990c4a82abda6097
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Tue, 26 Jul 2016 21:38:12 +0000 (23:38 +0200)]
Introduce common interface for getValue() method
LeafNode and LeafSetEntryNode both share this method. Codec-type users
benefit from being able to call on a common interface bridging the two
otherwise unrelated classes.
Change-Id: I5ef86c6859cf6cb7620aa3e4477941f248640c4f
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Tue, 26 Jul 2016 21:14:25 +0000 (23:14 +0200)]
Move Leaf(List)SchemaNode.getType() to a common interface
This helps users such as the Java Binding implementation.
Change-Id: Iec2b47f6b6e5974e506edc25905c3a77ee167565
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Tue, 26 Jul 2016 11:29:23 +0000 (13:29 +0200)]
BUG-865: move getUnknownSchemaNodes to DocumentedNode
We already duplicate this method in SchemaNode and UsesNode.
Furthermore EnumPair is actually a DocumentedNode with unknown
nodes.
Move the method definition to DocumentedNode with a default
implementation which returns an empty list. This allows a more
substantial change, which is making EnumPair not a SchemaNode,
but a DocumentedNode.
Change-Id: I0524d9905aea55f150bff88ca022c4467881c367
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 18 Jul 2016 16:32:41 +0000 (18:32 +0200)]
BUG-865: make EnumPair getQName/getSchemaPath unimplemented
EnumPairs by definition do not have SchemaPath, which makes
them non-SchemaNodes. As a first step make the methods
unimplemented so we can catch offenders.
Change-Id: I19cb47368ea5b575fa2ce89bb0c4b6a934bdaae3
Signed-off-by: Robert Varga <rovarga@cisco.com>
Michael Vorburger [Mon, 25 Jul 2016 22:30:35 +0000 (00:30 +0200)]
Package JavaDoc to clarify what this artifact is & does
Full disclosure: I LIKE the concept of what one could call
MockitoNotImplementedExceptionAnswer, and have separately implemented
the same (one can find this idea publicly on the web in several places).
I don't think having this configured by default automagically is good;
that is just too sneaky and surprising IMHO. One should be able to use
a popular utility and expect it to behave as it's documented?
No offense meant to anyone. None taken I hope.
Change-Id: Idf30e82c2cb1777065de781a5eecc220416161ca
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Michael Vorburger [Mon, 25 Jul 2016 23:12:40 +0000 (01:12 +0200)]
Checkstyle clean up about 200 trivial violation
I've intentionally started with the very simple formatting type changes
here. This does not take care of everything yet, but it's a start.
Hopefully sending a few batches also makes it easier (AssertionError e)
{to review.
Change-Id: Ibf328746c6880138a56eb36837bc8e789647b9bd
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Michael Vorburger [Mon, 25 Jul 2016 22:46:08 +0000 (00:46 +0200)]
Organize Imports to be Checkstyle compliant in utils
Change-Id: I7bf2721ea5cbe310d73fd1f5f7784395bd44d871
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Robert Varga [Wed, 20 Jul 2016 13:44:27 +0000 (15:44 +0200)]
Fix a few warnings
Use of raw type and use of deprecated junit methods.
Change-Id: Iafd1c515eb2b1598e56a0d4e4f19b459fce47aab
Signed-off-by: Robert Varga <rovarga@cisco.com>
Peter Kajsa [Thu, 21 Jul 2016 10:46:22 +0000 (12:46 +0200)]
Bug 6240: Entities of imported module's submodule are not visible
Yang statement parser didn't lookup yang elements in submodules of imported module.
Therefore each submodule element was always invisible to other modules even if they
imported parent module of the submodule.
This patch adds IncludeContext to the each RootStatementContext in order to allow
lookup of yang elements also in included submodules.
Change-Id: I9993b9fe110a5e80e9a61258a40841af13c18320
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Robert Varga [Sun, 24 Jul 2016 17:16:41 +0000 (19:16 +0200)]
Fix checkstyle errors and activate enforcement for concepts
In an effort to clean our code up, this activates enforcement
of checkstyle rules in concepts and makes sure the build passes.
Change-Id: Ide488a7e4664ff146c23f5f84a2a284055dcb0b3
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sun, 24 Jul 2016 15:54:24 +0000 (17:54 +0200)]
Kill trailing whitespace
Addresses checkstyle warnings about trailing whitespace.
Change-Id: Iaa05edcdb22138ec805ab782d94be7f2c8de6458
Signed-off-by: Robert Varga <rovarga@cisco.com>
Thanh Ha [Sat, 23 Jul 2016 01:27:29 +0000 (21:27 -0400)]
Add missing license headers
Change-Id: I5a284260b0700e605ca6781131191955339df3eb
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Robert Varga [Wed, 13 Jul 2016 08:45:10 +0000 (10:45 +0200)]
BUG-865: remove SourceIdentifier.cachedReference()
This has been superseded by SourceIdentifier.intern().
Change-Id: Idf5deb6653180e9b9185cb34182ff4cf07da7685
Signed-off-by: Robert Varga <rovarga@cisco.com>
Michael Vorburger [Thu, 21 Jul 2016 01:58:22 +0000 (03:58 +0200)]
Improve yang-maven-plugin error reporting
Instead of e.g. this: org.apache.maven.plugin.MojoFailureException:
Failed to scan for YANG files in depedencies (...) Caused by:
java.util.zip.ZipException: invalid CEN header (bad signature) at
java.util.zip.ZipFile.open(Native Method)
it will now report the much more useful variation like this:
org.apache.maven.plugin.MojoFailureException: Failed to scan for YANG
files in dependency:
/home/vorburger/.m2/repository/org/opendaylight/openflowplugin/model/model-flow-base/0.3.0-SNAPSHOT/model-flow-base-0.3.0-SNAPSHOT.jar
Change-Id: I1062d10d9157f9ac6b44cd86a29af8cc8e87b25f
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Michael Vorburger [Thu, 21 Jul 2016 02:06:59 +0000 (04:06 +0200)]
Fix minor bug in (new) LogMessageExtractorCheck
Normally the target/ directory already exists of course, but if you e.g.
run just "mvn process-sources" then, on some project, the target/
directory may not exist (yet) - and thus this code must ensure it
creates it.
Change-Id: I764e3673433a4abb6819b883f24d7622ac2f352b
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Michael Vorburger [Thu, 21 Jul 2016 01:05:00 +0000 (03:05 +0200)]
Checkstyle clean-up src/test/java
Required to be able to run (enforce) CS on src/test as well.
Change-Id: Ifa974a62fc5d912fc6e8a710851da7618254e256
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Robert Varga [Fri, 15 Jan 2016 20:48:21 +0000 (21:48 +0100)]
BUG-865: Remove DataTreeFactory#create()
This method has been deprecated in favor of more specific create
methods. Remove it.
Change-Id: I5631f8e6354ea8abd5002241d5ecbc6e51b5c584
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>