yangtools.git
9 years agoMerge "BUG-994: do not use SchemaPath.getPath()"
Robert Varga [Mon, 30 Jun 2014 19:33:26 +0000 (19:33 +0000)]
Merge "BUG-994: do not use SchemaPath.getPath()"

9 years agoBUG 1131: Introduced sealing of builder, initial clean up of ModuleBuilder. 98/7898/11
Tomas Olvecky [Tue, 24 Jun 2014 11:09:12 +0000 (13:09 +0200)]
BUG 1131: Introduced sealing of builder, initial clean up of ModuleBuilder.

Introduced sealing of builders, which makes sure builder is not
modified once the product of build was created.

Logic in parser prevented this already, but it was external
check to builders, not internal.

Sealing of builders is critical for implementing safe
instantiation since once you create copy of builder
(eg.instantiation of grouping) you do NOT want
to have grouping definition accidentally change.

This should prevent introducing regressions as described above.

Change-Id: Iad2dfc8036d27f3538e48315eb1fc17a5481f67b
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Signed-off-by: Tomas Olvecky <tolvecky@cisco.com>
9 years agoBUG 1131: Removed duplicate code in builders. 95/7895/13
Tomas Olvecky [Wed, 25 Jun 2014 12:22:30 +0000 (14:22 +0200)]
BUG 1131: Removed duplicate code in builders.

Sonar Analysis showed that concrete implementations of builders have
number of similar code blocks, which deals with creating instance
of schema node.

This functionality should have only one implementiation (this
increases readibility and reduces potential places for bugs)
moved common shared functionality  to Abstract*Builder and
Abstract implementaitons of SchemaNodes.

Change-Id: Ie9d87eaa728612090f9ad3740381df1bf970d1fe
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Signed-off-by: Tomas Olvecky <tolvecky@cisco.com>
9 years agoMerge "BUG 1250 - leaf of type empty can't saved via restconf"
Tony Tkacik [Mon, 30 Jun 2014 08:13:11 +0000 (08:13 +0000)]
Merge "BUG 1250 - leaf of type empty can't saved via restconf"

9 years agoBUG-994: do not use SchemaPath.getPath() 47/8447/2
Martin Vitez [Mon, 30 Jun 2014 06:57:35 +0000 (08:57 +0200)]
BUG-994: do not use SchemaPath.getPath()

Change-Id: If513126e831b6d1d8039fa2d3d1e298bd9fd411e
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agofeature-yangtool breaks release 71/8371/2
Giovanni Meo [Thu, 26 Jun 2014 14:00:41 +0000 (16:00 +0200)]
feature-yangtool breaks release

- feature-yangtool need to depend on all the bundles that are listed
as being part of the feature file else the maven reaction may try to
include files in the feature that are not yet been built and cannot be
fetched otherwise. Typical case of this is when you have releases
- Some pom cleanup warning

Change-Id: I27269e3cc88cea8d285fa421387869ea89ef67a5
Signed-off-by: Giovanni Meo <gmeo@cisco.com>
9 years agoBUG 1250 - leaf of type empty can't saved via restconf 02/8402/1
Jozef Gloncak [Fri, 27 Jun 2014 09:25:05 +0000 (11:25 +0200)]
BUG 1250 - leaf of type empty can't saved via restconf

Check where value of leaf has to be different from null was removed.

Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
9 years agoMerge "Revert "BUG-994: reorganize SchemaPath into a tree""
Jan Medved [Fri, 27 Jun 2014 00:14:36 +0000 (00:14 +0000)]
Merge "Revert "BUG-994: reorganize SchemaPath into a tree""

9 years agoRevert "BUG-994: reorganize SchemaPath into a tree" 90/8390/1
Ed Warnicke [Thu, 26 Jun 2014 23:59:15 +0000 (23:59 +0000)]
Revert "BUG-994: reorganize SchemaPath into a tree"

This reverts commit 1ef3b93dd9e9095eb4eb3d1ac7c595f52f779686.

Change-Id: Iee2e0b57b2cb8bf8e193a443030ec42ddfa238ae
Signed-off-by: Ed Warnicke <eaw@cisco.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 agoMerge "BUG-994: reorganize SchemaPath into a tree"
Tony Tkacik [Thu, 26 Jun 2014 13:39:23 +0000 (13:39 +0000)]
Merge "BUG-994: reorganize SchemaPath into a tree"

9 years agoMerge "BUG-994: optimize resolveRelativeXPath()"
Tony Tkacik [Thu, 26 Jun 2014 13:37:51 +0000 (13:37 +0000)]
Merge "BUG-994: optimize resolveRelativeXPath()"

9 years agoMerge "BUG-944: convert SchemaContextUtil to use Iterable"
Tony Tkacik [Thu, 26 Jun 2014 13:37:29 +0000 (13:37 +0000)]
Merge "BUG-944: convert SchemaContextUtil to use Iterable"

9 years agoMerge "BUG-944: optimize SchemaContextUtil"
Tony Tkacik [Thu, 26 Jun 2014 13:36:28 +0000 (13:36 +0000)]
Merge "BUG-944: optimize SchemaContextUtil"

9 years agoMerge "BUG-994: do not use SchemaPath.getPath()"
Tony Tkacik [Thu, 26 Jun 2014 13:35:57 +0000 (13:35 +0000)]
Merge "BUG-994: do not use SchemaPath.getPath()"

9 years agoFixed leak of LazyGeneratedCodecRegistry between restarts of service. 68/8368/1
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 agoBUG-994: reorganize SchemaPath into a tree 37/8337/6
Robert Varga [Wed, 25 Jun 2014 07:18:56 +0000 (09:18 +0200)]
BUG-994: reorganize SchemaPath into a tree

Instead of storing the entire path in the scemapath object, this patch
reworks the class such that it holds 0ne component of the path and a
reference to the parent path.

Change-Id: Ic029c84db9817f9799070c5c4aad7fc3f5fa13b1
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-994: optimize resolveRelativeXPath() 36/8336/4
Robert Varga [Wed, 25 Jun 2014 13:41:12 +0000 (15:41 +0200)]
BUG-994: optimize resolveRelativeXPath()

This patch is a slight optimization of the method which takes advantage
of the fact that we do not need to return a List anymore.

Change-Id: I05ed7b96feca26247a6d73dfe2e758846155302f
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-944: convert SchemaContextUtil to use Iterable 35/8335/4
Robert Varga [Wed, 25 Jun 2014 11:09:14 +0000 (13:09 +0200)]
BUG-944: convert SchemaContextUtil to use Iterable

SchemaContextUtil is heavily centered around the idea that a SchemaPath
has a List of QName. That assumption is deprecated, so convert this
class to use Iterable instead, preparing it for transition to new APIs.

Change-Id: I0e23bd534c441d19aab62eb7a3069244b27532b2
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-944: optimize SchemaContextUtil 34/8334/4
Robert Varga [Wed, 25 Jun 2014 10:52:08 +0000 (12:52 +0200)]
BUG-944: optimize SchemaContextUtil

SchemaContextUtil used String.split(), which is extremely costly to
execute. This patch converts it to use Splitters instead and
opportunistically optimizes resolveRelativeXPath().

Change-Id: Ib270361d7aead90d3fcdeb3b865c5327a298b20d
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-994: do not use SchemaPath.getPath() 33/8333/3
Robert Varga [Wed, 25 Jun 2014 11:20:19 +0000 (13:20 +0200)]
BUG-994: do not use SchemaPath.getPath()

SchemaContextUtil used getPath() to construct parent from the path --
use getParent() instead. Furthermore convert uses where it is only used
as Iterable into getPathFromRoot().

Change-Id: I455e9e297c4ed6a7f861bb6cc9b6e4ece2bd8337
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "BUG-994: make SchemaPath abstract"
Tony Tkacik [Wed, 25 Jun 2014 13:16:05 +0000 (13:16 +0000)]
Merge "BUG-994: make SchemaPath abstract"

9 years agoMerge "BUG-994: remove the legacy public constructor"
Tony Tkacik [Wed, 25 Jun 2014 13:15:44 +0000 (13:15 +0000)]
Merge "BUG-994: remove the legacy public constructor"

9 years agoMerge "BUG-865: do not use SchemaPath.getPath()"
Tony Tkacik [Wed, 25 Jun 2014 13:14:26 +0000 (13:14 +0000)]
Merge "BUG-865: do not use SchemaPath.getPath()"

9 years agoMerge "BUG-994: Use SchemaPath.getParent()"
Tony Tkacik [Wed, 25 Jun 2014 13:13:41 +0000 (13:13 +0000)]
Merge "BUG-994: Use SchemaPath.getParent()"

9 years agoMerge "BUG-994: introduce SchemaPath.getParent()"
Tony Tkacik [Wed, 25 Jun 2014 13:13:23 +0000 (13:13 +0000)]
Merge "BUG-994: introduce SchemaPath.getParent()"

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 agoMerge "Move implementation of DataTree to Yangtools"
Tony Tkacik [Wed, 25 Jun 2014 09:39:27 +0000 (09:39 +0000)]
Merge "Move implementation of DataTree to Yangtools"

9 years agoBUG-994: make SchemaPath abstract 88/8288/3
Robert Varga [Tue, 24 Jun 2014 08:09:44 +0000 (10:09 +0200)]
BUG-994: make SchemaPath abstract

Now that the direct instantiations have been eradicated, make SchemaPath
an abstract class. Introduce RelativeSchemaPath and AbstractSchemaPath
to hold the two distinct types, eliminating the need for a boolean
field.

Change-Id: Icad3e23ac15f9238ed4c44dc77718fb43a0a9f4f
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-994: remove the legacy public constructor 86/8286/3
Robert Varga [Tue, 24 Jun 2014 07:36:11 +0000 (09:36 +0200)]
BUG-994: remove the legacy public constructor

This removes the constructor, so SchemaPaths are impossible to create
directly, allowing us to evolve and optimize the class further.

Change-Id: Id8ced3d26f012be98504aa1c44ebe1d732b288ba
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-865: do not use SchemaPath.getPath() 87/8287/3
Robert Varga [Tue, 24 Jun 2014 07:44:24 +0000 (09:44 +0200)]
BUG-865: do not use SchemaPath.getPath()

Gets rid of use of SchemaPath.getPath(). Also performs some drive-by
optimizations:
- use a static instance of Joiner
- use Iterables.transform() for creating path String

Change-Id: Ib5bd63a9de6c05482f0cf677f634a279f4cedcbd
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMove implementation of DataTree to Yangtools 68/8268/5
Basheeruddin Ahmed [Mon, 23 Jun 2014 23:09:08 +0000 (16:09 -0700)]
Move implementation of DataTree to Yangtools

Analysis showed that implementation of DataTree
in MD-SAL Data Store, is generic and can
be used outside of Data Store as part of
YANG Data component. This patch
moves existing code created by
 - Robert Varga <rovargs@cisco.com>
 - Tony Tkacik <ttkacik@cisco.com>

To new location

yang-data-api - Data structure & data tree API definitions
yang-data-impl - Data structures and data tree logic

Change-Id: I0a93714677b5315534630d942e35e0262fa8d41d
Signed-off-by: Basheeruddin Ahmed <syedbahm@cisco.com>
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-994: Use SchemaPath.getParent() 85/8285/2
Robert Varga [Tue, 24 Jun 2014 07:35:00 +0000 (09:35 +0200)]
BUG-994: Use SchemaPath.getParent()

Now that SchemaPath defines the proper utility method, use it instead of
brewing our own.

Change-Id: If3661c78491ab97e70627dfffcd902a21bd93e83
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBug 1203: Reset state of LocationDispatchCodecs 16/8116/4
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. 06/8106/2
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 agoBUG-994: introduce SchemaPath.getParent() 84/8284/1
Robert Varga [Tue, 24 Jun 2014 07:32:47 +0000 (09:32 +0200)]
BUG-994: introduce SchemaPath.getParent()

There are a few places which manually construct the parent of a
SchemaPath. Introduce a utility method which does precisely that in the
most efficient manner possible.

Change-Id: If144ddf3bb50f7bc25865c342ec9099045aafb93
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 21/7721/5
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 agoBUG-582: formattedRevision is lazy 78/8278/1
Robert Varga [Tue, 24 Jun 2014 05:54:55 +0000 (07:54 +0200)]
BUG-582: formattedRevision is lazy

This patch creates formattedRevision lazily to prevent unneeded string
explosions.

Change-Id: I15c1270e0c2ab3d90e176046a87efc65f9ba7c03
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-582: Use QNameModule for hashCode/equals 77/8277/1
Robert Varga [Mon, 19 May 2014 05:47:03 +0000 (07:47 +0200)]
BUG-582: Use QNameModule for hashCode/equals

Updates QName to use use QNameModule's hashCode/equals.

Change-Id: I823faa4a2061bbe952560ce3fb2df42facf6a746
Signed-off-by: Robert Varga <rovarga@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... 31/7931/2
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. 98/7398/3
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: improve SchemaPath.hashCode() 66/7766/14
Robert Varga [Thu, 5 Jun 2014 21:51:26 +0000 (23:51 +0200)]
BUG-582: improve SchemaPath.hashCode()

SchemaPath.hashCode() is currently the hottest hashCode of immutable
objects. SchemaPath has similar uses as the BA InstanceIdentifier, where
we use hash code caching.

This patch introduces such caching. It also prevents list duplication
when we do not need to copy the entire list.

Change-Id: I5a8fe845ebb50308fde7fc766970f81ea706c203
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-582: optimize TypeProviderImpl 57/8157/3
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 66/7866/10
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>
10 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"

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

10 years agoBUG-944 Fix HostBuilder class conflict for domain/ipv4 address 71/8171/3
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>
10 years agoBUG-582: pre-cache Pattern instances 21/7821/3
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>
10 years agoIntroduce HashCodeBuilder 20/7820/3
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>
10 years agoBUG-1195: made typedef classes serializable. 43/8143/1
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>
10 years agoMerge "Introduce Identifiables"
Tony Tkacik [Wed, 18 Jun 2014 17:39:00 +0000 (17:39 +0000)]
Merge "Introduce Identifiables"

10 years agoMerge "AnyXmlNode builders"
Tony Tkacik [Wed, 18 Jun 2014 16:46:12 +0000 (16:46 +0000)]
Merge "AnyXmlNode builders"

10 years agoMerge "BUG-582: use QNameModule when instantiating QName"
Tony Tkacik [Wed, 18 Jun 2014 12:57:05 +0000 (12:57 +0000)]
Merge "BUG-582: use QNameModule when instantiating QName"

10 years agoMerge "BUG-582: expose QNameModule"
Tony Tkacik [Wed, 18 Jun 2014 12:56:06 +0000 (12:56 +0000)]
Merge "BUG-582: expose QNameModule"

10 years agoMerge "BUG-582: do not use linear search of child nodes"
Tony Tkacik [Wed, 18 Jun 2014 12:55:49 +0000 (12:55 +0000)]
Merge "BUG-582: do not use linear search of child nodes"

10 years agoMerge "BUG-582: optimize replaceWithCamelCase"
Tony Tkacik [Wed, 18 Jun 2014 12:54:27 +0000 (12:54 +0000)]
Merge "BUG-582: optimize replaceWithCamelCase"

10 years agoAnyXmlNode builders 61/8061/4
Jozef Gloncak [Tue, 17 Jun 2014 07:11:42 +0000 (09:11 +0200)]
AnyXmlNode builders

Add builders to yang-data-impl to be able to implement
DataNormalizationOperation.AnyXmlNormalization.normalize() from sal-common-impl

Change-Id: I9033b9a5a228a552a4abc6230d6e5ce63d49fc78
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
10 years agoMerge "Add Anyxml normalized node to yang-data-api."
Tony Tkacik [Wed, 18 Jun 2014 10:15:09 +0000 (10:15 +0000)]
Merge "Add Anyxml normalized node to yang-data-api."

10 years agoBUG-582: use QNameModule when instantiating QName 13/7813/4
Robert Varga [Sun, 8 Jun 2014 07:22:39 +0000 (09:22 +0200)]
BUG-582: use QNameModule when instantiating QName

Instead of instantiating internal QNameModules, just create one and
reuse it.

Change-Id: I3db8c7ffc57258621eea2bc052c16bb3c3a33bce
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-582: expose QNameModule 12/7812/4
Robert Varga [Sun, 8 Jun 2014 07:12:27 +0000 (09:12 +0200)]
BUG-582: expose QNameModule

Make QNameModule public and allow its use to create QName instances.
This will allow us to reuse objects.

Change-Id: I1aa9abbfea9d32634c476ec5bf2c815b1313dd27
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-582: do not use linear search of child nodes 11/7811/4
Robert Varga [Sat, 7 Jun 2014 21:05:13 +0000 (23:05 +0200)]
BUG-582: do not use linear search of child nodes

Profiling has found we are epending some time in addChildNode() to
search all the existing node. As it turns out, we are already using a
TreeSet, so using a TreeMap instead will give us a log(N) lookup
capability at no cost at all.

Change-Id: I5e3962170d8d5ae8bb087de3de52928ad6cebc1c
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-582: optimize replaceWithCamelCase 15/7815/3
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>
10 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"

10 years agoBUG-1196, Bug 886: Refactored implementation of Choice Codec 88/8088/4
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>
10 years agoMerge "Fix and cleanup to Yang Tools Feature file"
Jan Medved [Wed, 18 Jun 2014 01:20:09 +0000 (01:20 +0000)]
Merge "Fix and cleanup to Yang Tools Feature file"

10 years agoFix and cleanup to Yang Tools Feature file 97/7997/7
Ed Warnicke [Fri, 13 Jun 2014 17:59:33 +0000 (13:59 -0400)]
Fix and cleanup to Yang Tools Feature file

Change-Id: Iacc322acbd4a0d00b932ddefd0eab9fc15925217
Signed-off-by: Mathieu Lemay <mlemay@inocybe.com>
Signed-off-by: Ed Warnicke <eaw@cisco.com>
10 years agoRevert "BUG-1196: fixed bug in choice case codec." 84/8084/1
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>
10 years agoBUG-1196: fixed bug in choice case codec. 71/8071/4
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 agoAdd Anyxml normalized node to yang-data-api. 71/7771/2
Jozef Gloncak [Tue, 17 Jun 2014 07:32:47 +0000 (09:32 +0200)]
Add Anyxml normalized node to yang-data-api.

Proposal of anyxml normalized node interface.
This interface wraps Simple/CompositeNode as inner value.

Change-Id: Ic9c17fa28bc5eb23288162a735d890b4f77938f1
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Signed-off-by: Jozef Gloncak <jgloncak@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."

10 years agoBUG-1069: made InstanceIdentifier.PathArgument implement Comparable. 52/7952/2
Martin Vitez [Thu, 12 Jun 2014 15:32:31 +0000 (17:32 +0200)]
BUG-1069: made InstanceIdentifier.PathArgument implement Comparable.

Change-Id: Ib89d5a4240205234f707290e69f29d80841e3504
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoBUG-1143: refactored ChoiceCaseGenTypesTest. 87/7987/1
Martin Vitez [Fri, 13 Jun 2014 11:24:06 +0000 (13:24 +0200)]
BUG-1143: refactored ChoiceCaseGenTypesTest.

Removed test sources which are irrelevant for choice case generated type testing.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoBUG-865: replaced some deprecated code from binding-type-provider. 39/7939/2
Martin Vitez [Thu, 12 Jun 2014 11:32:29 +0000 (13:32 +0200)]
BUG-865: replaced some deprecated code from binding-type-provider.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoBUG-1143: refactored AugmentRelativeXPathTest. 81/7981/1
Martin Vitez [Fri, 13 Jun 2014 10:02:38 +0000 (12:02 +0200)]
BUG-1143: refactored AugmentRelativeXPathTest.

Removed test sources which are irrelevant for relative path augment generated type testing.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoBUG-1143: refactored AugmentedTypeTest. 80/7980/1
Martin Vitez [Fri, 13 Jun 2014 09:37:49 +0000 (11:37 +0200)]
BUG-1143: refactored AugmentedTypeTest.

Removed test sources which are irrelevant for augment generated type testing.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoBUG-1143: added AbstractTypesTest as base for generated types testing. 79/7979/1
Martin Vitez [Fri, 13 Jun 2014 09:11:17 +0000 (11:11 +0200)]
BUG-1143: added AbstractTypesTest as base for generated types testing.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoBUG-865: removed use of deprecated methods from tests. 14/7914/2
Martin Vitez [Wed, 11 Jun 2014 15:49:20 +0000 (17:49 +0200)]
BUG-865: removed use of deprecated methods from tests.

Removed use of deprecated methods from parser in binding-generator-impl tests.

Change-Id: I08ba5d2c2abc55b818e389502512f35774a90db3
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoBug 1193: Use format string correctly and fix corresponding unit test 65/7965/1
Rob Adams [Fri, 13 Jun 2014 00:52:56 +0000 (17:52 -0700)]
Bug 1193: Use format string correctly and fix corresponding unit test
as well

Change-Id: Ib05078ee9045f60cff663407aa401045ac9d885b
Signed-off-by: Rob Adams <readams@readams.net>
10 years agoBUG-865: replaced deprecated code from yang-binding. 44/7944/1
Martin Vitez [Thu, 12 Jun 2014 13:03:19 +0000 (15:03 +0200)]
BUG-865: replaced deprecated code from yang-binding.

Removed groupId declaration from pom (duplicate of parent groupId).

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoBUG-865: replaced deprecated code from binding-generator-util. 40/7940/1
Martin Vitez [Thu, 12 Jun 2014 11:45:10 +0000 (13:45 +0200)]
BUG-865: replaced deprecated code from binding-generator-util.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoBUG-1172: nested uses-augmentation fails in code-generation phase. 02/7902/2
Martin Vitez [Wed, 11 Jun 2014 14:02:12 +0000 (16:02 +0200)]
BUG-1172: nested uses-augmentation fails in code-generation phase.

Added test case.

Change-Id: I22e506fcaf4f643f5cecb995e3e5f0e5d8ef1fa8
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoBUG-1024: reorganize code for clarity 13/7113/4
Robert Varga [Fri, 16 May 2014 13:00:46 +0000 (15:00 +0200)]
BUG-1024: reorganize code for clarity

This reorganizes the code quite a bit and stops executing as soon as a
result is known.

Change-Id: I9537227e0e6230ee66253aa83ab0c5c2963725e4
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoFixed handling of submodules in yang-maven-plugin. 97/7897/1
Martin Vitez [Wed, 11 Jun 2014 11:10:37 +0000 (13:10 +0200)]
Fixed handling of submodules in yang-maven-plugin.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoJanitor: add missing copyright headers 70/7770/2
Robert Varga [Thu, 29 May 2014 04:42:04 +0000 (06:42 +0200)]
Janitor: add missing copyright headers

common/feature does not comply to project standards for XML files,
fix that.

Change-Id: I53c78ef55eefdae67ea28f830698cd966c6fa244
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "API Clarity: Documented o.o.y.yang.data.api and o.o.y.yang.data.api.schema...
Robert Varga [Mon, 9 Jun 2014 17:09:14 +0000 (17:09 +0000)]
Merge "API Clarity: Documented o.o.y.yang.data.api and o.o.y.yang.data.api.schema packages."

10 years agoMerge "API Clarity: Documented o.o.y.yang.parser.builder.api"
Robert Varga [Mon, 9 Jun 2014 15:59:45 +0000 (15:59 +0000)]
Merge "API Clarity: Documented o.o.y.yang.parser.builder.api"

10 years agoAPI Clarity: Documented o.o.y.yang.data.api and o.o.y.yang.data.api.schema packages. 24/7824/6
Tony Tkacik [Mon, 9 Jun 2014 08:21:09 +0000 (10:21 +0200)]
API Clarity: Documented o.o.y.yang.data.api and o.o.y.yang.data.api.schema packages.

Fully documented o.o.y.yang.data.api.schema package
Partially documented o.o.y.yang.data.api package

Change-Id: Id2721050abee5120165485dec4b38348f37609b1
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoAPI Clarity: Documented o.o.y.yang.parser.builder.api 77/7677/6
Tony Tkacik [Wed, 4 Jun 2014 11:47:37 +0000 (13:47 +0200)]
API Clarity: Documented o.o.y.yang.parser.builder.api

Change-Id: I75c524c7d4d41a4d65004a0ed86065af6a2ae523
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoMerge "Fixed mismatch in ietf-restconf-version variable"
Tony Tkacik [Mon, 9 Jun 2014 12:41:50 +0000 (12:41 +0000)]
Merge "Fixed mismatch in ietf-restconf-version variable"

10 years agoBug 981: Removed direct access to parent fields. 76/7676/3
Tony Tkacik [Wed, 4 Jun 2014 11:47:01 +0000 (13:47 +0200)]
Bug 981: Removed direct access to parent fields.

Change-Id: I21389b168e2796be23d280a7152a48ddb23de67e
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoAPI Clarity: Documentented o.o.y.yang.parser.impl.util 47/7647/3
Tony Tkacik [Tue, 3 Jun 2014 15:51:51 +0000 (17:51 +0200)]
API Clarity: Documentented o.o.y.yang.parser.impl.util

Change-Id: Ic98387e4e5f191cbd920279c9a5520ffa81d3607
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoFixed mismatch in ietf-restconf-version variable 22/7822/1
Giovanni Meo [Mon, 9 Jun 2014 07:11:25 +0000 (09:11 +0200)]
Fixed mismatch in ietf-restconf-version variable

- ietf-restconf-version is defined to be 2013.09.04.1-SNAPSHOT while
the module is defined to be 2013.10.19.1-SNAPSHOT. The mismatch causes
issue in the usage as well in the releasing process

Change-Id: Ieee018314370416fc3ba37e0f7f7eb2f1f55c06b
Signed-off-by: Giovanni Meo <gmeo@cisco.com>
10 years agoBUG-868: do not use ParserUtils.createSchemaPath() 10/7810/1
Robert Varga [Sun, 8 Jun 2014 07:20:05 +0000 (09:20 +0200)]
BUG-868: do not use ParserUtils.createSchemaPath()

Moves from ParserUtils.createSchemaPath() to new SchemaPath utility
APIs.

Change-Id: I3671e72a39d0975dcec49f9c99ea84df1fc89cc7
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoIntroduce Identifiables 53/7753/4
Robert Varga [Thu, 29 May 2014 13:02:45 +0000 (15:02 +0200)]
Introduce Identifiables

New utility class holding methods useful when dealing with Identifiable
objects.

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