Robert Varga [Mon, 14 Sep 2015 21:05:43 +0000 (23:05 +0200)]
BUG-2219: reenable test
A test case was left disabled for when the bug is fixed, but was not
re-enabled afterwards.
Change-Id: I4d52d578d2eea830a03fd2ae6e9303f46cfac521
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 14 Sep 2015 19:52:00 +0000 (21:52 +0200)]
BUG-865: remove MavenLogAware and CodeGenerator
These two interfaces have been long-deprecated and should not be used.
Remove them and adjust the test suite accordingly.
Change-Id: I93606ae441880b8974b001f7c8d9d8ef7ad2a336
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 14 Sep 2015 20:52:58 +0000 (22:52 +0200)]
BUG-2220: re-enable test
This test has been marked to be activated once this bug is fixed, but
has been forgotten about. Re-activate it.
Change-Id: I9d93f3266c2055298e0a3e1f473a55591c2b9b0f
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 14 Sep 2015 20:37:53 +0000 (22:37 +0200)]
BUG-865: clean up yang.parser.builder
Removes previously-deprecated methods. Also properly deprecates
ConstraintsBuilder.toInstance() so it can be removed in the next
release.
Change-Id: Ib493b064a8fa838916bfb54962681c58bba89002
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 14 Sep 2015 20:20:20 +0000 (22:20 +0200)]
BUG-865: remove yang-data-impl deprecated methods
This removes a few methods which have been deprecated before Lithium
shipped.
Change-Id: I00e3119ac112a07b778f14d940900ae53619b7c1
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 14 Sep 2015 20:10:24 +0000 (22:10 +0200)]
BUG-865: Remove AugmentationSchemaProxy
It has been deprecated before Lithium shipped, remove it.
Change-Id: I32f9e51011fd814549faedcfa9c7fbc2f049f212
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 14 Sep 2015 18:58:49 +0000 (20:58 +0200)]
BUG-865: remove JSONNormalizedNodeStreamWriter.create()
These methods have been deprecated in Lithium, remove them.
Change-Id: Id407ce6404b5b897807c9d62b751cf9cd00298b9
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 14 Sep 2015 18:31:19 +0000 (20:31 +0200)]
BUG-865: Remove deprecated methods in yang.model.util
These have been deprecated before Lithium shipped and can therefore be
removed.
Change-Id: Ia71b9343c7ef04f0424711c75581ce2ca5e3e770
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 14 Sep 2015 18:19:07 +0000 (20:19 +0200)]
BUG-865: remove DefaultDataTreeCandidate
This class has been deprecated in Lithium, remove it.
Change-Id: Ib7c4dc46b285eaed0018a49bee3037d7a098884e
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 14 Sep 2015 16:36:24 +0000 (18:36 +0200)]
BUG-865: remove NodeModification
NodeModification is long-deprecated, remove it.
Change-Id: I294febf131c8c30af7e0a1f4312352e1dc803586
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 14 Sep 2015 16:10:34 +0000 (18:10 +0200)]
BUG-865: remove yang.model.util.repo
It has been deprecated in favor of yang.model.repo.utl.
Change-Id: Idae43e14b2853c7f348e016d7d6213acabe6ffc5
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 14 Sep 2015 15:08:03 +0000 (17:08 +0200)]
BUG-865: remove ChoiceNode
ChoiceNode was deprecated in favor of ChoiceSchemaNode in Lithium.
Remove it.
Change-Id: I4acfdcbce5fdd99fb8a893fa5820623fcb527a3f
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 14 Sep 2015 15:05:23 +0000 (17:05 +0200)]
BUG-865: Remove CompositeObjectRegistrationBuilder.toInstance()
This method has been deprecated in a previous release, now remove it.
Change-Id: I7cf84713df50001ef15d99c0ac5adfcb14a40625
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 14 Sep 2015 15:03:13 +0000 (17:03 +0200)]
BUG-865: remove deprecated DeadlockDetectingListeningExecutorService constructors
Function-based constructors have been deprecated in a previous release,
now remove them.
Change-Id: I0a1a64811504936fdc6e16186d4094b782c4c0cb
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 14 Sep 2015 14:58:13 +0000 (16:58 +0200)]
BUG-865: remove HashCodeBuilder.toInstance()
This method was deprecated in favor of build() in Lithium, remove it.
Change-Id: I52ce7aef4ff7a4ed29bb9a4a8a1a8bd6be09fe94
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 14 Sep 2015 14:57:09 +0000 (16:57 +0200)]
BUG-865: remove DurationStatsTracker
It has been deprecated in Lithium, remove it now.
Change-Id: I8e6b5be72c521881acbd7e860d6a3fdad85fed33
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 14 Sep 2015 10:42:01 +0000 (12:42 +0200)]
Cleanup yang-parser-impl
All around fixes:
- methods which can be made static
- Optional instance sharing
- Raw types
Change-Id: I04e2e7190cd4ffeda7d8a7fc2530f2c8e7bb27a8
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 14 Sep 2015 10:12:55 +0000 (12:12 +0200)]
Cleanup yang-model-util
Various warnings fixed.
Change-Id: Id2e7c6f100e2b6698204dfb70243b33d33be2488
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 14 Sep 2015 10:10:48 +0000 (12:10 +0200)]
Clean Decimal64 up
Remove proxy fields
Share the default constraints
Change-Id: I3fa1fa735d583e032f3f77a03d0f22e039f65714
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 14 Sep 2015 10:59:44 +0000 (12:59 +0200)]
Fix OffsetMap's unneeded modifiers
Sonar warnings: final is implied by class being final.
Change-Id: I53f97e56df4e0904584305be648541293669ef95
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sun, 21 Jun 2015 21:01:16 +0000 (23:01 +0200)]
Speed BooleanStringCodec up
Do not instantiate lower-cased strings, but rather use
equalsIgnoreCase(). Also make sure we call it on a constant.
Change-Id: I6ac4219c3cb2e3c09565a9eaf00c7a634d17afd4
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit
98b6009c05b266fe84afa40e75d9a73a87bf6436)
Robert Varga [Sun, 13 Sep 2015 17:27:57 +0000 (19:27 +0200)]
StoreTreeNodes: use YangInstanceIdentifier.getAncestor()
Removes open-coded YangInstanceIdentifier instantiation, as
getAncestor() will prevent copying path arguments around for both Fixed
and StackedYangInstanceIdentifier.
Change-Id: I1bcbaaf61a15f49d529df3cd057f7eeb8672b73a
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sun, 13 Sep 2015 16:57:58 +0000 (18:57 +0200)]
Introduce YangInstanceIdentifier.getAncestor()
We have callsites which want to create a truncated
YangInstanceIdentifier and open-code instantiation. This is not
efficient, as those users do not have an understanding of the
implementation details, thus they have to resort to Iterables.limit()
and similar -- which forces copying of path arguments and untrusted
instantiation of YangInstanceIdentifier.
This patch introduces getAncestor(int), which performs this operation
with explicit knowledge of a particular implementation, resulting in
as much reuse as possible: for FixedYangInstanceIdentifier it uses a
subList(), for StackedYangInstanceIdentifier we return either a
direct/indirect parent, or use FixedYangInstanceIdentifier's version.
Change-Id: I355200199ac9791bb6d027fcdfa2a1162208a627
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sun, 13 Sep 2015 16:25:05 +0000 (18:25 +0200)]
StoreTreeNodes: use SimpleImmutableEntry
Returned entry is just a DTO, so it does not conform to the usual Map
rules. Use an immutable version which does not allow setting of the
value.
Change-Id: Ib96afb442e9dc4f6173f2861033a799f98949e1d
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Wed, 9 Sep 2015 10:49:00 +0000 (10:49 +0000)]
Revert "Maven Plugin: Disable invalidVersion unit test"
This reverts commit
cf7736b10ac16c25928caaf132308d4704af6f53.
With JJB propagating the properties, the hotfix is no longer needed.
Change-Id: I39f1cb0fd8e0f76976bcbc9007f5e429410ceb8d
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sun, 6 Sep 2015 00:50:12 +0000 (02:50 +0200)]
Cleanup yang-data-api documentation a bit
Lowers the number of checkstyle warnings and fixes a few typos.
Change-Id: Ica6d96987990e959f949b1376e5dbd23d8b39f90
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 7 Sep 2015 15:54:13 +0000 (17:54 +0200)]
BUG-4261: introduce NormalizedNodeInterners
This is the infrastructure for sharing LeafNode and LeafSetEntryNode
instances. It does not convert any users to actually take advantage of
them.
Change-Id: I40048c60d4aa5984df194391576a94c4b0681a3a
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 7 Sep 2015 21:55:23 +0000 (23:55 +0200)]
BUG-3876: Add XPath interfaces
This patch introduces the basic set of interfaces implemented by XPath
evaluation providers.
Change-Id: Ib4f766844f635ec1d6cdd582208547e7c63edc56
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Fri, 11 Sep 2015 20:37:19 +0000 (22:37 +0200)]
Make ChildTrackingPolicy an abstract class
Rather than switching on an enum to instantiate the map for children,
make it an interface contract. While the functionality will remain the
same, this will allow allocation of the map based on information
available from the SchemaNode.
Change-Id: Ibeee8c6c991fb592f5e1af02c86ebbfe8ef85bf2
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Fri, 11 Sep 2015 10:29:15 +0000 (12:29 +0200)]
Implement ConstantArrayCollection.toString()
Missing toString() breaks places which rely on collections properly
formatting their elements. Add an implementation and provide a simple
test suite. Also add hashCode()/equals().
Change-Id: I09ce7ecf2c541ab546e9b2a6f9916f0e76d4a511
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sun, 13 Sep 2015 18:47:09 +0000 (20:47 +0200)]
BUG-4145: check if entire YangInstanceIdentifier is present in SchemaContext
A failure to find the SchemaNode for a path argument results in a
NullPointerException. We need the SchemaNode to understand whether it
targets an augmentation, as those need to be pruned from string output.
This patch improves the behaviour by throwing an
IllegalArgumentException with a description of which component we failed
to find.
Change-Id: I128eb63cf05b278b1af7516d426a6f0bafa87b90
Signed-off-by: Robert Varga <rovarga@cisco.com>
Tony Tkacik [Fri, 11 Sep 2015 09:00:56 +0000 (11:00 +0200)]
Fixed Maven plugin not working without install phase.
Fixed small typo, which broke YANG Maven plugin,
when project sources was compiled without install
phase and YANG models were loaded from other artefact
in same build reactor.
[ERROR] yang-to-sources: Unable to parse yang files from /Users/repenno/Documents/sfc-ut3/sfc-provider/src/main/yang
java.io.FileNotFoundException:
/Users/repenno/Documents/sfc-ut3/sfc-model/target/classes (Is a directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:146)
at
org.opendaylight.yangtools.yang.parser.util.NamedFileInputStream.<init>(Nam
edFileInputStream.java:18)
at
org.opendaylight.yangtools.yang2sources.plugin.YangSourceFromFile.openStrea
m(YangSourceFromFile.java:27)
at
org.opendaylight.yangtools.yang2sources.plugin.YangToSourcesProcessor.toStr
eamsWithoutDuplicates(YangToSourcesProcessor.java:197)
Change-Id: Ia0b7d68dd3c0102134e5425a0705044e92fa0386
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Robert Varga [Thu, 10 Sep 2015 07:57:46 +0000 (09:57 +0200)]
Implement ImmutableOffsetMap.toString()
Previous patch inadvertedly removed the Map-specific implementation of
toString() -- as it used to be iunherited from AbstractMap. This patch
introduces it back.
Change-Id: Id186a75b5e4880461375c8031756461db78fee0e
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 7 Sep 2015 19:37:26 +0000 (21:37 +0200)]
BUG-4275: Improve MapAdaptor and LazyContainerNode map overhead
Analysis of a heap dump has shown that for two-entry containers we end
up allocating HashMaps with default load factor. This boils down to
HashMap's copy constructor enforcing allocation to at least 16 entries
and also us not properly sizing for small maps.
MapAdaptor is taught to use HashMap.clone() and fall back to conservative
sizing on small inputs.
LazyContainerNode is taught to properly size the copy map when being
converted to a Mutable.
Change-Id: I6ad36aea31aab2e5e70176143d74e97c6d6a9ca5
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Tue, 8 Sep 2015 20:59:44 +0000 (22:59 +0200)]
Make OffsetMaps work on direct values
We do not really have a use-case for lazy values at this point. Remove
the capability, opting for increased efficiency instead.
Change-Id: Ie0c66d0c91c8fcdca44a2c8e49b6e9263c8a58df
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Fri, 4 Sep 2015 14:49:58 +0000 (16:49 +0200)]
Introduce SharedSingletonMap
ImmutableMap can be very expensive in terms of memory overhead when
storing a large number of singleton maps which have the same keySet(),
because it instantiates an ImmutableSet, which remains cached. That ends
up costing 24 bytes in local testing.
This patch implements a replacement class which retains the same
properties, but shares the keySet instances -- thus lowering the overall
overhead. For these instances we introduce an SingletonSet class, which
is memory-efficient and gives us direct access to the container entry.
This leaves entrySet() as the only method which allocates objects. We do
not cache returned objects in the expectation any caller users them as
pure DTOs, hence they end up being cheap.
Change-Id: I64e74d8e661d2689d32bea31e1cdf72e87ed64af
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sat, 29 Aug 2015 09:02:52 +0000 (11:02 +0200)]
BUG-4158: *MapPhase should extend Mutable/Immutable
The two phases correspond to Mutable/Immutable, let's make sure we mark
them as such.
Change-Id: I98a3b9f3acbc0046fe4c14cf6ba975f2eea7b9c9
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Tue, 8 Sep 2015 09:31:14 +0000 (11:31 +0200)]
BUG-4278: Improve TOUCH operation effects
The implementation of TOUCH operation would bump the subtree version of
the node even if there were no children coming in, resulting in needless
promotion of LazyContainerNodes to MaterializedContainerNodes.
If a TOUCH operation does not result in any of the children being
modified, the subtree version should not be bumped, since the subtree
was not changed. This should be the case if the user-specified children
are empty and also if the all nodes end up not modifying the data tree.
Detect both conditions and reuse the original metadata node instead of
replacing it -- this preventing LazyContainerNode promotion.
Change-Id: Icdbde02e7c3f503a9ada28b58fd27e3e3a3ef812
Signed-off-by: Robert Varga <rovarga@cisco.com>
Peter Kajsa [Tue, 8 Sep 2015 12:01:36 +0000 (14:01 +0200)]
Maven plugin ignores exact YANG duplicates in dependencies
Maven plugin failed if same YANG file was available
in two different artifacts available via transitive dependencies
which actually prevented use-cases as non-breaking
artifact renaming.
Change-Id: I88dee0470568910c35e4f310bf850605dea1ca4c
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Tony Tkacik [Wed, 9 Sep 2015 10:11:20 +0000 (12:11 +0200)]
Maven Plugin: Disable invalidVersion unit test
Change-Id: Iddcaefd1a121e18cc0f0efe03ea8d79a73025b6d
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Tony Tkacik [Tue, 28 Apr 2015 15:46:29 +0000 (17:46 +0200)]
Fixed some major sonar warnings in yang-data-api
Change-Id: I53006edaa2963e50ff8366c76d2e67778499b345
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Tue, 8 Sep 2015 13:49:43 +0000 (15:49 +0200)]
Pass down maven settings locations
ODL environment does not have settings.xml at default locations, so we
need to provide an override.
Change-Id: Ic9921f7ac518db5be79129a70b727a63d3d8336e
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Fri, 4 Sep 2015 16:57:35 +0000 (18:57 +0200)]
BUG-4258: implement enumeration value canonicalization
Convert the internal lookup set to a Map, which contains interned
strings. When asked to deserialize() a String, perform a lookup in the
Map and return the interned string instance instead of the serialized
instance.
Change-Id: I1eff1f3bd23446bf8b1090a386bb2d31d205f904
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Fri, 4 Sep 2015 17:48:47 +0000 (19:48 +0200)]
Optimize SchemaContextUtil.findParentModule()
SchemaPath exposes getLastComponent(), which gives us efficient access
to the last QName in the path. Use it instead of forcing object
instantiation.
Change-Id: Ibdfb41fdb130aff8758f5cf94b262e0be854d77e
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sun, 6 Sep 2015 08:37:36 +0000 (10:37 +0200)]
Fixup ConstraintMetadataDefinition javadocs
Simple typo and missing empy lines.
Change-Id: I0a5c012f08b22dca0412abddbd319803e2657b0c
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sun, 6 Sep 2015 09:33:23 +0000 (11:33 +0200)]
Implement efficient hashCode for OffsetMaps
This patch fixes the sonar warnings and also does not instantiate the
entrySet for purposes of hashCode() calculation. Also make sure
ImmutableOfsetMap returns SimpleImmutableEntries.
Change-Id: If8d736e0551501cde78acb2209a8cb2c17794933
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sun, 6 Sep 2015 00:57:21 +0000 (02:57 +0200)]
Do not override mapping from odlparent
Checkstyle fails with eclipse mars and odlparent already contains the
proper mapping. Do not override it.
Change-Id: I8219ca5eaf55cb4d02f07b52594b3a4cc6a387f3
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sat, 5 Sep 2015 20:13:59 +0000 (22:13 +0200)]
Use Guava's UnmodifiableIterator
It saves a bit of code, so let's use to get the code reduction.
Change-Id: I8b515539bd40ee5f684489a4bff8d96534bf82be
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Thu, 3 Sep 2015 23:03:12 +0000 (01:03 +0200)]
Use NodeIdentifier.create() in yang-data-util
NodeIdentifiers coming from context nodes should reuse the same
instance, saving lookup and compare costs.
Change-Id: Idb3e342dad372a57224cf11942dad5c56e7820a2
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Thu, 3 Sep 2015 23:01:40 +0000 (01:01 +0200)]
Use NodeIdentifier.create() in Schema-enabled NormalizedNodes
This patch prevents duplicate NodeIdentifiers from appearing in from
code paths which have a SchemaNode available.
Change-Id: I976a9f0dc830ee8f14678c03e71aab9eebf230b5
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Thu, 3 Sep 2015 22:59:24 +0000 (00:59 +0200)]
Use NodeIdentifier.create() in JSON codec
This patch uses a shared NodeIdentifier instance for nodes coming in
from JSON. The lookup cost is offset by memory savings coming from not
having duplicate identifiers.
Change-Id: I6478d55b9e3076c0a78fad121a232efb8678b187
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Thu, 3 Sep 2015 16:21:55 +0000 (18:21 +0200)]
Introduce NodeIdentifier.create()
The number of possible NodeIdentifier objects for a particular
SchemaContext is bound by the number of leaves it contains. This means
we can reuse the same objects for the same input QName.
Change-Id: I700f0c45a5e93dd5a3a7e1270cf9ad5a99d363a4
Signed-off-by: Robert Varga <rovarga@cisco.com>
Peter Kajsa [Thu, 20 Aug 2015 10:51:25 +0000 (12:51 +0200)]
Bug 3670 (part 3/5): Use of new statement parser in yang-maven-plugin
(original header: Yangtools changes-fixes necessary for parser switch in Controller)
Parser fixes:
- bug4136 fix
- enhanced javadoc comments
- mapped effective build implementation and test
- Module source and sourcePath implementation and test
- EffectiveSchemaContext IdentifierToSources implementation and test
- EffectiveSchemaContext resolveSchemaContext from modules implementation
- Bug3799 test
- Antlr4 identifier vs. string fix
sal-dom-broker fix
- QName parsing for unknown nodes
- QName prefix parsing for unknown nodes from augmentation
- uses nodes reusing
- uses nodes reusing skip on top level
- uses nodes dont copy description and reference of grouping to target node (TODO? add other not to copy)
Change-Id: Iab104439f9b03977850c4d05b9ab933382919a09
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Peter Kajsa [Thu, 20 Aug 2015 09:32:25 +0000 (11:32 +0200)]
Bug 3670 (part 2/5): Use of new statement parser in yang-maven-plugin
Parser fixes:
- Bug 1412
- AugmentToExtensionTest with new parser use fix
Change-Id: I68fc81089267d32f9c5b41d3957c7652d3f7b743
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Peter Kajsa [Thu, 20 Aug 2015 09:21:38 +0000 (11:21 +0200)]
Bug 3670 (part 1/5): Use of new statement parser in yang-maven-plugin
Parser fixes:
- error message fix
- SchemaContextUtilTest fix
- module source path fix
- module source prep.
- import of multiple revision module without revision specifying fix
- minor fixes of BaseStatementImpl class
- adjustment of decimal64 type to original yang parser behavior
- restrictions to leaf return type fix
- range constraints in decimal64 typedef fix
- xpath validation bug fix
- case short hand augmenting fix
- augment order fix
- module dependency sort in effective schema context fix
- get original statement context fix
- statement context copy type fix
- unknown statements QName resolution fix
- extension definition fix in test models
- moduleImport default revision replace
- default revision fix
- sourcePath resolved correctly via NamedFileInputStream
Change-Id: I54656ff50f681bb1357f7df4e606af3c925341eb
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Robert Varga [Thu, 27 Aug 2015 17:17:57 +0000 (19:17 +0200)]
Make YangInstanceIdentifier implement Cloneable
YangInstanceIdentifier should not be cloned, but this may prove useful
some day.
Change-Id: Ice20b45925a1a8e777938a9de98c70f380e7893a
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Thu, 27 Aug 2015 17:22:49 +0000 (19:22 +0200)]
Move YangInstanceIdentifier.Builder
The inline interface definition is in a visually-wrong place. Reader
walking through YangInstanceIdentifier is expecting PathArgument
subclasses after AbstractPathArgument. Move the entire block to the end
of the class.
Change-Id: I6a34f2c1b5b5697be64587271a809cff161997fa
Signed-off-by: Robert Varga <rovarga@cisco.com>
Debalina Ghosh [Fri, 1 May 2015 22:09:59 +0000 (15:09 -0700)]
Reducing cylomatic complexity of BuildGlobalContext
Change-Id: Ife037a6681a9934c321f90dc5b54f47ce06cd899
Signed-off-by: Debalina Ghosh <debalina.ghosh@hp.com>
Robert Varga [Sat, 29 Aug 2015 09:02:52 +0000 (11:02 +0200)]
BUG-4158: ImmutableOffsetMap should not be Cloneable
Removes Cloneable from ImmutableOffsetMap, as it serves no real purpose.
Also improve test coverage.
Change-Id: I381fd5a796f132fa3620559e7159bd25bf6447b5
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Thu, 27 Aug 2015 17:51:50 +0000 (19:51 +0200)]
Use ImmutableOffsetMap for NodeWithKey entries
Number of elements allowed in NodeWithKey equals to the number of leaf
nodes specified in the 'key' statement. It is usually a small number of
elements, but these tend to have many instances.
This patch optimizes memory usage with more than one key leaf. Instead
of an ImmutableMap, in which each instance has its own unique key set,
we use an ImmutableOffsetMap, which shares the key set across all
instances. The cost here is a LoadingCache lookup which should prove
neglible.
Change-Id: I68afe667415ba1eaddbb081b419fedcae4e4b8f7
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sat, 22 Aug 2015 22:36:51 +0000 (00:36 +0200)]
BUG-4158: optimize ImmutableOffsetMap
This patch providers optimized equals() for both version of OffsetMap.
It also implements an optimized version of MutableOffsetMap.keySet(),
which does not require SimpleEntry instantiation.
Change-Id: I6a65680bbcc7ad37f251431e495cde48f23efb22
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Tue, 25 Aug 2015 09:06:56 +0000 (11:06 +0200)]
BUG-4158: use ImmutableOffsetMap
In order to improve memory efficiency of maps holding children of
container nodes, use ImmutableOffsetMap instead of wrapping constructed
children.
Change-Id: Ib11b8d5adc4d5509ecbbba59348638f78fc2e62b
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Tue, 25 Aug 2015 08:18:13 +0000 (10:18 +0200)]
BUG-4158: Introduce Modifiable/UnmodifiableMapPhase
Our code frequently uses an access pattern, where we create a modifiable
map, then turn it into an unmodifiable one and then we want to create a
modifiable map containing all the mappings in the unmodifiable one (and
then turn it again into unodifiable).
This patch introduces interfaces which mark the modifiable/unmodifiable
phases of such mapping. They also define the interface contract
implementation must follow to be usable with this usabe pattern.
Change-Id: I08b3077739a3df89e57c54a6937744f2394701bc
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sat, 22 Aug 2015 22:36:51 +0000 (00:36 +0200)]
BUG-4158: introduce ImmutableOffsetMap
ImmutableOffsetMap stores its children in an array and shares the
key-to-offset map with other instances. In order to facilitate the
modification cycle, there is also a MutableOffsetMap, which uses a
LinkedHashMap to record any additions.
The conversion between the two reuses the backing array as much as
possible, to make transitions between modification cycles when no
structural modification occurs efficient.
Change-Id: I100469426c1cf741dd5545c5d11fd29aa3e4ab8b
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sat, 22 Aug 2015 09:24:34 +0000 (11:24 +0200)]
Switch to using MoreObjects
Guava's Objects is deprecated with Java 7, move to using MoreObjects.
Change-Id: I84078b7990219ef31d22f1bd8e49e2455699721a
Signed-off-by: Robert Varga <rovarga@cisco.com>
Tony Tkacik [Wed, 26 Aug 2015 10:00:29 +0000 (12:00 +0200)]
Splitted out incorrectly grouped features.
Change-Id: I66cbe5aa472479220870daefeee65dd62b48c506
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Martin Ciglan [Fri, 21 Aug 2015 12:48:34 +0000 (14:48 +0200)]
Bug 3859: Use of reference keyword in a YANG extension
causes YangSyntaxErrorException
Once reference or any other yang statement is defined within use of
extension (unknown statement), this should be correctly parsed
as another unknown statement. This behavior has been
added to RFC6020 ANTLR grammar and tested.
Change-Id: I3eed81e67ba6192e2c98154e7e6800215b1cc4bf
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
(cherry picked from commit
e8a7058112bacbafada62cb71fef8207506d38d5)
Robert Varga [Sat, 22 Aug 2015 00:41:29 +0000 (02:41 +0200)]
Introduce CloneableMap
This is generalization of CloneableChildrenMap and will supersede it.
Change-Id: Ie6cbe039510be5734d81fca7e50ed7b4d6e06a07
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sun, 23 Aug 2015 00:12:18 +0000 (02:12 +0200)]
Import YangInstanceIdentifier inner classes
Instead of specifying YangInstanceIdentifier.NodeIdentifier, import it
directly for brewity.
Change-Id: I106557f5f9757bd66975ee74b30f00233b45a01d
Signed-off-by: Robert Varga <rovarga@cisco.com>
Thanh Ha [Thu, 13 Aug 2015 16:55:33 +0000 (12:55 -0400)]
Use odlparent version for maven-plugin-plugin
This pulls the version from <pluginManagement> section in odlparent.
Change-Id: I468fb3c084ed50d797e641c4b05c7a219ec9048f
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Robert Varga [Sat, 22 Aug 2015 09:26:11 +0000 (11:26 +0200)]
Remove unnecessary cast
We already have CursorAwareDataTreeModification, no need to perform a
cast.
Change-Id: I005f32db4f22069ed10fd1d5692a7aad0baf0fd4
Signed-off-by: Robert Varga <rovarga@cisco.com>
Tony Tkacik [Fri, 21 Aug 2015 09:26:45 +0000 (11:26 +0200)]
Removed unused interface and dependency.
Change-Id: I8cdd07c16af497d1950d9197479d5a5ff19f2389
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Thanh Ha [Wed, 22 Jul 2015 19:32:48 +0000 (15:32 -0400)]
Explicitly set git-review branch to master
Change-Id: Ideb0097000c0aea29536617781b5d745a98207e1
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Thanh Ha [Thu, 6 Aug 2015 02:55:40 +0000 (22:55 -0400)]
Fix license header violations in yang-data-api
Change-Id: I7daf6904caa9663c66190ae730050de654217ebd
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Thanh Ha [Thu, 6 Aug 2015 03:43:21 +0000 (23:43 -0400)]
Fix license header violations in yang-model-export
Change-Id: I14acb8a5c0adb44046346683938bb0d2464067ab
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Thanh Ha [Thu, 6 Aug 2015 03:36:22 +0000 (23:36 -0400)]
Fix license header violations in restconf-client-impl
Change-Id: Ia1f38a95328550612e307d06b607faee57ae654c
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Thanh Ha [Thu, 6 Aug 2015 03:33:16 +0000 (23:33 -0400)]
Fix license header violations in restconf-client-api
Change-Id: I9acb695fd38f9f8230895e476218ecc698a9dfa1
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Thanh Ha [Thu, 6 Aug 2015 03:30:20 +0000 (23:30 -0400)]
Fix license header violations in yang-data-codec-gson
Change-Id: Ia5f799e64b213f20230c2eb03ad572a1c51bd092
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Thanh Ha [Thu, 6 Aug 2015 03:27:37 +0000 (23:27 -0400)]
Fix license header violations in yang-data-operations
Change-Id: I75d74620e58a2041dc3b48ba68c9794cc4d1bec9
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Thanh Ha [Thu, 6 Aug 2015 03:24:47 +0000 (23:24 -0400)]
Fix license header violations in binding-data-codec
Change-Id: I797ac93efabe9eea6d2ae161ec39f3028ca78807
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Thanh Ha [Thu, 6 Aug 2015 03:19:46 +0000 (23:19 -0400)]
Fix license header violations in binding-generator-impl
Change-Id: If155761c145d7b6db8c4378343733a7be256ba98
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Thanh Ha [Thu, 6 Aug 2015 03:11:52 +0000 (23:11 -0400)]
Fix license header violations in binding-type-provider
Change-Id: Ib00d5625f834a9de12d10f8c3d9cbaaa7e70eb05
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Thanh Ha [Thu, 6 Aug 2015 03:10:36 +0000 (23:10 -0400)]
Fix license header violations in yang-data-impl
Change-Id: I14aecd28c5b0ea1fd2f5248947e47e9131492624
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Thanh Ha [Thu, 6 Aug 2015 02:39:13 +0000 (22:39 -0400)]
Fix license header violations in yang-parser-impl
Change-Id: Id23afe407505b79ae35eb5f4cf10e08374881d92
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Thanh Ha [Thu, 6 Aug 2015 02:24:07 +0000 (22:24 -0400)]
Fix license header violations in yang-model-util
Change-Id: I2c5a0c5baf5646563f8da3b44ca493141a8ea519
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Thanh Ha [Thu, 6 Aug 2015 02:26:54 +0000 (22:26 -0400)]
Fix license header violations in yang-parser-api
Change-Id: I0133243f4ac4239f97c00dca87c9177b8f82ac7a
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Thanh Ha [Thu, 6 Aug 2015 02:26:40 +0000 (22:26 -0400)]
Fix license header violations in yang-model-api
Change-Id: I998b424fe937ed776ddab2119f41b398129308fa
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Thanh Ha [Thu, 6 Aug 2015 02:26:18 +0000 (22:26 -0400)]
Fix license header violations in yang-common
Change-Id: I30af43e2770a0eac1906e417c818f9cd5ce6851b
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Thanh Ha [Thu, 6 Aug 2015 02:26:03 +0000 (22:26 -0400)]
Fix license header violations in yang-binding
Change-Id: I3c3fcd27c50ef3aa3c79ddaccddf8dfcf8bad4d8
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Thanh Ha [Thu, 6 Aug 2015 02:25:25 +0000 (22:25 -0400)]
Fix license header violations in common/util
Change-Id: I4d26740f5a29b65f522cc1e779d8dfc226dd986a
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Peter Kajsa [Mon, 13 Jul 2015 12:51:21 +0000 (14:51 +0200)]
Bug 2366 - Effective statments impl merge, retest & bugfix
- rebase
- integrated changes from https://git.opendaylight.org/gerrit/#/c/21310
- added some JavaDoc, minor fixes in null checking, unneeded code, refactoring etc.
- minor fixes in hashCode(), equals(), getters etc.
- list key relative path fix
- list keys resolution fix
- multiple modules and revisions fix
- rebase on master
- instance identifier type build fix
- bug2649 test
- re-sync of retest with old impl folder (old parser vs. new parser)
- buildType qname fix
- non YANG statement detection implemented
- uses-augment module qname fix
- uses-augment is augmenting fix
- type constraints parsing and validation fix
- Unique statement support added
- identityRef validation simplification
- typedef base type QName resolution fix
- parse with context fix
- typedef order unit test fix
- invalid string patterns parsing fix
- refine unknown statements fix
- union types order fix
- typedef in grouping fix
- identityRef null identity fix
- pick latest revision even when not reverse chronologicaly ordered in module fix
- clean up of SourceSpecificContext & YangStatementParserListenerImpl classes, rebased on master
- types, extended types and type definitions impl and bugfix
- declared types resolution
- statementSourceReference support implemented
- basicType impl proposal
- typeDefEffStmt impl as builder of ExtendedType
- few decl. types resolution fixes done
- identityRefs validation implemented
- fixed tests dealing with unknown stmts
- uses getRefine fix
- load with context retest
- ordering of statements and substatements fix
- augment into unknown statement body fix
- uses or augment in unknown statement body fix
- extension identifier correctly passed to unknown statement for effective resolution phase
- substatements of included submodules appendation fix
- node name collision validation
- refine target validation
- added statement copy type by both Augment and Uses (when augmenting in uses statement)
- some of negative scenarios (arguments/statements validation) fix
- fix of module imports, revision
- augmentation namespace and revision initialization fix
- available augmentation impl fix
- Case shorthand schema path fix
- Case shorthand fix
- Unsupported augment targets fix
- Multiple augments to the same target - reactor fix
- StackOverflowException on cyclic identity hierarchy fix
- include vs. belongsTo linkage resolution fix
- introduces replacement of old YANG parser by new statement parser in
set of existing tests
- some test methods adjusted for new parser data structure
- Types & TypeDefs support & resolution implemented
- BelongsTo namespace added to be able to resolve typedefs from parent
modules - Identity, IdentityRef support & resolution preparation
- Minor sonar issues fixed
- Effective statements related to types implemented
Bug 2366 - Effective statements implementation (2nd patch)
- added further implementation of Module and Submodule Effective statements and
initialization of submodules collection in Module effective statement
- implementation of uses-refine
- implementation of Constraints, etc...
- effective statement fields initialization
- added unit tests
- fix of some issues in the parser (ModuleQName default revision date,
Generics, etc..)
Bug 2366 - Identity, Refine, ... effective statements impl. (3th patch)
- implementation of Identity effective statement
- implementation of Refine effective statement
- initialization of some unitialized effective statments fields
- augmentation process fix
- unit tests
Change-Id: I95cda640136c966bd1b1fd3b0bcb1e143675eac1
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
Signed-off-by: Gregor Zatko <gzatko@cisco.com>
Debalina Ghosh [Tue, 5 May 2015 22:33:00 +0000 (15:33 -0700)]
Removing duplicate literal
Change-Id: Ibc2ebe54aedcc8b7ca6f4c2074fd2af8e8cc83b6
Signed-off-by: Debalina Ghosh <debalina.ghosh@hp.com>
Robert Varga [Fri, 5 Jun 2015 21:20:55 +0000 (23:20 +0200)]
BUG-1485: remove deprecated range methods
This Be-cycle patch removes the methods which have been removed in
Lithium, improving class size and not leaking the enforcement details.
Change-Id: I629df675eecac10c0aad1ed212123dca0f6d81d8
Signed-off-by: Robert Varga <rovarga@cisco.com>
Tony Tkacik [Wed, 8 Jul 2015 11:23:00 +0000 (13:23 +0200)]
Bug 2882: Fix off-by-one usage of cursor.
DataTreeCandidates#applyToModification
when dealing with cursor-aware transaction
entered writen / element twice - once with enter
and once with write which resulted in exception.
Change-Id: Ifd4023c7ad54f2be1672c42725dd37f4e3ff8282
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Robert Varga [Wed, 17 Jun 2015 07:59:30 +0000 (09:59 +0200)]
Introduce isMixin()
Instead of using a marker interface, expose an explicit method.
Change-Id: I59ea238634fecfee7acc745700850c84fc7ca348
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit
ecb5cc29ccac889a79c0c1fbaeac0d8e7bddf7ff)
Robert Varga [Wed, 17 Jun 2015 11:40:58 +0000 (13:40 +0200)]
BUG-2882: implement DataTreeModificationCursor
This patch makes InMemoryDataTree's snapshots and modifications
implement CursorAware, allowing more efficient traversal.
Change-Id: I279fd6b7d2e14fdfa1827c500a6d323a53207ab5
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit
3eed7efd259a1285df1d9206a65579b2171a4007)
Robert Varga [Tue, 16 Jun 2015 23:08:50 +0000 (01:08 +0200)]
Allow instantiation of rooted DataTrees
We are not restricted to instantiation of data trees only at the root,
but can also bind them to a particular SchemaPath. Accessing such a data
tree uses relative instance identifiers, thus increasing performance.
Change-Id: I065d224e851c723d775f2b5711f818747592fc74
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit
6aced154f28787c22cf002e2faba4b5535695026)
Robert Varga [Tue, 16 Jun 2015 09:12:03 +0000 (11:12 +0200)]
Enforce sealed DataTreeModification
DataTree needs to enforce the modification being sealed before
validation or preparation can proceed.
Change-Id: If0f26002f393f6cae469d755076da283c06c89f0
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit
369acc82f1d32abae66a80c1479aa04b07d336a1)
Tony Tkacik [Wed, 29 Apr 2015 09:25:26 +0000 (11:25 +0200)]
Fixed sonar issues in o.o.y.util package.
Change-Id: I577d3b3795340c33e2407bbecd821e5f1ff6cae7
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Tom Pantelis [Sat, 20 Jun 2015 09:20:07 +0000 (05:20 -0400)]
Fix bug in ImmutableMapEntryNodeBuilder
In ImmutableMapEntryNodeBuilder#build, for the call to
getChild(childrenQNamesToPaths.get(key.getValue()));
it should use key.getKey(). As a result, key childs nodes are never
found and thus user-provided nodes are always replaced.
NOTE: https://git.opendaylight.org/gerrit/#/c/23044/ should be merged
first to avoid unit test failure in the controller project.
Change-Id: I736756ce8fc3e15a05641565f2f505a2db32e9fc
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
(cherry picked from commit
f965264bb05b1dc5dc921eb1f8e80461e6a1cbb9)