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>
Robert Varga [Mon, 30 May 2016 09:06:08 +0000 (11:06 +0200)]
Speed up toString() for XML elements
Instantiating TransformerFactories is wasteful, use a shared instance.
Change-Id: I595df4553b617875abdb78ba08401fa84ba156bc
Signed-off-by: Robert Varga <rovarga@cisco.com>
Michael Vorburger [Wed, 25 May 2016 09:51:31 +0000 (11:51 +0200)]
Fix @Deprecated checkstyle.api.Check to new AbstractCheck
Change-Id: I8f1ae86a3463f18ba422d5d889c86688a3cff042
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Michael Vorburger [Fri, 27 May 2016 09:53:55 +0000 (11:53 +0200)]
.gitignore .factorypath created by m2e-apt
https://github.com/vorburger/opendaylight-eclipse-setup now bundles
https://github.com/jbosstools/m2e-apt, which creates .factorypath files
all over the place.
Change-Id: Ia6b50206547dda2ad95703e584c9cd40b250aab8
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Michael Vorburger [Wed, 25 May 2016 09:46:40 +0000 (11:46 +0200)]
Minor inline code comment to clarify TestClass has intentional CS issues
Change-Id: I96133746447dd909cb55b45cbe4dfdca278b1bde
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Michael Vorburger [Wed, 25 May 2016 09:48:58 +0000 (11:48 +0200)]
Conform to our own Checkstyle rules in checkstyle-logging utility
This seems like a sensible start, to make even our own Checkstyle custom
rules code conform to our other Checkstyle rules? ;-)
Change-Id: I746aba394590e3bf6df873be10ac6e4e87e6ea87
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Peter Kajsa [Thu, 5 May 2016 15:24:26 +0000 (17:24 +0200)]
Bug 5200: Yang parser doesn't fill error-app-tag and error-message in constraints
Length, Pattern, Range statements may contain error-app-tag and error-message
substatements, but yang parser does not fill them correctly when corresponding
constraint objects are created. Instead yang parser always constructs constant formatted
message.
Change-Id: I69edb1fa49bcd50098f247df851c839c2f871782
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Igor Foltin [Tue, 24 May 2016 11:51:22 +0000 (13:51 +0200)]
BUG-5917: validate TransformerFactory
Karaf-3.0.6 ships with Xalan as the default javax.xml.transform implementation.
Unfortunately it does not support StAXResult as the target of transformation,
rendering the writer useless.
Add a fallback to JVM-internal implementation if we detect that the default
factory cannot support StAXResult
Change-Id: I7151b0df8068c85ca53a85edd4894ac1ba70eece
Signed-off-by: Robert Varga <rovarga@cisco.com>
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Tomas Cere [Fri, 13 May 2016 15:43:22 +0000 (17:43 +0200)]
Add application of RootedDataTreeCandidates
Allows applications of DataTreeCandidates that are rooted in one
DataTree to another DataTree(comes in handy with sharded datastore
when building notifications)
Change-Id: I78ad88aed4453924c1594c7e8e47ffddd71c6282
Signed-off-by: Tomas Cere <tcere@cisco.com>
Igor Foltin [Fri, 13 May 2016 09:42:06 +0000 (11:42 +0200)]
Bug 4506: Honor if-feature during SchemaContext assembly
If-feature statements in yang modules are now resolved
during SchemaContext assembly based on
a java.util.function.Predicate<QName> provided by user.
This functionality is also introduced into SchemaContextFactory
Change-Id: I2a74e36c9433a0b89c97c19407c988b538c236bc
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Igor Foltin [Fri, 20 May 2016 10:11:14 +0000 (12:11 +0200)]
Bug 5917: master fails mounting controller-config
Set TransformerFactory in XmlStreamNormalizedNodeStreamWriter
to use the implementation from this package:
com.sun.org.apache.xalan.internal.xsltc.trax
Change-Id: Ie98c50c34ad6e8e7605188d67bd8e1942b0a7c85
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
Filip Gregor [Thu, 19 May 2016 11:54:45 +0000 (13:54 +0200)]
Bug 5899: Cardinality check incorrectly limited to 1 for "must"
updated cardinality for must statement in
refine statement, added test
Change-Id: I3c31cc902d05a87259970a856a8f0e7efc20c67c
Signed-off-by: Filip Gregor <fgregor@cisco.com>
Michael Vorburger [Tue, 10 May 2016 22:13:29 +0000 (00:13 +0200)]
Bumping Apache Maven dependencies from 3.3.3 to 3.3.9
Just on the off chance that this fixes a class loader issue with yangide
seen in Bug 5863 (highly unlikely, but upgrade still seems like a good
idea anyway)
Change-Id: Idc0caf298cbd51d4b0ae37f72080aed447f9816f
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Robert Varga [Fri, 13 May 2016 08:11:59 +0000 (10:11 +0200)]
Address minor sonar issues in ImmutableOffsetMap
Reorder keywords and rename a temporary variable.
Change-Id: I41594bb9fa9cb265e80ab86e0a11e0c049b4cda0
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 2 May 2016 09:34:13 +0000 (11:34 +0200)]
Clean up generic type arguments
Downgrade arguments to ?, so as to eliminate warning from the forced upcast
to Object.
Change-Id: Ie861f25534339d42e01dee1ea726bb126e1a3c57
Signed-off-by: Robert Varga <rovarga@cisco.com>
Michael Vorburger [Thu, 28 Apr 2016 23:52:40 +0000 (01:52 +0200)]
Bump Checkstyle version from 6.2 to 6.16
made required code changes in CheckLoggingUtil & CheckstyleTest
Change-Id: I59da3d9c09b1a22a1f8266a2c6875ba10fc881e9
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Peter Kajsa [Wed, 30 Mar 2016 09:23:29 +0000 (11:23 +0200)]
Bug 4662: Introduce a SemanticVersion concept - pre-linkage phase
Added pre-linkage phase to yang statement parser which collects
available module names and namespaces. The phase is necessary in
order to correct resolution of unknown statements used in subsequent
linkage phase (e.g. semantic version of yang modules).
Change-Id: I20e16f3bff1bedcf6cef48a25adafa6e225badeb
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Michael Vorburger [Thu, 28 Apr 2016 23:52:40 +0000 (01:52 +0200)]
Checkstyle dependency to runtime version instead of Maven plugin
Change-Id: Ica9df2305eccfc055641455d40b56f2838fde5b3
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Peter Kajsa [Wed, 11 May 2016 09:04:39 +0000 (11:04 +0200)]
Bug 5446: Yangtools UnionStringCodec is not consistent with BinaryStringCodec
Yangtools union codec serializes byte array via invoking of toString() method
on byte[] which leads to undesirable results.
Change-Id: Ib5c8efb1b28cf7f8e51d9791dd4a30078ebbd6bd
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
Michael Vorburger [Wed, 11 May 2016 11:08:35 +0000 (13:08 +0200)]
Refactor currentThread into local variable
Not that this would fix anything, as Thread.currentThread() shouldn't
change here (or could it?), so consider this more of a "readability"
proposal.
Change-Id: I70ef77f4d2b6e34440168456c0638be6c7045f79
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Alexis de Talhouët [Wed, 11 May 2016 16:12:58 +0000 (12:12 -0400)]
Revert "Bug 5829 - New yang parser allows two choice cases with identical child elements"
This reverts commit
e37952ec2815c2619592b1c8108a05e03fa32978.
Change-Id: Id39c673375ffa585ceb90a0946699b83b10b5573
Signed-off-by: Alexis de Talhouët <adetalhouet@inocybe.com>
Robert Varga [Wed, 11 May 2016 12:50:43 +0000 (12:50 +0000)]
Revert "Bug 5829 - New yang parser allows two choice cases with identical child elements"
This reverts commit
e37952ec2815c2619592b1c8108a05e03fa32978,
because it breaks config yangs.
Change-Id: I70034b9d99590350336169c0608793ae876dcfb5
Signed-off-by: Robert Varga <nite@hq.sk>
Igor Foltin [Wed, 11 May 2016 11:26:50 +0000 (13:26 +0200)]
Unit test post-clean-up fix
Moved unit tests Bug5712Test and Bug5829Test
to package org.opendaylight.yangtools.yang.stmt.
Change-Id: I2677c6c8f327428ebd1544a51aecaf0eb095c653
Signed-off-by: Igor Foltin <ifoltin@cisco.com>