mdsal.git
9 years agoMerge "BUG-979: reworked data schema nodes ordering"
Tony Tkacik [Tue, 22 Jul 2014 09:30:32 +0000 (09:30 +0000)]
Merge "BUG-979: reworked data schema nodes ordering"

9 years agoMerge "Revert "BUG-1097: implemented check for null or empty list in builder classes.""
Tony Tkacik [Mon, 21 Jul 2014 15:54:59 +0000 (15:54 +0000)]
Merge "Revert "BUG-1097: implemented check for null or empty list in builder classes.""

9 years agoRevert "BUG-1097: implemented check for null or empty list in builder classes."
Tony Tkacik [Mon, 21 Jul 2014 14:03:50 +0000 (14:03 +0000)]
Revert "BUG-1097: implemented check for null or empty list in builder classes."

This reverts commit 883ae26ee98953a5df7cc0956afa807a82d58a3a
which was breakage in Binding Specification and should not
be merged without community-wide discussion.

Change-Id: Ifda1124d974b1ce299551be80a84c45b85b4155a
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "BUG-865: get rid of InstanceIdentifier-related warnings"
Tony Tkacik [Mon, 21 Jul 2014 13:12:05 +0000 (13:12 +0000)]
Merge "BUG-865: get rid of InstanceIdentifier-related warnings"

9 years agoMerge "Bug 1329: Use original definition for searching for java class."
Martin Vitez [Mon, 21 Jul 2014 12:45:43 +0000 (12:45 +0000)]
Merge "Bug 1329: Use original definition for searching for java class."

9 years agoMerge "Bug 626 - It should be possible to create java doc"
Martin Vitez [Mon, 21 Jul 2014 09:46:04 +0000 (09:46 +0000)]
Merge "Bug 626 - It should be possible to create java doc"

9 years agoBUG-865: get rid of InstanceIdentifier-related warnings
Robert Varga [Mon, 21 Jul 2014 09:04:12 +0000 (11:04 +0200)]
BUG-865: get rid of InstanceIdentifier-related warnings

InstanceIdentifier has a few deprecated methods, which are still used
all over the place. Migrate their users to new equivalents.

Change-Id: Ifba5dbaee9e3f2a74bc084b085095712f422fb46
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBug 626 - It should be possible to create java doc
Ladislav Borak [Thu, 10 Jul 2014 12:39:45 +0000 (14:39 +0200)]
Bug 626 - It should be possible to create java doc

- added interface for documented types
- added fieldto for builders GTO and GT
- modified print method in BaseTemplate, EnumTemplate, ClassTemplate and
  and Interface template
  - fix for Bug 1001 - added description for enum constants
  - fix for Bug 1002 - changed formatting of type description

Change-Id: I5b0ea61369ff86243740d83282a2c4a3115be733
Signed-off-by: Ladislav Borak <lborak@cisco.com>
9 years agoBUG-1097: implemented check for null or empty list in builder classes.
Martin Vitez [Thu, 17 Jul 2014 14:18:00 +0000 (16:18 +0200)]
BUG-1097: implemented check for null or empty list in builder classes.

If one of builder variable is List, do following:
 - for null value create Collections.emptyList()
 - for empty list create Collections.emptyList()
 - for any other list create ImmutableList.copyOf(<arg>)

Added test.

Change-Id: I83e5aaf4f4253aa2e195c23ff5b48b04fc883052
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoMerge changes Ibfbb4deb,I96e28324
Tony Tkacik [Mon, 21 Jul 2014 08:21:35 +0000 (08:21 +0000)]
Merge changes Ibfbb4deb,I96e28324

* changes:
  BUG-1377: fixed code generation for nodes defined under grouping.
  BUG-865: removed unused utility methods from SchemaContextUtil

9 years agoMerge "BUG-1276: fixed generated union constructor"
Tony Tkacik [Mon, 21 Jul 2014 08:15:04 +0000 (08:15 +0000)]
Merge "BUG-1276: fixed generated union constructor"

9 years agoMerge "BUG-532: implemented copy constructor for generated builder classes."
Tony Tkacik [Mon, 21 Jul 2014 08:13:14 +0000 (08:13 +0000)]
Merge "BUG-532: implemented copy constructor for generated builder classes."

9 years agoMerge "BUG-1388: fixed ClassTemplate to avoid unused import of BigInteger."
Robert Varga [Fri, 18 Jul 2014 14:04:25 +0000 (14:04 +0000)]
Merge "BUG-1388: fixed ClassTemplate to avoid unused import of BigInteger."

9 years agoBindingGeneratorUtil.computeDefaultSUID() should not modify lists
Robert Varga [Fri, 18 Jul 2014 09:21:55 +0000 (11:21 +0200)]
BindingGeneratorUtil.computeDefaultSUID() should not modify lists

This prevents the utility from churning the lists passed in. Also
shares the comparator.

Change-Id: Iaded850b5b0fa98d79e4e4fdbed52175c669e8a4
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-1388: fixed ClassTemplate to avoid unused import of BigInteger.
Martin Vitez [Fri, 18 Jul 2014 08:43:36 +0000 (10:43 +0200)]
BUG-1388: fixed ClassTemplate to avoid unused import of BigInteger.

Change-Id: I88e3aa6c9456603360de2053b5a2bbeca4877aa7
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoBUG-1377: fixed code generation for nodes defined under grouping.
Martin Vitez [Thu, 17 Jul 2014 10:23:54 +0000 (12:23 +0200)]
BUG-1377: fixed code generation for nodes defined under grouping.

If node was defined in choice case which parent choice was defined in grouping,
node does not implement ChildOf interface. Fixed by adding search for parent node
also from groupings.

Added test.

Change-Id: Ibfbb4deb719804fd16cce5c091cc0969aeaf821e
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoBUG-865: removed unused utility methods from SchemaContextUtil
Martin Vitez [Thu, 17 Jul 2014 07:38:40 +0000 (09:38 +0200)]
BUG-865: removed unused utility methods from SchemaContextUtil

By using getOriginal method from DerivableSchemaNode we can avoid searching for original node from grouping. This causes
that some of utility methods from SchemaContextUtil become redundant.

Change-Id: I96e2832436331b2f454e21aedb01fb552e2e2d6e
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoTurned off codec source code generation by default.
Tony Tkacik [Thu, 17 Jul 2014 08:02:25 +0000 (10:02 +0200)]
Turned off codec source code generation by default.

Change-Id: Iad6eda63c109e3d813c704e2eda56b067c7d1688
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "Output generated codec source to files"
Tony Tkacik [Thu, 17 Jul 2014 07:17:22 +0000 (07:17 +0000)]
Merge "Output generated codec source to files"

9 years agoOutput generated codec source to files
tpantelis [Sat, 10 May 2014 16:04:46 +0000 (12:04 -0400)]
Output generated codec source to files

- Added SourceCodeGenerator helper class that holds the generated
  field/method source code until outputGeneratedSource is called to
  generate the source for the entire class and output to a file
  under generated-sources.

- Modified TransformerGenerator and JavassistUtils to use the
  SourceCodeGenerator.

- Other pom changes to eliminate Eclipse errors.

Change-Id: Id910161569835d0cf9659ddf806e21f2545c713b
Signed-off-by: tpantelis <tpanteli@brocade.com>
9 years agoBUG-979: reworked data schema nodes ordering
Martin Vitez [Wed, 9 Jul 2014 06:54:21 +0000 (08:54 +0200)]
BUG-979: reworked data schema nodes ordering

This patch changes ordering of child nodes - nodes are ordered as they are declared in
yang file (before they were sorted in alphabetical order). This ordering is applied for
schema node builders and also for schema node instances.

Change-Id: I628d40be638fc56ee3e4e1ff9c161ab1cf88ae19
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoBUG-532: implemented copy constructor for generated builder classes.
Martin Vitez [Wed, 16 Jul 2014 08:03:41 +0000 (10:03 +0200)]
BUG-532: implemented copy constructor for generated builder classes.

Added test.

Change-Id: Ic9d6b4c80b431978a624c7a0d7cd0f7f71d4bb8c
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoBUG-1270: be smart about Restrictions
Robert Varga [Tue, 15 Jul 2014 21:04:23 +0000 (23:04 +0200)]
BUG-1270: be smart about Restrictions

Restrictions are based on type definitions, which are constant. For base
types they always are. For extended types, they are usually empty.
Optimize memory usage by reusing the lists anchored in types and also by
having a singleton instance for the all-empty case.

Change-Id: Ie9773d7efb57d403a008b82716eb22d97fefb224
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-1276: fixed generated union constructor
Martin Vitez [Wed, 9 Jul 2014 14:17:59 +0000 (16:17 +0200)]
BUG-1276: fixed generated union constructor

Current generated definition of union constructor

public UnionType(Arg1 _arg1) {
  super();
  this._arg1 = _arg1;
  this._arg2 = null;
  this._value = null;
}

was incorrect and setting this._value == null was replaced with setting _value to correct value, for example:

this._value = arg1.getValue()
or
this._value = _arg1.getValue().toString().toCharArray()

Change-Id: I837e5e1fc6845937d19abcdc8e2f8d52b410d316
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoMerge "Bug 865: Fixed incorrect conversion to new APIs."
Tony Tkacik [Tue, 15 Jul 2014 11:20:38 +0000 (11:20 +0000)]
Merge "Bug 865: Fixed incorrect conversion to new APIs."

9 years agoBug 865: Fixed incorrect conversion to new APIs.
Tony Tkacik [Tue, 15 Jul 2014 10:42:37 +0000 (12:42 +0200)]
Bug 865: Fixed incorrect conversion to new APIs.

Change-Id: I585e4d9142dc261317661c4442c771db791a46de
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBug 1329: Use original definition for searching for java class.
Tony Tkacik [Mon, 14 Jul 2014 15:04:52 +0000 (17:04 +0200)]
Bug 1329: Use original definition for searching for java class.

Change-Id: I667c5370e45353626c65099c57876b2f8c60ab91
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "BUG-1347: fixed bug in generation constraints for decimal64 type."
Tony Tkacik [Tue, 15 Jul 2014 09:46:17 +0000 (09:46 +0000)]
Merge "BUG-1347: fixed bug in generation constraints for decimal64 type."

9 years agoMerge "Bug 865: Removed uses of packageNameFromModule"
Martin Vitez [Tue, 15 Jul 2014 09:37:35 +0000 (09:37 +0000)]
Merge "Bug 865: Removed uses of packageNameFromModule"

9 years agoMerge "Bug 1366: Fallback scenario for IdentityCodec to work without schema."
Martin Vitez [Tue, 15 Jul 2014 09:36:49 +0000 (09:36 +0000)]
Merge "Bug 1366: Fallback scenario for IdentityCodec to work without schema."

9 years agoMerge "API Cleanup: Moved package name computation to BindingMapping."
Martin Vitez [Tue, 15 Jul 2014 09:35:37 +0000 (09:35 +0000)]
Merge "API Cleanup: Moved package name computation to BindingMapping."

9 years agoBug 865: Removed uses of packageNameFromModule
Tony Tkacik [Tue, 15 Jul 2014 09:14:52 +0000 (11:14 +0200)]
Bug 865: Removed uses of packageNameFromModule

Change-Id: I49d16e69943777acb34ac904ce2559302d0ac39c
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBug 1366: Fallback scenario for IdentityCodec to work without schema.
Tony Tkacik [Tue, 15 Jul 2014 09:10:33 +0000 (11:10 +0200)]
Bug 1366: Fallback scenario for IdentityCodec to work without schema.

Change-Id: Ife4c3c15db1397829c5b5a46575785121bf41ed1
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoAPI Cleanup: Moved package name computation to BindingMapping.
Tony Tkacik [Tue, 15 Jul 2014 09:02:39 +0000 (11:02 +0200)]
API Cleanup: Moved package name computation to BindingMapping.

Change-Id: I8e9016c4cadd7bee36ec440b960891503b645f4a
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBUG-1347: fixed bug in generation constraints for decimal64 type.
Martin Vitez [Thu, 10 Jul 2014 13:51:32 +0000 (15:51 +0200)]
BUG-1347: fixed bug in generation constraints for decimal64 type.

Added test.

Change-Id: I52a539ea7c5ff6b36b9bc362660188f9627bff7d
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoMerge "Bug 1339: Decreased anyxml warning to debug."
Tony Tkacik [Wed, 9 Jul 2014 10:38:13 +0000 (10:38 +0000)]
Merge "Bug 1339: Decreased anyxml warning to debug."

9 years agoBug 1339: Decreased anyxml warning to debug.
Tony Tkacik [Wed, 9 Jul 2014 07:25:33 +0000 (09:25 +0200)]
Bug 1339: Decreased anyxml warning to debug.

Change-Id: I9f21f1fd181229a6b3dccd7aa7dc9c53ab4e5db0
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "BUG-1304: rework BindingGeneratorImpl from xtend to java"
Tony Tkacik [Tue, 8 Jul 2014 16:46:31 +0000 (16:46 +0000)]
Merge "BUG-1304: rework BindingGeneratorImpl from xtend to java"

9 years agoBUG-1304: rework BindingGeneratorImpl from xtend to java
Martin Vitez [Fri, 4 Jul 2014 13:22:02 +0000 (15:22 +0200)]
BUG-1304: rework BindingGeneratorImpl from xtend to java

Change-Id: Idc09bca749951fb8c075b9ffb291c2a6a362dbe2
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoMerge "Bug 560: Fixed incoherent API implementation."
Tony Tkacik [Fri, 4 Jul 2014 08:04:38 +0000 (08:04 +0000)]
Merge "Bug 560: Fixed incoherent API implementation."

9 years agoBUG-579: Remove the dependency on GeneratedTOBuilderImpl to break a package cycle.
Martin Vitez [Fri, 4 Jul 2014 07:31:01 +0000 (09:31 +0200)]
BUG-579: Remove the dependency on GeneratedTOBuilderImpl to break a package cycle.

Change-Id: Ibcdd7bcb0cdf44d5d7ef30105624bede15bcd50e
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoUse CharMatcher in packageNameForGeneratedType()
Robert Varga [Thu, 3 Jul 2014 21:43:03 +0000 (23:43 +0200)]
Use CharMatcher in packageNameForGeneratedType()

Instead of performing up to two string copies, use a single replacement
pass, taking into account two characters using a CharMatcher.

Change-Id: I305d384eff2da5d0bfb3b1b820270f4480a800a4
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoOptimize BindingMapping.toCamelCase()
Robert Varga [Thu, 3 Jul 2014 21:38:47 +0000 (23:38 +0200)]
Optimize BindingMapping.toCamelCase()

Instead of replacing characters, we use a CharMatcher in the Splitter.
This elides the need to copy strings and search them multiple times.

Change-Id: Iff0e580f927a5f983a3eb6e2e3b318f33a1b2217
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBug 560: Fixed incoherent API implementation.
Lukas Sedlak [Fri, 4 Jul 2014 06:41:30 +0000 (08:41 +0200)]
Bug 560: Fixed incoherent API implementation.

Fixed bug in getRpcServiceClassFor method. Now method follows API contract and will return class
for specified module namespace and module revision.

Signed-off-by: Lukas Sedlak <lsedlak@cisco.com>
9 years agoDo not use "".equals(String)
Robert Varga [Thu, 3 Jul 2014 21:17:59 +0000 (23:17 +0200)]
Do not use "".equals(String)

This is an ugly shorthand for String.isEmpty(), so let's not use it.

Change-Id: I6f00cc0676f982e99690294a11e703832b404977
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "BUG-1119: optimize length and range checks in generated sources."
Tony Tkacik [Thu, 3 Jul 2014 11:59:46 +0000 (11:59 +0000)]
Merge "BUG-1119: optimize length and range checks in generated sources."

9 years agoMerge "BUG-597: removed dependency on GeneratedTOBuilderImpl from BindingGeneratorUti...
Tony Tkacik [Thu, 3 Jul 2014 11:55:58 +0000 (11:55 +0000)]
Merge "BUG-597: removed dependency on GeneratedTOBuilderImpl from BindingGeneratorUtil to break a package cycle."

9 years agoMerge "BUG-1143: binding-generator-impl: tests refactoring."
Tony Tkacik [Thu, 3 Jul 2014 11:52:17 +0000 (11:52 +0000)]
Merge "BUG-1143: binding-generator-impl: tests refactoring."

9 years agoBUG-1275: do not copy arrays in XmlDocumentUtilsforEachChild()
Robert Varga [Wed, 2 Jul 2014 10:58:22 +0000 (12:58 +0200)]
BUG-1275: do not copy arrays in XmlDocumentUtilsforEachChild()

ImmutableList.Builder() has a nasty habit of performing poorly for
anything that is larger than 2 elements. Let's elide it by following
smarts:

- check if the list of children is empty
- pre-allocate an arraylist, thus copying the array at most once

Change-Id: I08825e15fba92e256bd415c192d3f30d52d6d8eb
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoOptimize BindingGeneratorUtil.parseToCamelCase()
Robert Varga [Wed, 2 Jul 2014 11:17:41 +0000 (13:17 +0200)]
Optimize BindingGeneratorUtil.parseToCamelCase()

This replaces the relatively expensive replace operation with
CharMatcher.removeFrom().

Change-Id: I74123797427c76b3584394a3a203500bb9dea73b
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "BUG-868: do not use InstanceIdentifier constructor"
Martin Vitez [Wed, 2 Jul 2014 11:03:20 +0000 (11:03 +0000)]
Merge "BUG-868: do not use InstanceIdentifier constructor"

9 years agoBUG-868: do not use InstanceIdentifier constructor
Robert Varga [Wed, 2 Jul 2014 08:37:43 +0000 (10:37 +0200)]
BUG-868: do not use InstanceIdentifier constructor

Change-Id: Iffe519a5720d50c3ad6a88c747e36019507b6781
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Improvements REST documentation generation"
Tony Tkacik [Wed, 2 Jul 2014 08:22:57 +0000 (08:22 +0000)]
Merge "Improvements REST documentation generation"

9 years agoBUG-597: removed dependency on GeneratedTOBuilderImpl from BindingGeneratorUtil to...
Martin Vitez [Thu, 12 Jun 2014 10:46:14 +0000 (12:46 +0200)]
BUG-597: removed dependency on GeneratedTOBuilderImpl from BindingGeneratorUtil to break a package cycle.

Change-Id: I6dfbf217982e1128ab22db70af261ade250642c3
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoBUG-1119: optimize length and range checks in generated sources.
Martin Vitez [Tue, 10 Jun 2014 13:40:43 +0000 (15:40 +0200)]
BUG-1119: optimize length and range checks in generated sources.

Constraints are generated only once (by double-checked locking) and stored as immutable static variable.
BigInteger and BigDecimal values 0, 1 and 10 are represented as Big*.ZERO, ONE or TEN.
BigInteger values are created via BigInteger.valueOf(long) call.

Change-Id: Idb54d841fe64fd5a32af38b30126a314d6bc7a0d
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoBUG-1143: binding-generator-impl: tests refactoring.
Martin Vitez [Fri, 27 Jun 2014 08:00:38 +0000 (10:00 +0200)]
BUG-1143: binding-generator-impl: tests refactoring.

Optimalized existing tests, removed useless test files.

Change-Id: I5dbe03b66b6d3251b87bc9eb1f1c89ebe6f03c3d
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoMerge "RevisionIdentifier.getDefaultInstance() is static"
Martin Vitez [Wed, 2 Jul 2014 07:45:26 +0000 (07:45 +0000)]
Merge "RevisionIdentifier.getDefaultInstance() is static"

9 years agoMerge "Bug 762: Verify input in typedef codecs"
Tony Tkacik [Tue, 1 Jul 2014 14:51:27 +0000 (14:51 +0000)]
Merge "Bug 762: Verify input in typedef codecs"

9 years agoRevisionIdentifier.getDefaultInstance() is static
Robert Varga [Tue, 1 Jul 2014 14:13:00 +0000 (16:13 +0200)]
RevisionIdentifier.getDefaultInstance() is static

This fixes warnings about static method being invoked on an instance,
plus it removes the now-unused instance.

Change-Id: I7c4594908d6b3a5c10e9b3f12e32ca203d3aa3d2
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Cleanup pom.xml"
Tony Tkacik [Tue, 1 Jul 2014 14:48:35 +0000 (14:48 +0000)]
Merge "Cleanup pom.xml"

9 years agoMerge "BUG-994: use SchemaPath.getPathTowardRoot()"
Tony Tkacik [Tue, 1 Jul 2014 14:46:36 +0000 (14:46 +0000)]
Merge "BUG-994: use SchemaPath.getPathTowardRoot()"

9 years agoCleanup pom.xml
Robert Varga [Tue, 1 Jul 2014 14:08:37 +0000 (16:08 +0200)]
Cleanup pom.xml

This cleans up eclipse warnings about duplicate groupIds and overriding
versions.

Change-Id: Id920e7bb01814c5184f1157b093e3f449cfdf955
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-865: removed deprecated code from binding-java-api-generator tests.
Martin Vitez [Tue, 1 Jul 2014 14:07:31 +0000 (16:07 +0200)]
BUG-865: removed deprecated code from binding-java-api-generator tests.

Fixed warning in ClassTemplate.xtend.

Change-Id: I4add39082ab10c8b8ddb6dc7c4062470b198e2f6
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoBUG-994: use SchemaPath.getPathTowardRoot()
Robert Varga [Thu, 26 Jun 2014 17:43:13 +0000 (19:43 +0200)]
BUG-994: use SchemaPath.getPathTowardRoot()

Instead of dereferencing the old API, use the new API, which gives the
same information more conveniently.

Change-Id: I485bae608bfb4aa1f6dae9838458a58ff4b23793
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Bug 1027: Decreased log level from INFO to DEBUG."
Martin Vitez [Tue, 1 Jul 2014 12:35:16 +0000 (12:35 +0000)]
Merge "Bug 1027: Decreased log level from INFO to DEBUG."

9 years agoBug 1198: Make URLSchemaContextResolver thread safe
Tomas Olvecky [Wed, 18 Jun 2014 13:16:35 +0000 (15:16 +0200)]
Bug 1198: Make URLSchemaContextResolver thread safe

Make YangModelParser interface deprecated as recommended methods are in
YangContextParser.
yang-parser-impl - Introduce dependency on findbugs for documentation.
URLSchemaContextResolver - first round of refactoring, add
synchronized everywhere where data is changed.

Change-Id: Id53f165740301d085ad8374fc02897a0a19faa38
Signed-off-by: Tomas Olvecky <tolvecky@cisco.com>
9 years agoMerge "BUG 428 remove importing unnecessary imports"
Tony Tkacik [Tue, 1 Jul 2014 09:20:33 +0000 (09:20 +0000)]
Merge "BUG 428 remove importing unnecessary imports"

9 years agoImprovements REST documentation generation
Ladislav Borak [Tue, 1 Jul 2014 08:27:58 +0000 (10:27 +0200)]
Improvements REST documentation generation

Signed-off-by: Ladislav Borak <lborak@cisco.com>
9 years agoBug 1027: Decreased log level from INFO to DEBUG.
Tony Tkacik [Mon, 30 Jun 2014 12:57:28 +0000 (14:57 +0200)]
Bug 1027: Decreased log level from INFO to DEBUG.

Change-Id: I79452e344c23aa593505ac41337c9d9306b6f1d5
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBUG 428 remove importing unnecessary imports
Jozef Gloncak [Mon, 28 Apr 2014 11:41:40 +0000 (13:41 +0200)]
BUG 428 remove importing unnecessary imports

List of imports is created from all GeneratedTypes which were used while
generating interface or class.

Fully qualified name is always used for classes which belongs to
java.lang.* package

Change-Id: I14dcf1bd852ef596c6001c5bf2ffeac9a65d962b
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
9 years agoBug 762: Verify input in typedef codecs
tpantelis [Tue, 27 May 2014 17:07:42 +0000 (13:07 -0400)]
Bug 762: Verify input in typedef codecs

- Modified the Bits, Union, Enum, and Empty TypeDefinitionAwareCodecs to
  verify
  the input in the deserialize method and throw IllegalArgEx if invalid.
- Modified IdentityCompositeCodec to throw IllegalArgEx if input not
  found in identity map.
- Added unit tests to cover all the TypeDefinitionAwareCodec-derived
  classes.

Change-Id: I10e963b83bfb9e4200f3ea0e77cd41bd48d04474
Signed-off-by: tpantelis <tpanteli@brocade.com>
9 years agoMerge "BUG-1201: make yangtools compilable with java 8."
Tony Tkacik [Thu, 26 Jun 2014 13:46:20 +0000 (13:46 +0000)]
Merge "BUG-1201: make yangtools compilable with java 8."

9 years agoFixed leak of LazyGeneratedCodecRegistry between restarts of service.
Tony Tkacik [Thu, 26 Jun 2014 12:15:05 +0000 (14:15 +0200)]
Fixed leak of LazyGeneratedCodecRegistry between restarts of service.

LocationAwareDispatch codecs was inner classes referencing
their parent and between tests leaked incorrect order context.
Updated their implementation, to take latest LazyGeneratedCodecRegistry.

This still assumes there is only one registry at a time
per classloader space.

Change-Id: I1ae58e1c4dd90914893e61172b6d171b458d2ba2
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "Bug 1203: Reset state of LocationDispatchCodecs"
Martin Vitez [Wed, 25 Jun 2014 10:03:32 +0000 (10:03 +0000)]
Merge "Bug 1203: Reset state of LocationDispatchCodecs"

9 years agoBug 1203: Reset state of LocationDispatchCodecs
Tony Tkacik [Wed, 18 Jun 2014 14:09:09 +0000 (16:09 +0200)]
Bug 1203: Reset state of LocationDispatchCodecs

LocationDispatchCodecs must react to schema
context change, which may introduce changes
of locations, in which they are used.

This actually requires reinitialization of these
codecs (cases, augmentations) in order to discover
newly introduced case classes or augmentation classes
or to disable unload ones.

Initialization of codecs is done lazily and uses
same code-path as their first use.

Change-Id: I621edcfbe4bd29612e3358aa2e507b14e3002524
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBUG-1201: make yangtools compilable with java 8.
Robert Varga [Wed, 18 Jun 2014 09:59:40 +0000 (11:59 +0200)]
BUG-1201: make yangtools compilable with java 8.

Changed collection sorting in xtend classes.
Added maven profile to parent pom which is activated in java 8 environment to turn off DocLint.

Change-Id: Ief9dbaf9e029e653e337bf86740cdad0d07734f3
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Checkstyle maven plugin check - yangtools"
Tony Tkacik [Tue, 24 Jun 2014 07:23:42 +0000 (07:23 +0000)]
Merge "Checkstyle maven plugin check - yangtools"

9 years agoMerge "BUG-579: removed dependency on GeneratedTOBuilderImpl from Types to break...
Tony Tkacik [Tue, 24 Jun 2014 07:21:09 +0000 (07:21 +0000)]
Merge "BUG-579: removed dependency on GeneratedTOBuilderImpl from Types to break a package cycle."

9 years agoCheckstyle maven plugin check - yangtools
Milos Fabian [Wed, 4 Jun 2014 14:56:43 +0000 (16:56 +0200)]
Checkstyle maven plugin check - yangtools

    -violations do not fail build
    -rules defined in yangtools/common/checkstyle-logging
https://git.opendaylight.org/gerrit/#/c/7595/
https://git.opendaylight.org/gerrit/#/c/7108/

Change-Id: I26bfa119f3484444fe33d47640db7407f9a3cd55
Signed-off-by: Milos Fabian <milfabia@cisco.com>
9 years agoMerge "Extract typedefs to local variable to avoid error in xtend generated class."
Tony Tkacik [Mon, 23 Jun 2014 16:16:52 +0000 (16:16 +0000)]
Merge "Extract typedefs to local variable to avoid error in xtend generated class."

9 years agoBUG-579: removed dependency on GeneratedTOBuilderImpl from Types to break a package...
Martin Vitez [Thu, 12 Jun 2014 07:21:58 +0000 (09:21 +0200)]
BUG-579: removed dependency on GeneratedTOBuilderImpl from Types to break a package cycle.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoExtract typedefs to local variable to avoid error in xtend generated class.
Martin Vitez [Mon, 26 May 2014 12:14:42 +0000 (14:14 +0200)]
Extract typedefs to local variable to avoid error in xtend generated class.

Change-Id: If58153836a3e619be51f5eeedce44e9f92076f47
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoBUG-582: optimize TypeProviderImpl
Robert Varga [Thu, 19 Jun 2014 18:00:01 +0000 (20:00 +0200)]
BUG-582: optimize TypeProviderImpl

This just replaces obvious string misuses with more-performant
replacements.

Change-Id: Ib8fe7a3a40e3fe9fa78d3eec2f83c1341040a937
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG 1131: untangling package cyclic dependencies in yang-parser-impl
Tony Tkacik [Wed, 4 Jun 2014 13:54:22 +0000 (15:54 +0200)]
BUG 1131: untangling package cyclic dependencies in yang-parser-impl

This untanglement of package cyclic dependencies introduced
better code organization, when more-obvious components
logical blocks are available, most of moved classes
were private to parser and was never meant for public consumption.

  - yang.model.util - Utility and simple implementations of yang-model-api
  - yang.parser.builder.* - Builders for yang-model-api with
semantic functionality
  - yang.parser.impl - Actual implementation of YANG Parser
  - yang.parser.impl.util - Utility functions on top of YANG Parser
  - yang.parser.util - Utility classes, potential candidates for movements.

Change-Id: Ia5718f4712d91df7cea0f55d4cc1a502d376faea
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "BUG-582: pre-cache Pattern instances"
Tony Tkacik [Fri, 20 Jun 2014 14:15:05 +0000 (14:15 +0000)]
Merge "BUG-582: pre-cache Pattern instances"

9 years agoMerge "Introduce HashCodeBuilder"
Tony Tkacik [Fri, 20 Jun 2014 14:14:54 +0000 (14:14 +0000)]
Merge "Introduce HashCodeBuilder"

9 years agoBUG-944 Fix HostBuilder class conflict for domain/ipv4 address
Maros Marsalek [Fri, 20 Jun 2014 11:11:33 +0000 (13:11 +0200)]
BUG-944 Fix HostBuilder class conflict for domain/ipv4 address

Ipv4 addresses were matched by ipv4 as well as domain-name pattern in HostBuilder class, which caused a conflict.

Now ipv4 pattern is prefered to domain-name.

Change-Id: Ia449d247c04747d6ca50856f92d3aa77b581e60f
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoBUG-582: pre-cache Pattern instances
Robert Varga [Sun, 8 Jun 2014 20:41:12 +0000 (22:41 +0200)]
BUG-582: pre-cache Pattern instances

In a few places we did not cache the regex patters we used, resulting in
sub-optimal performance. This patch corrects that, moving them as close
to being static as possible.

Change-Id: I5edb8c1f33dff9178a0101fbb8fa71a6a3237aab
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoIntroduce HashCodeBuilder
Robert Varga [Sat, 7 Jun 2014 20:13:00 +0000 (22:13 +0200)]
Introduce HashCodeBuilder

This patch moves HashCodeBuilder, and internal yang-binding utility
class, into the util package and make it public.

The class was originally used to incrementally create InstanceIdentifier
hash code. As it turns out, we have at least two other potential users,
who could benefit from that same pattern: SchemaPath and the data-api
InstanceIdentifier, since they really are just different views on the
same concept.

Change-Id: I6a3208de213a47a2ed98e64f73a883dca73034fc
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-1195: made typedef classes serializable.
Martin Vitez [Wed, 18 Jun 2014 16:08:07 +0000 (18:08 +0200)]
BUG-1195: made typedef classes serializable.

All classes generated from yang typedef statement now implement java.io.Serializable and contain serialVersionUID property.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoMerge "BUG-582: optimize replaceWithCamelCase"
Tony Tkacik [Wed, 18 Jun 2014 12:54:27 +0000 (12:54 +0000)]
Merge "BUG-582: optimize replaceWithCamelCase"

9 years agoBUG-582: optimize replaceWithCamelCase
Robert Varga [Sun, 8 Jun 2014 10:23:13 +0000 (12:23 +0200)]
BUG-582: optimize replaceWithCamelCase

Optimize replaceWithCamelCase() by not instantiating a string just to do
a toUppserCase.

Also the initial character lookup is done on the original string, such
that we can elide any object instantiation if the character to be
removed is not found.

Change-Id: Iee81f1967d47a63668bf14b319a2f46715e6866b
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "BUG-1196, Bug 886: Refactored implementation of Choice Codec"
Tony Tkacik [Wed, 18 Jun 2014 09:13:04 +0000 (09:13 +0000)]
Merge "BUG-1196, Bug 886: Refactored implementation of Choice Codec"

9 years agoBUG-1196, Bug 886: Refactored implementation of Choice Codec
Martin Vitez [Tue, 17 Jun 2014 11:12:13 +0000 (13:12 +0200)]
BUG-1196, Bug 886: Refactored implementation of Choice Codec

Choice Codec and instantiation of Choice Case codecs
was updated to reuse common reactive instatiation
of mixin codec provided by LocationAwareDispatchCodec
which provides utilities to retrieve all instantiation
of cases in their right context, so codecs
use corect namespaces and see only cases which
are really available in particular subtree.

Serialization of Cases was updated to
use namespace from schema context if and only
if case is added by augmentation.

Added test which test serialization / deserialization.

Change-Id: Id2ff269b6d124a35bdca7f687114d3fa123091d5
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoRevert "BUG-1196: fixed bug in choice case codec."
Tony Tkacik [Tue, 17 Jun 2014 19:17:52 +0000 (19:17 +0000)]
Revert "BUG-1196: fixed bug in choice case codec."

This reverts commit 92e4fd194891f567aad81f36352aaf9c80df7838.

Change-Id: I2cf16d72002fce3f8de5ff16008f62a74dc834d5
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBUG-1196: fixed bug in choice case codec.
Martin Vitez [Tue, 17 Jun 2014 11:12:13 +0000 (13:12 +0200)]
BUG-1196: fixed bug in choice case codec.

Implemented lazy generation of choice case codecs by
using DispatchChoiceCodecImpl - delegator for de/serialization
of case instances in
PublicChoiceCodecImpl. This codec is created for each interface
generated from yang choice. It contains information about all
implementations of choice-cases in context and delegate
de/serialization of concrete case instance to correct case
codec based on given InstanceIdentifier.

ChoiceCaseCodecImpl instances are created when concrete case
is encountered.

By using DispatchChoiceCodecImpl we don't need to hold
COMPOSITE_TO_CASE and CLASS_TO_CASE_MAP variables in runtime
generated codec which were
used to serialization and deserialization before.

Added test which test serialization / deserialization.

Change-Id: I52eb78f66e91695758b825b109639d039860f997
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoMerge "BUG-865: replaced deprecated code from binding-generator-util."
Tony Tkacik [Fri, 13 Jun 2014 11:59:40 +0000 (11:59 +0000)]
Merge "BUG-865: replaced deprecated code from binding-generator-util."

10 years agoMerge changes I6b5ca1b6,Ib9703600,I5eb25590,I5ea885e0,I08ba5d2c
Tony Tkacik [Fri, 13 Jun 2014 11:58:11 +0000 (11:58 +0000)]
Merge changes I6b5ca1b6,Ib9703600,I5eb25590,I5ea885e0,I08ba5d2c

* changes:
  BUG-1143: refactored ChoiceCaseGenTypesTest.
  BUG-1143: refactored AugmentRelativeXPathTest.
  BUG-1143: refactored AugmentedTypeTest.
  BUG-1143: added AbstractTypesTest as base for generated types testing.
  BUG-865: removed use of deprecated methods from tests.

10 years agoMerge "BUG-1069: made InstanceIdentifier.PathArgument implement Comparable."
Tony Tkacik [Fri, 13 Jun 2014 11:56:31 +0000 (11:56 +0000)]
Merge "BUG-1069: made InstanceIdentifier.PathArgument implement Comparable."

10 years agoMerge "BUG-865: replaced deprecated code from yang-binding."
Tony Tkacik [Fri, 13 Jun 2014 11:53:38 +0000 (11:53 +0000)]
Merge "BUG-865: replaced deprecated code from yang-binding."