yangtools.git
7 years agoBUG-6497: Do not lose augmentation statement order 75/44875/3
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>
7 years agoBUG-6316: Fix Bit and EnumPair's position/value types 55/42855/12
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>
7 years agoBug 6420: Fixed SemVer's valueOf method 59/43959/2
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>
7 years agoBug 6410: Fixed initialization of typedefs in rpc 36/44036/3
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>
7 years agoBug 6419: Fixed SchemaContextEmitter's emitContainer method 75/43975/3
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>
7 years agoBug 3899: Milestone: Increase test coverage for Yangtools 57/43857/2
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>
7 years agoBug 6416: Fixed SchemaContextEmitter's emitIdentityrefSpecification method 71/43971/2
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>
7 years agoBug 6414: Fixed DataNodeIterator's traverseModule method 70/43970/3
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>
7 years agoRevert "Bug 5968: Mandatory leaf enforcement does not work in some cases" 68/43968/2
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>
7 years agoBUG-865: remove String-based getDataChildByName() 98/42898/7
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>
7 years agoBug 5968: Mandatory leaf enforcement does not work in some cases 09/42709/4
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>
7 years agoIntro. new yangtools.testutils artifacts (incl. Mikito) 29/42529/8
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>
7 years agoBug 3899: Milestone: Increase test coverage for Yangtools 09/43509/3
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>
7 years agoEliminate QNAME_FUNCTION 36/43336/2
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>
7 years agoUse lambdas instead of StmtContextUtils.build{Declared,Effecive} 62/42862/7
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>
7 years agoImprove yang-maven-plugin error reporting for errors in dependencies 97/43497/3
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>
7 years agoBump ietf versions to ...10-SNAPSHOT 15/43515/1
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>
7 years agoBump versions by 0.1.0 for next dev cycle 55/43455/1
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>
7 years agoFix list modification with DataTree rooted at MapEntryNode 09/43309/2
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>
7 years agoBug 6244: Add context to exceptions thrown by yang statement parser 13/43113/2
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>
7 years agoFix list modification with DataTree rooted at MapEntryNode 25/43225/3
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>
7 years agoBug 3899: Milestone: Increase test coverage for Yangtools 20/43120/2
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>
7 years agoDo not use revision in AbstractEffectiveDocumentedNode 61/42861/4
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>
7 years agoBUG-865: hide SchemaPath constructor 97/42897/2
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>
7 years agoFix wrong javadoc 96/42896/2
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>
7 years agoBUG-865: Remove deprecated XmlStreamUtils constructor 95/42895/2
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>
7 years agoBUG-865: remove CloneableChildrenMap 93/42893/1
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>
7 years agoBUG-865: remove JSONCodec.needQuotes() 50/42850/2
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>
7 years agoMake Bit/EnumEffectiveStatementImpl inherit AbstractEffectiveDocumentedNode 60/42860/2
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>
7 years agoBUG-865: add proper nullness annotations 54/42854/2
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>
7 years agoBUG-865: remove MustDefinitionImpl 53/42853/3
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>
7 years agoBUG-865: Move ModuleImportImpl and hide it 52/42852/3
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>
7 years agoBUG-865: remove BitImpl 80/42780/6
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>
7 years agoPropagate @Deprecated annotation 79/42779/3
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>
7 years agoBUG-865: remove deprecated EnumPairImpl 70/42670/6
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>
7 years agoBug 5518: Beryllium yangtools gives error parsing files with Tail-F deref statement 47/42047/2
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>
7 years agoBug 6112 - yang data impl: teach codec union+identityref 45/41545/5
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>
7 years agoRefactor ModifyAction 14/42414/3
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>
7 years agoBug 6180 - Parser: Backslash double-quote in double-quoted string not recognized 28/41828/13
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>
7 years agoBug-6195: Fix issue with leafSetEntryNode in SchemaTracker 45/42445/3
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>
7 years agoBUG-865: Deprecate EnumPairImpl 69/42669/1
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>
7 years agoUse TypedSchemaNode 63/42663/1
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>
7 years agoIntroduce common interface for getValue() method 95/42595/3
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>
7 years agoMove Leaf(List)SchemaNode.getType() to a common interface 93/42593/3
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>
7 years agoBUG-865: move getUnknownSchemaNodes to DocumentedNode 61/42561/1
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>
7 years agoBUG-865: make EnumPair getQName/getSchemaPath unimplemented 94/41994/7
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>
7 years agoPackage JavaDoc to clarify what this artifact is & does 08/42508/3
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>
7 years agoCheckstyle clean up about 200 trivial violation 11/42511/1
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>
7 years agoOrganize Imports to be Checkstyle compliant in utils 09/42509/1
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>
7 years agoFix a few warnings 49/42149/3
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>
7 years agoBug 6240: Entities of imported module's submodule are not visible 12/42312/2
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>
7 years agoFix checkstyle errors and activate enforcement for concepts 08/42408/1
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>
7 years agoKill trailing whitespace 07/42407/2
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>
7 years agoAdd missing license headers 68/42368/1
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>
7 years agoBUG-865: remove SourceIdentifier.cachedReference() 50/41750/3
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>
7 years agoImprove yang-maven-plugin error reporting 93/42193/2
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>
7 years agoFix minor bug in (new) LogMessageExtractorCheck 94/42194/2
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>
7 years agoCheckstyle clean-up src/test/java 88/42188/1
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>
7 years agoBUG-865: Remove DataTreeFactory#create() 50/32850/10
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>
7 years agoBUG-865: remove CrossSourceStatementReactor.buildEffectiveMappedToSource() 93/41993/3
Robert Varga [Mon, 18 Jul 2016 16:38:46 +0000 (18:38 +0200)]
BUG-865: remove CrossSourceStatementReactor.buildEffectiveMappedToSource()

This method has been deprecated and is used by a test. Remove the test
and the method.

Change-Id: Icf44b4361626dd6cf470d8e7547adfbcd1784ac8
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoMake YangToSourcesProcessor methods static 92/41992/3
Robert Varga [Mon, 18 Jul 2016 16:42:24 +0000 (18:42 +0200)]
Make YangToSourcesProcessor methods static

Utility methods can be made static.

Change-Id: I1ad42b3f83fb661c6ec0022d213d4946dbf1157a
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-865: remove SchemaContextUtil.findParentModuleByType() 91/41991/2
Robert Varga [Mon, 18 Jul 2016 16:21:24 +0000 (18:21 +0200)]
BUG-865: remove SchemaContextUtil.findParentModuleByType()

This method has been deprecated and is no longer used
anywhere: remove it.

Change-Id: Idd5d1398f9743e301ed4a8a71de053128b354bf7
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-865: remove deprecated BaseTypes constants 89/41989/2
Robert Varga [Mon, 18 Jul 2016 16:19:44 +0000 (18:19 +0200)]
BUG-865: remove deprecated BaseTypes constants

These constants have been deprecated and are no longer
used anywhere.

Change-Id: Ied9ae9303eeb76a8f7de99e74ff3a7f44cc8aa3b
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-865: remove InstanceIdentifierTypeDefinition#.getPathStatement() 88/41988/2
Robert Varga [Mon, 18 Jul 2016 16:15:51 +0000 (18:15 +0200)]
BUG-865: remove InstanceIdentifierTypeDefinition#.getPathStatement()

Remove this deprecated method.

Change-Id: Id54fdfecc8601fa1c85870ee1334e650813ac07d
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-865: remove DataSchemaNodeAware 87/41987/2
Robert Varga [Mon, 18 Jul 2016 16:12:59 +0000 (18:12 +0200)]
BUG-865: remove DataSchemaNodeAware

This interface has been integrated into NormalizedNodeStreamWriter
and has no other users: remove it.

Change-Id: If7d6923c52f15fdc79784edcbb8b665368961082
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-865: remove SchemaContextHolder 86/41986/2
Robert Varga [Mon, 18 Jul 2016 16:08:17 +0000 (18:08 +0200)]
BUG-865: remove SchemaContextHolder

This interface has been deprecated and is not used by any
live code, remove it.

Change-Id: Ibb556ada5bedba765cac5d375ec52024c5f3ef06
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-865: eliminate getYangText() 85/41385/4
Robert Varga [Wed, 6 Jul 2016 09:51:12 +0000 (11:51 +0200)]
BUG-865: eliminate getYangText()

Change-Id: Id8a952cb7b299e1eccd49279f91bf6bf41b8986e
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoFix bug FileNotFoundException: target/logger-messages.txt polluting logs 71/42071/2
Michael Vorburger [Tue, 19 Jul 2016 17:05:46 +0000 (19:05 +0200)]
Fix bug FileNotFoundException: target/logger-messages.txt polluting logs

Change-Id: I1f9bfd493d1554b4d081738c7bb6e4a30fa19290
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
7 years agoRemove use of Guava Charsets 74/41974/4
Robert Varga [Mon, 18 Jul 2016 14:19:35 +0000 (16:19 +0200)]
Remove use of Guava Charsets

We have StandardCharsets, use those.

Change-Id: I92677e8a72cf16fc03df25226c967221959f14c5
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBug 6022: Deviation statement is not fully available in the YANG parser output 52/40752/9
Igor Foltin [Thu, 23 Jun 2016 07:11:36 +0000 (09:11 +0200)]
Bug 6022: Deviation statement is not fully available in the YANG parser output

- deviation statement can now contain one or more deviate statements
as it is defined in rfc6020
- deviate statement now provides more information about deviated statements

Change-Id: I38ebb5932626df9a0c2de00220474a88ca7f2bc9
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
7 years agoNew LogMessageExtractorCheck which writes out TXT report of all loggers 10/39410/10
Michael Vorburger [Wed, 25 May 2016 12:58:03 +0000 (14:58 +0200)]
New LogMessageExtractorCheck which writes out TXT report of all loggers

Change-Id: I853c742901131293c58c78bea821fe0d12957f07
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
7 years agoAdd toString() to InMemoryDataTreeCandidate 10/39310/4
Tomas Cere [Tue, 24 May 2016 09:01:14 +0000 (11:01 +0200)]
Add toString() to InMemoryDataTreeCandidate

Change-Id: I9ece88ef6e2c5db17f46d732316f52984269d7d3
Signed-off-by: Tomas Cere <tcere@cisco.com>
7 years agoFix YangToSourcesPluginTestIT failure 05/41505/3
Michael Vorburger [Thu, 7 Jul 2016 16:27:45 +0000 (18:27 +0200)]
Fix YangToSourcesPluginTestIT failure

Inspired by
http://blog2.vorburger.ch/2016/05/how-to-make-maven-archetype-plugin.html

The YangToSourcesPluginTestIT obviously does pass on Jenkins, but that
relies on magical environment variables.  I'm sure it also works locally
for those who use the custom ODL settings.xml globally - but I don't; I
just use "mvn -s odl.xml" kind of thing.  This fix makes the
YangToSourcesPluginTestIT pass even then, because it will now re-use the
real "effective" settings XML under which Maven was started.

Change-Id: I1edbed691ac1a01c8bfc1c8178d4836781aba0a1
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
7 years agoBug 6173: Allow refine statement to have no substatements 52/41552/4
Vratko Polak [Tue, 12 Jul 2016 10:44:40 +0000 (12:44 +0200)]
Bug 6173: Allow refine statement to have no substatements

Change-Id: I2c281b8feb10fe25f67ec81de49bd0fbc69c7f45
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
7 years agoBug 6131 - NPE on malformed yang model 09/41809/2
Peter Kajsa [Thu, 14 Jul 2016 08:45:41 +0000 (10:45 +0200)]
Bug 6131 - NPE on malformed yang model

Handling of NPE when source model does not contain any
valid root element.

Change-Id: I76d4aeb257cd2e20e75447fa2fc53e455063a8ae
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
7 years agoPerformance related changes 39/41339/4
Michael Vorburger [Tue, 5 Jul 2016 18:01:27 +0000 (20:01 +0200)]
Performance related changes

Gets the related code out of the Hot Methods in JMC, but overall still
seems to have very little bottom line impact, as far as I can tell.
Still not a bad idea to apply though, I think.

Bug 6158
Change-Id: I8e76b63d4b5e5a3d6ddebb8aec3434e40189031d
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
7 years agoFix yang.skip feature to include all files needed 80/41480/2
David [Thu, 7 Jul 2016 12:59:29 +0000 (14:59 +0200)]
Fix yang.skip feature to include all files needed

The generation process, as a side-effect, is also including
some META-INF folders to the project final files. When
skipping the generation process, this inclusion must
be done separately

Change-Id: I1e2d2f48a2fc5b33c06ba83258a477b5a046ee08
Signed-off-by: David <david.lopez.munoz@ericsson.com>
7 years agoBUG-865: eliminate ExtendedType and DerivedType 68/41468/4
Robert Varga [Thu, 7 Jul 2016 10:36:43 +0000 (12:36 +0200)]
BUG-865: eliminate ExtendedType and DerivedType

ExtendedType is no longer used anywhere, hence DerivedType
is not needed, too. Eliminate both of them.

Change-Id: I2062056b93a00c5b8305a841359ae0fa8356d086
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBug 6134: Introducing of DataTreeConfiguration concept 38/41138/4
Peter Kajsa [Thu, 30 Jun 2016 11:55:10 +0000 (13:55 +0200)]
Bug 6134: Introducing of DataTreeConfiguration concept

Introducing of DataTreeConfiguration concept which allows to set up appropriate
configuration of data tree (e.g. enable/disable some validations etc.)

This can be useful when some type of strict validation is not required or useful for some
reasons.

Change-Id: I913dec079e8e2617ef4d0f4954f2b1c332fa7e3b
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
7 years agoBug 6158: Optimization of if-feaures resolution during SchemaContext assembly 71/41471/7
Peter Kajsa [Thu, 7 Jul 2016 08:31:49 +0000 (10:31 +0200)]
Bug 6158: Optimization of if-feaures resolution during SchemaContext assembly

It is unnecessary to check both declared and effective substatements everytime,
because effective substatements are empty at the beginning and they are filled
subsequently by copying of declared. Therefore this patch check whether
a feature is supported only for declarted statements during their build and
also creation of their copy.
In addition this patch introduces ALL_FEATURES predicate constant. The constant
is passed as argument into default SchemaContext build, and so we can simply
return true and skip rest of areFeaturesSupported method.
Moreover the result of areFeaturesSupported method is cached and so it is
not computed more times for any statement.

Change-Id: If8c87975712b65f9f28b640ac0b634576e08c191
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
7 years agoDrop yangtools-parent 02/40302/9
Stephen Kitt [Tue, 14 Jun 2016 14:12:12 +0000 (16:12 +0200)]
Drop yangtools-parent

This emerged from trying to use odlparent's bundle-parent for bundles,
and thus be able to remove the yangtools overrides for
maven-jar-plugin and maven-javadoc-plugin in particular.

This probably removes features from yangtools-parent which should be
replicated elsewhere; in particular, the Sonar/JaCoCo integration
should be available for everyone.

Change-Id: Id41e61eb3da2f30be29981a11387bde467acae3d
Signed-off-by: Stephen Kitt <skitt@redhat.com>
7 years agoBUG-865: remove deprecated types 65/41465/3
Robert Varga [Thu, 7 Jul 2016 10:16:56 +0000 (12:16 +0200)]
BUG-865: remove deprecated types

This removes deprecated types in yang.model.util.

Change-Id: I8c24e54a172ad67dc6620415f0abaf98e6e323a4
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoMinor refactoring in YangToSourcesPluginTestIT 04/41504/1
Michael Vorburger [Thu, 7 Jul 2016 16:22:49 +0000 (18:22 +0200)]
Minor refactoring in YangToSourcesPluginTestIT

Just to reduce a few lines of copy/paste.  I actually did this because I
wanted to call the factored out method for a real fix, but then ended up
not using it; so I'm putting in this proposed minor refactoring as a
first small low prio change, and the more important real fix as a
separate change coming up next.

Change-Id: Ic888310f1ae74e58eaa96e41c0cb53ab2215023e
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
7 years agoBug 5884: Augmenting a choice without a case results in no getter 58/40158/13
Filip Gregor [Fri, 10 Jun 2016 11:26:00 +0000 (13:26 +0200)]
Bug 5884: Augmenting a choice without a case results in no getter

binding generator can not generate correctly getters for
augmented case shortHand.
added new namespace, added short hand case for augments
shortHand is created when augmenting choice with
case shortHand

Change-Id: I8543834bf3e3cf5e222d60617f116aca3639bc82
Signed-off-by: Filip Gregor <fgregor@cisco.com>
7 years agoBug 5942: When condition of uses node is not exposed by the YANG parser 75/39775/6
Peter Kajsa [Thu, 2 Jun 2016 14:31:06 +0000 (16:31 +0200)]
Bug 5942: When condition of uses node is not exposed by the YANG parser

Interface UsesNode does not provide any method to obtain When condition,
Description, Status, Reference and UnknownNodes defined in yang source.
This patch provides API definition and its implementation necessary to get
these substatements of UsesNode.

Change-Id: I51e182de247a9375e4e28d76d7fecb421721cfc4
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-865: Remove SchemaAwareNormalizedNodeStreamWriter 32/40732/2
Robert Varga [Wed, 22 Jun 2016 14:37:16 +0000 (16:37 +0200)]
BUG-865: Remove SchemaAwareNormalizedNodeStreamWriter

This functionality has been integrated into NormalizedNodeStreamWriter
and there are no outside users: remove the interface.

Change-Id: Ib66c3731682441dfe32b7f411400766b0825a48b
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoAvoid catch (NullPointerException e), take II 96/40996/3
Michael Vorburger [Tue, 28 Jun 2016 23:45:26 +0000 (01:45 +0200)]
Avoid catch (NullPointerException e), take II

Sorry for redoing this, but the first version last night wasn't my
finest code; multi return is bad style (and rejected by Checkstyle
checks in sevntu.checkstyle core).

Change-Id: Icdd72c99b54e23f8434577e61a6852aeca92d331
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
7 years agoBUG-865: remove UnknownBoundaryNumber 09/40709/6
Robert Varga [Wed, 22 Jun 2016 13:01:10 +0000 (15:01 +0200)]
BUG-865: remove UnknownBoundaryNumber

This is superseded by UnresolvedNumbder and not used anywhere.

Change-Id: I54c6cb315e311412015b3c5d082da03f9fe83455
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-865: Remove URLSchemaContextResolver 02/40702/7
Robert Varga [Wed, 22 Jun 2016 12:51:55 +0000 (14:51 +0200)]
BUG-865: Remove URLSchemaContextResolver

URLSchemaContextResolver is replaced by YangTextSchemaContextResolver.

Change-Id: Ia39e00eff649f0c515fa8257cd8061e6e501e39f
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoAvoid catch (NullPointerException e), do explicit if == null 75/40975/3
Michael Vorburger [Tue, 28 Jun 2016 23:45:26 +0000 (01:45 +0200)]
Avoid catch (NullPointerException e), do explicit if == null

This will be required to migrate this code upstream, see
https://github.com/sevntu-checkstyle/sevntu.checkstyle/issues/457, so
might as well already do this better here, for now.

Change-Id: Ic5e90867353b5239a0d6a768e889b75190d33305
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
7 years agoAdd property "yang.skip" 83/40183/4
David [Fri, 10 Jun 2016 21:05:59 +0000 (23:05 +0200)]
Add property "yang.skip"

This property allows the plugin to be configured so
to skip the generation of java sources out of yang files.
The purpose is to save the time spent genereting java code
that is already in place, and the user knows that haven't
changed since the last compilation.

Usage:
   mvn  install -Dyang.skip=true

Change-Id: I39d3da20864f7655cae68dfa9f4b67ec96137d9f
Signed-off-by: David <david.lopez.munoz@ericsson.com>
7 years agoBug 1441: Bug fixes, clean-up and test migration 43/39643/10
Igor Foltin [Tue, 31 May 2016 10:53:59 +0000 (12:53 +0200)]
Bug 1441: Bug fixes, clean-up and test migration

- fix of yang-modeled anyxml deserialization
- fix of anyxml deserialization
- fix of deserialization of identityref and instance-identifier leaves

- code clean-up of XmlParserStream and related classes

- migration of unit tests to new xml parser

- copied new xml serializer to yang-data-codec-xml module

Change-Id: Id214b78849998cf54e087685dcc78e3ded74ab69
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
7 years agoAllow base type builders to be used fluently 63/40663/2
Robert Varga [Wed, 22 Jun 2016 09:14:52 +0000 (11:14 +0200)]
Allow base type builders to be used fluently

These are final classes, hence we can return this and simplify users.

Change-Id: Ibc2a2c6e258fbeaebb042bdf81fb8cfdf269c379
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-865: remove unused model.util types 29/40629/5
Robert Varga [Tue, 21 Jun 2016 16:47:53 +0000 (18:47 +0200)]
BUG-865: remove unused model.util types

This removes classes no longer used anywhere.

Change-Id: I911d7e721f2c66059afdb0b54d9b15427fbe4706
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-865: remove unused TypeConstraints 51/40451/3
Robert Varga [Thu, 16 Jun 2016 15:40:07 +0000 (17:40 +0200)]
BUG-865: remove unused TypeConstraints

Change-Id: Ic9fb6ef1be0794d44e496cf921f8bc52248fa664
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoRemove formattedRevision from serialization format 40/40340/8
Robert Varga [Wed, 15 Jun 2016 00:06:12 +0000 (02:06 +0200)]
Remove formattedRevision from serialization format

We can always reconstruct formatted revision, there is no point
in serializing it. Mark it transient.

Change-Id: I6ced05aa50a972caf7760a65faac0a1c2107307a
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoAdd QNameModule hash cache 41/40341/8
Robert Varga [Wed, 15 Jun 2016 00:08:50 +0000 (02:08 +0200)]
Add QNameModule hash cache

QNameModules are looked up a regular basis. Cache their hashCode.

Change-Id: I6c4c021703bc673f32cbdc9bf5d1e6133bb99b81
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoIntern QName localname 39/40339/9
Robert Varga [Wed, 15 Jun 2016 00:01:50 +0000 (02:01 +0200)]
Intern QName localname

We only support JVMs 8+, hence no PermGen issues and the default
String table size is a reasonable number.

When we are interning a QName, we can safely also intern its localname,
so that we share them across the entire JVM.

Change-Id: Ic5ed998b2ad5483519ae844563d91841bb91f3a6
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoAdd QName.hashCode() cache 37/40337/6
Robert Varga [Tue, 14 Jun 2016 23:40:39 +0000 (01:40 +0200)]
Add QName.hashCode() cache

QName is usually involved in hash-based lookups, hence it is
useful to reuse a computed hash code so that constants do not
spend cycles on computing it more than once.

Add a field which will be lazily initiated to contain the result
of hashCode(). This has no impact on memory footprint.

Change-Id: I8a0b89599ed1029e2c572535826c52b4b837e265
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-865: remove QName(Module).cachedReference() 36/40336/4
Robert Varga [Tue, 14 Jun 2016 23:35:25 +0000 (01:35 +0200)]
BUG-865: remove QName(Module).cachedReference()

Deprecated, all users have been removed -> remove.

Change-Id: I408713ed1c80e6e8a5023f18005aff2ab9506ae5
Signed-off-by: Robert Varga <rovarga@cisco.com>