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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Igor Foltin [Tue, 21 Jun 2016 10:05:44 +0000 (12:05 +0200)]
Implement method anyxmlNode in ImmutableNormalizedNodeStreamWriter
- implemented method anyxmlNode
- set method write in AnyXmlNodeDataWithSchema to use anyxmlNode method
Change-Id: Ic98d9862e406063e38a8fca2b55999e53ad36ba6
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Ryan Goulding [Thu, 2 Jun 2016 17:57:23 +0000 (13:57 -0400)]
Bug 2872 - Generated Java Enumerations should contain mapping to the string counter part
The definition of EnumEffectiveStatementImpl.getName() was changed to return
the "raw" name attribute from the input yang file. The mapping is moved to
mdsal through a corresponding change:
https://git.opendaylight.org/gerrit/#/c/39734/
A test is added to ensure that the name attribute is provided in its raw,
unadulterated context.
Change-Id: I2f2690251f21b9a3f8f4960f2f8c2ab1cdce6321
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
Robert Varga [Wed, 1 Jun 2016 14:16:18 +0000 (16:16 +0200)]
Further cleanups of code
Unneeded imports, static methods, missing generics.
Change-Id: Ib3fd8282d69067c11fefbc557b4c72c3700f4e63
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Wed, 1 Jun 2016 10:29:14 +0000 (12:29 +0200)]
BUG-865: Remove users of SchemaAwareNormalizedNodeStreamWriter
This is a cleanup of users inside yangtools. This patch should
be merged only after all users of deprecated methods have been
migrated.
Change-Id: Ic659214d84598d1d03dcc9c281352d72caf3cb2e
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 6 Jun 2016 13:24:40 +0000 (15:24 +0200)]
Remove {String,UUID}Identifier
These do not provide proper identity, as differing users
will end up creating same identifiers. Use their abstract
counterparts to properly split the namespace.
Change-Id: I6b4c063519cee969e11b5c29ab798eeeb1982435
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 6 Jun 2016 15:44:02 +0000 (17:44 +0200)]
BUG-865: remove pre-Beryllium parser
This parser and implementation elements have been deprecated
in Beryllium. We do not have any in-tree users anymore, remove
them.
Change-Id: I3c04db2b93423596b9815656adf8ca051868e830
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Thu, 9 Jun 2016 09:20:37 +0000 (11:20 +0200)]
Do not pass nulls to Interner
The contract of LeafInterner has changed to not allow nulls
as per Guava interner. LeafNodeBaseParser assumed it is okay
to pass through nulls, which is not accurate. Add checks to
short-circuit nulls and not trigger NPEs.
Change-Id: Ib1bdbfb3c04b3f60b43497bd6fef9c1946b7e4a2
Signed-off-by: Jakub Morvay <jmorvay@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Wed, 1 Jun 2016 13:43:59 +0000 (15:43 +0200)]
Remove unused imports
This patch organizes imports, removing unused ones.
Change-Id: I48a508554df9de2fcc4438722572b962747a4bb9
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Tue, 7 Jun 2016 08:30:29 +0000 (10:30 +0200)]
Fix missing type arguments
This fixes a few warnings regarding raw types.
Change-Id: I7d12760dcd3113157837e4cbddadca0e385da855
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 6 Jun 2016 21:43:45 +0000 (23:43 +0200)]
Add WritableObjects.writeLongs()
Utility method to output two longs (128bits) in 1-17 bytes. Saves
one byte over two WritableObjects.writeLong()s.
Change-Id: I4370c9aaa09d06191f96056605333fda0f92d84b
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 6 Jun 2016 15:49:38 +0000 (17:49 +0200)]
Remove dead code
Change-Id: I84130e779a93f14e909b9ab8470a8e300f3b7aee
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Thu, 26 May 2016 09:14:17 +0000 (11:14 +0200)]
Make LeafInterner a utility class
We can use lambdas to efficiently return Interner instances without
having to rely on weird casts.
Change-Id: I4a9bdf4869c437d151e7f3e36118357b81c9413b
Signed-off-by: Robert Varga <rovarga@cisco.com>
Abbas Pareedkunju [Tue, 7 Jun 2016 10:14:01 +0000 (15:44 +0530)]
Bug 6016: Corrected the error message for typo
This patch is submitted to correct the error message typo; "erlier" was mentioned instead of "earlier" in error message.
Change-Id: I20b35946690d057fe159df3c9aeab1fcea32674d
Signed-off-by: Abbas Pareedkunju <abbas.pareedkunju@tcs.com>
Peter Kajsa [Fri, 20 May 2016 07:46:37 +0000 (09:46 +0200)]
Bug 5830: Mandatory leaf enforcement is not correct with presence container
Some operations (e.g. write of MapEnryNode) don't invoke any method on
PresenceContainerModificationStrategy in order to enforce presence of mandatory nodes.
This fix ensures invoking of MandatoryLeafEnforcer of PresenceContainerModificationStrategy
when verifyStructure method is performed.
Change-Id: I6f5900f555e8f94916a84b747fbd895592606f38
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
Peter Kajsa [Thu, 14 Apr 2016 09:28:29 +0000 (11:28 +0200)]
Bug 4662: Introduce a SemanticVersion concept - SchemaContextFactory
Introducing of semantic version concept into SchemaContextFactory.
Change-Id: I382d6d6107852cd39a8e4023bbf2ae4d079782c7
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Robert Varga [Wed, 1 Jun 2016 10:42:48 +0000 (12:42 +0200)]
BUG-865: integrate SchemaAwareNormalizedNodeStreamWriter
DataSchemaNodeAware can be cleanly integrated into NormalizedNodeStreamWriter
using default method implementation. Do that, deprecating the wiring.
Once users are removed in downstream projects, these interfaces can be removed.
Change-Id: Icf8d11ba2ee73d6914485f39b0f2c309ff35acc0
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 6 Jun 2016 11:01:24 +0000 (13:01 +0200)]
Fix third-party aggregator groupId
Inherited odlparent wreaks havok, fix that.
Change-Id: I39d36bdea3daf3024d0fb1001ac3e97f69bd47fe
Signed-off-by: Robert Varga <rovarga@cisco.com>
Michael Vorburger [Fri, 13 May 2016 15:20:44 +0000 (17:20 +0200)]
Remove @Deprecated CompositeObjectRegistration
Not sure what ODL policy is re. clean up of deprecated classes, so I'm
proposing to killing one, and see what happens... ;-)
https://twitter.com/drdeprecator
If this must be kept, then I'll fix the catch (Exception e)
e.printStackTrace() in it, with LOGGER, because this is the only
critical issue yangtools has on Sonar.
Change-Id: Ice796b5cae5ce54df88e3227f9ec045e115c921b
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Robert Varga [Thu, 2 Jun 2016 00:21:01 +0000 (02:21 +0200)]
Deprecate {String,UUID}Identifier
These identifiers are easigy mixed up if we do not allow for subclassing. Deprecate
the classes and provide their abstract equivalents. This allows for specific subclasses
which do not produce clashes.
Change-Id: I7a23a3e1180ee2bbfbc9997bec3ffee9c0db297f
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Wed, 1 Jun 2016 23:54:36 +0000 (01:54 +0200)]
Annotate Identifier with @ThreadSafe
Implementations are expected to be used for maps, hence they are expected
to be used from multiple threads concurrently.
Change-Id: I7578486cc8be843959befb4473461dcd601e904b
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Wed, 1 Jun 2016 09:34:54 +0000 (11:34 +0200)]
Introduce WritableObject/WritableIdentifier
When serializing nested Identifiers, it is sometimes useful
to be able to skip the object header in the stream. This patch
introduces WritableObject interface and WritableIdentifier
as the unification of WritableObject and WritableIdentifier.
It furthermore adds utilities to write long values if a format
which uses minimum number of bytes.
Change-Id: I8459e2883b4ab3dff113000cea43a452eacd3324
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Fri, 20 May 2016 12:20:18 +0000 (14:20 +0200)]
BUG-5410: turn Token types into proper constants
This changes the syntax to ensure tokens are initialized
as constants.
Change-Id: I2bcac83c813695444cead29afd172985072f926b
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Fri, 20 May 2016 10:32:09 +0000 (12:32 +0200)]
BUG-5410: bring the imported source code to Java 7 world
This patch adds generic type arguments to Stack and Hashtable. The
bulk of the patch are Eclipse auto-save actions, performing the following:
- remove unneeded casts
- remove trailing whitespace
- add @Override annotations
- add curly braces around ifs
Change-Id: I118d5559cb5a5edb9a79e097903732911987afe9
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Fri, 20 May 2016 09:38:10 +0000 (11:38 +0200)]
BUG-5410: initial import of Xerces RegularExpression
This is a minimal code drop of XSD regular expression implementation
from Xerces-J, subversion commit
1744677.
In order to prevent classpath clashes, the code is imported as
org.opendaylight.yangtools.xsd.regex. We do not import
org.apache.xerces.util.IntStack and use a Stack<Integer> instead.
Change-Id: I3f678f274a2cd8a7c07cc11f631490b127b8323c
Signed-off-by: Robert Varga <rovarga@cisco.com>
Igor Foltin [Wed, 1 Jun 2016 06:25:40 +0000 (08:25 +0200)]
Remove usage of deprecated yang parser classes
- stop using deprecated classes related to the old yang parser
- a little bit of code clean-up
Change-Id: Iab22b89b31c4a10b62bf51e022d4dfa435f03426
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Peter Kajsa [Wed, 6 Apr 2016 09:19:27 +0000 (11:19 +0200)]
Test of multiple revisions of module
Added unit test for case when more revisions of a module are available.
Change-Id: I3079171c84ca946d5af4186b5bcdd03d04d22891
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Peter Kajsa [Wed, 30 Mar 2016 11:27:34 +0000 (13:27 +0200)]
Bug 4662: Introduce a SemanticVersion concept - import processing
Added new semantic version processing mode to yang statement parser.
If the mode is enabled, each module import is processed based on the specified
semantic version and revision date of import statement is ignored.
- fix of SemVer's compareTo method
- fix of Yin statements argument parsing
- added Yang unit tests
- added Yin unit tests
- fix of module imports resolving and module dependency sort
for cases when semantic versioning is enabled
- added StatementParserMode
- unit test fix
Change-Id: Ibf0519c3ec8fec85763e0a13059c1b8af91276ba
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Robert Varga [Thu, 2 Jun 2016 17:41:30 +0000 (19:41 +0200)]
Scripted update of if statements
These trigger checkstyle warnings, hence turn both 'if( ' and 'if('
into proper 'if ('. Same for for and while.
Change-Id: I78714d3370806cccc3f42ae9a15d4d14ba1361c3
Signed-off-by: Robert Varga <rovarga@cisco.com>
Michael Vorburger [Wed, 25 May 2016 14:17:54 +0000 (16:17 +0200)]
Remove all not directly custom Logger check related modules declarations
All of these are now in odlparent.checkstyle odl_checks.xml; see
https://git.opendaylight.org/gerrit/#/c/39416/
Change-Id: I47e11df8bacd2685f1b7d52bb4cef2e03f54460d
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Peter Kajsa [Thu, 26 May 2016 12:50:13 +0000 (14:50 +0200)]
Bug 5946: Unique statement is not exposed by the YANG parser
The YANG parser did not expose the unique constraint of list schema node.
This patch adds API definition for unique constraints exposing and provides
also its implementation in yang statement parser.
Change-Id: If844248c81651a96c13487ea5b5eacdcd80107a5
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>