mdsal.git
10 years agoMerge "bug 1128:POM Restructuring for Automated Release"
Robert Varga [Fri, 6 Jun 2014 15:03:05 +0000 (15:03 +0000)]
Merge "bug 1128:POM Restructuring for Automated Release"

10 years agobug 1128:POM Restructuring for Automated Release
Vaishali Mithbaokar [Thu, 10 Apr 2014 01:39:04 +0000 (18:39 -0700)]
bug 1128:POM Restructuring for Automated Release

Temporarily hosting odlrootparent as part of the project just for review purpose

Change-Id: Ia9f14f1f5544e3ef5a543cf8e0e904fb31ffbeee
Signed-off-by: Surekha Bejgam <sbejgam@cisco.com>
Signed-off-by: Vaishali Mithbaokar <vmithbao@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-582: do not call hashCode() from IdentifiableItem.equals()
Robert Varga [Fri, 6 Jun 2014 12:37:25 +0000 (14:37 +0200)]
BUG-582: do not call hashCode() from IdentifiableItem.equals()

This call would make sense if we had cached hashCode -- but we do not.
We have two options here, either cache hashCode, or not call it from
equals().

Tracing ODL identified that the only other caller of
hashCode() is HashCodeBuilder.nextHashCode() -- thus the hash code is
used only once.

So caching it would add useless overhead of 4 bytes -- so let's just say
no to that.

Change-Id: I19ae0e5025fb6aec5b4d1019b55976ca5ca2e9d4
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-582: eliminate useless null checks
Robert Varga [Fri, 6 Jun 2014 12:19:37 +0000 (14:19 +0200)]
BUG-582: eliminate useless null checks

These checks are not useful, as the fields checked have been verified to
be non-null. Also optimizes AbstractPathArgument.hashCode() by directly
referring to the type -- we assume storing the PathArgument alongside
with the class is not going to be used very often.

Change-Id: Id3f4d67819de8462801823880e482a480843fa1e
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-582: optimize InstanceIdentifier.firstIdentifierOf()
Robert Varga [Thu, 5 Jun 2014 21:46:21 +0000 (23:46 +0200)]
BUG-582: optimize InstanceIdentifier.firstIdentifierOf()

Performance tracing of OpenFlow components found that we are spending
cycles copying arguments in create() when called from firstIdentifierOf().
This does not make sense, as we know the argument list is immutable in
this code path.

As it turns out, the copy guard in create() is not sufficient to prevent
the copy, as the Iterables.limit() instantiates a FluentIterable, not an
ImmutableCollection.

This patch elides the copy by splitting the non-copy part of logic of
create() to a private method, internalCreate(). firstIdentifierOf()
calls this method directly, while create() calls it after potentially
creating a copy.

Change-Id: I5c3dbb5c6b5e26d30a0bb407822f1d40fcc898f5
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-868: migrate to SchemaPath.create()
Robert Varga [Thu, 5 Jun 2014 21:59:32 +0000 (23:59 +0200)]
BUG-868: migrate to SchemaPath.create()

Removes deprecated direct use of constructor in favor of using factory
method.

Change-Id: Ifc49b7a565d971baad2181715b9104e3bf02ea8f
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "Improved sorting of augmentations before code generation."
Tony Tkacik [Fri, 6 Jun 2014 08:24:42 +0000 (08:24 +0000)]
Merge "Improved sorting of augmentations before code generation."

10 years agoMerge "Bug 1027: Fixed generation of static QNAME field"
Robert Varga [Mon, 2 Jun 2014 15:18:23 +0000 (15:18 +0000)]
Merge "Bug 1027: Fixed generation of static QNAME field"

10 years agoBug 1027: Fixed generation of static QNAME field
Tony Tkacik [Thu, 22 May 2014 11:10:55 +0000 (13:10 +0200)]
Bug 1027: Fixed generation of static QNAME field

All YANG modeled entities such as containers, lists
which have Binding-aware interface associated with
it should have static field QNAME with their respective
from YANG models. Only exception are augmentations
which do not have explicit name.

Instance Identifier codec relies on this existence
of QName which was not true for classes derived from
RPC Input and RPC Output

The code was changed to fix this issue:

BindingGeneratorImpl:
  Updated to include QName for all YANG modeled
  data container.

BindingReflections:
  ClassToQNameLoader was updated to derive correct
  qname for RPC inputs and RPC outputs for models
  which was compiled with missing QName field.

Change-Id: I190f569037cb4e88cf2edc7f18c436cf3eb86aeb
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoMerge "Bug 1113 - ietf-restconf needs to specify the version of ietf-yangtypes that...
Tony Tkacik [Fri, 30 May 2014 13:39:50 +0000 (13:39 +0000)]
Merge "Bug 1113 - ietf-restconf needs to specify the version of ietf-yangtypes that must be imported."

10 years agoBug 1113 - ietf-restconf needs to specify the version of ietf-yangtypes that must...
Devin Avery [Thu, 29 May 2014 21:52:23 +0000 (17:52 -0400)]
Bug 1113 - ietf-restconf needs to specify the version of ietf-yangtypes that must be imported.

Modified the internal ietf-restconf to specify the required version of ietf-yangtypes so runtime compilation runs without an issue.

Change-Id: I06f547aee6d26b7865ea93bbcdd76808d46d8151
Signed-off-by: Devin Avery <devin.avery@brocade.com>
10 years agoImproved sorting of augmentations before code generation.
Martin Vitez [Mon, 19 May 2014 13:36:24 +0000 (15:36 +0200)]
Improved sorting of augmentations before code generation.

Change-Id: I6471f4849fa57a717d85d61293305b0853b851cb
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoMerge "BUG-973: fixed (de)serialization of union type."
Tony Tkacik [Wed, 28 May 2014 08:42:36 +0000 (08:42 +0000)]
Merge "BUG-973: fixed (de)serialization of union type."

10 years agoMerge "BUG-981: remove deprecated elements"
Tony Tkacik [Tue, 27 May 2014 13:54:14 +0000 (13:54 +0000)]
Merge "BUG-981: remove deprecated elements"

10 years agoBUG-981: remove deprecated elements
Robert Varga [Sun, 11 May 2014 05:27:55 +0000 (07:27 +0200)]
BUG-981: remove deprecated elements

This patch removes deprecated constructor and setters, such that the
RuntimeGeneratedMappingServiceImpl can be instantiated in one go.

Change-Id: I7941479291210be9b1ee37919feae055c63c228c
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-994: convert users of SchemaPath constructor
Robert Varga [Thu, 22 May 2014 08:22:16 +0000 (10:22 +0200)]
BUG-994: convert users of SchemaPath constructor

This patch migrates all in-tree users of the deprecated constructor to
the create family of methods.

Change-Id: I7229237763b4a15d30978796fbfe6f2ab44f5889
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "BUG-868: stop using getChildren()"
Tony Tkacik [Mon, 26 May 2014 19:32:20 +0000 (19:32 +0000)]
Merge "BUG-868: stop using getChildren()"

10 years agoBUG-973: fixed (de)serialization of union type.
Martin Vitez [Thu, 22 May 2014 14:05:41 +0000 (16:05 +0200)]
BUG-973: fixed (de)serialization of union type.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoBUG-868: stop using getChildren()
Robert Varga [Mon, 26 May 2014 09:36:07 +0000 (11:36 +0200)]
BUG-868: stop using getChildren()

This removes users of getChildren() in favor of getValue().

Change-Id: I1b871b46cd3af04dba1d286f386e43148308fbe1
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-582: Optimize string modification
Robert Varga [Sat, 24 May 2014 09:37:50 +0000 (11:37 +0200)]
BUG-582: Optimize string modification

This code could potentially end up with a lot of copying around. Pay a
single copy operation, iterate over the character array once and replace
characters as needed.

Change-Id: Ifdb80f83c938fde9c70ec6f34300fd010b01db6a
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-582: Optimize instantiated Splitter
Robert Varga [Sat, 24 May 2014 08:58:40 +0000 (10:58 +0200)]
BUG-582: Optimize instantiated Splitter

This just turns the string-based splitter into a char-based one, saving
both memory and CPU cycles.

Change-Id: I9c93f23c79a32d662a8d7358ad928c5757359c37
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-582: Optimize and correct validateJavaPackage
Robert Varga [Sat, 24 May 2014 07:15:34 +0000 (09:15 +0200)]
BUG-582: Optimize and correct validateJavaPackage

This removes obsolete set and uses it from Binding. Also does the same
for the package prefix -- this in fact was incorrect a happened to work
because YANG version == 1, same as our binding version. Finally we
optimize the validateJavaPackage() since it is a major CPU hog.

Change-Id: Ib189606cbc78a47681d4eb30174ebc51d82e04bc
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-582: Operate on characters when checking for leading digit
Robert Varga [Sat, 24 May 2014 06:37:48 +0000 (08:37 +0200)]
BUG-582: Operate on characters when checking for leading digit

Do not use strings when we are checking/reconstructing the leading
character -- this allows for more efficient operation.

Change-Id: I4de105ddb9af39e4a28ccc72bc79a15b410ed706
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-582: Pre-compile replacement pattern
Robert Varga [Sat, 24 May 2014 06:20:49 +0000 (08:20 +0200)]
BUG-582: Pre-compile replacement pattern

Introduce a static Pattern, which can be used to instantiate Matchers.
Speeds up processing, which included construction of the pattern on each
call.

Change-Id: I4f6cde4cc738aada05c4c6f113271cf002fae19d
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBug 735 - Part 1 - Bug Fix - fix the wrong version in the ietf-restconf bundle
Devin Avery [Wed, 21 May 2014 15:52:16 +0000 (11:52 -0400)]
Bug 735 - Part 1 - Bug Fix - fix the wrong version in the ietf-restconf bundle

Change-Id: Ie70cbe61220264af7b8b805e33c4a25167f218cc
Signed-off-by: Devin Avery <devin.avery@brocade.com>
10 years agoMerge "BUG-580: Improved parsing."
Tony Tkacik [Tue, 20 May 2014 16:11:12 +0000 (16:11 +0000)]
Merge "BUG-580: Improved parsing."

10 years agoMerge "BUG-990: fixed deserialization of enums."
Tony Tkacik [Tue, 20 May 2014 13:35:46 +0000 (13:35 +0000)]
Merge "BUG-990: fixed deserialization of enums."

10 years agoMerge "BUG-865: removed use of deprecated parseToClassName method."
Tony Tkacik [Tue, 20 May 2014 13:34:04 +0000 (13:34 +0000)]
Merge "BUG-865: removed use of deprecated parseToClassName method."

10 years agoMerge "BUG-865: removed unused code."
Tony Tkacik [Tue, 20 May 2014 13:23:59 +0000 (13:23 +0000)]
Merge "BUG-865: removed unused code."

10 years agoMerge "Bug 735 - Part 1: Update ietf-restconf and ietf-yangtypes to newer versions"
Tony Tkacik [Tue, 20 May 2014 12:59:18 +0000 (12:59 +0000)]
Merge "Bug 735 - Part 1: Update ietf-restconf and ietf-yangtypes to newer versions"

10 years agoBUG-990: fixed deserialization of enums.
Martin Vitez [Thu, 15 May 2014 14:02:05 +0000 (16:02 +0200)]
BUG-990: fixed deserialization of enums.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoBUG-865: removed unused code.
Martin Vitez [Wed, 7 May 2014 09:14:11 +0000 (11:14 +0200)]
BUG-865: removed unused code.

Removed unused imports, replaced deprecated code.

Change-Id: Iec9c79dd2592133eb953367f23f38c3626531745
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoBUG-865: removed use of deprecated parseToClassName method.
Martin Vitez [Wed, 7 May 2014 11:27:28 +0000 (13:27 +0200)]
BUG-865: removed use of deprecated parseToClassName method.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoBUG-580: Improved parsing.
Martin Vitez [Thu, 24 Apr 2014 09:03:10 +0000 (11:03 +0200)]
BUG-580: Improved parsing.

Added new YangContextParser interface.
Deprecated methods from YangModelParser.
Improved IO and exception handling.

Change-Id: I2a07320acab3d19570b0ddb645b5113a531a8532
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoMerge "Improved documentation of BindingReflections."
Robert Varga [Mon, 19 May 2014 18:04:35 +0000 (18:04 +0000)]
Merge "Improved documentation of BindingReflections."

10 years agoImproved documentation of BindingReflections.
Tony Tkacik [Mon, 19 May 2014 17:42:18 +0000 (19:42 +0200)]
Improved documentation of BindingReflections.

Change-Id: I9c52daeccbe18c4463f09c4d47eeba66b7f4a27c
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoMerge "Bug 1027: Improved instance identifier codec for augmentations"
Robert Varga [Mon, 19 May 2014 15:58:27 +0000 (15:58 +0000)]
Merge "Bug 1027: Improved instance identifier codec for augmentations"

10 years agoBug 1027: Improved instance identifier codec for augmentations
Tony Tkacik [Mon, 19 May 2014 14:36:53 +0000 (16:36 +0200)]
Bug 1027: Improved instance identifier codec for augmentations

InstanceIdentifierCodecImpl
Updated instance identifier codec to also create context
for child nodes of augmentation when augmentation is
for first time encountered in new context.

Improved structure of instance identifier codec to be bit
more readable and which allows for reuse.

LazyGeneratedCodecRegistry
Updated AugmentableDispatchCodec to try serialization
of InstanceIdentifier to augmentation when new
location is discovered and report back if serialization
failed.

Added documentation to adaptForPathImpl, renamed parameters
to be more readable.

Change-Id: Ie55b163a4ab617b82dd89ed85a504e104f147fe8
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoBug 735 - Part 1: Update ietf-restconf and ietf-yangtypes to newer versions
Devin Avery [Mon, 19 May 2014 12:27:28 +0000 (08:27 -0400)]
Bug 735 - Part 1: Update ietf-restconf and ietf-yangtypes to newer versions

Patch 2 - Implemented RevisionBuilder.java and RevisionBuilderTest.java classes.
Patch 3 - Creating new ietf-yangtypes bundle for new version of file.
Patch 4 - Renamed ietf-yangtypes bundle to full version.

Change-Id: I8824580f37869ff128fe33ea862c90261bd743a6
Signed-off-by: Devin Avery <devin.avery@brocade.com>
10 years agoMerge "BUG-987: improve generated type allocation"
Tony Tkacik [Mon, 19 May 2014 09:59:40 +0000 (09:59 +0000)]
Merge "BUG-987: improve generated type allocation"

10 years agoMove ClassLoaderUtils
Robert Varga [Sun, 18 May 2014 13:07:58 +0000 (15:07 +0200)]
Move ClassLoaderUtils

This patch makes an attempt at unifying and improving the two
ClassLoaderUtils versions we have available. This is a prerequisite to
being able to being able to maintain them properly.

At this point the sanest place for them is yang-binding, as it has
guava, slf4j and is at least transitively pulled from all users.

Change-Id: Iea7ae5fb7ef40f9af960ca01b000f81237c70ab0
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-1027: emit more diagnostics when augmentation is not found
Robert Varga [Sun, 18 May 2014 13:58:37 +0000 (15:58 +0200)]
BUG-1027: emit more diagnostics when augmentation is not found

This adds more stern warnings when we fail to find augmentation targets.

Change-Id: Iec338917e7f175c4e977529761f1e8fa272d0bb1
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-1026: do not mask unexpected exceptions
Robert Varga [Sun, 18 May 2014 13:41:53 +0000 (15:41 +0200)]
BUG-1026: do not mask unexpected exceptions

This patch restructures the code such that we do not silently drop the
exception we may encounter during module info loading -- promote it
to an IllegalArgumentException.

This has the nice feature or also not masking any RuntimeExceptions we
may encounter.

Change-Id: I8a2c7108b589234c0c1350024dacb0d7f1ec4d72
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-1026: Better message when we fail lookup
Robert Varga [Sun, 18 May 2014 07:05:04 +0000 (09:05 +0200)]
BUG-1026: Better message when we fail lookup

This turns a NPE into a checkArgument(), such that we emit proper
diagnostic information.

Change-Id: I90c68fafde35cc28c9e9449a5984a7c42f1f467d
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoFix javadoc warnings in binding-generator-impl
Robert Varga [Sun, 18 May 2014 07:07:55 +0000 (09:07 +0200)]
Fix javadoc warnings in binding-generator-impl

Adds missing description to @return, fixes parameter name.

Change-Id: I1e2adb98e683ecbb49f30556ae0e7828ae37938a
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoProvide more information when throwin exception
Robert Varga [Sun, 18 May 2014 13:40:34 +0000 (15:40 +0200)]
Provide more information when throwin exception

This adds some context to the thrown exception such that at least the
class name is captured.

Change-Id: Id6b215d0841f2c29ce90292c474b6eb804e08488
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-731: Declare which exceptions are possible from callable
Robert Varga [Sun, 18 May 2014 13:40:02 +0000 (15:40 +0200)]
BUG-731: Declare which exceptions are possible from callable

This just makes it clear that it's not Exception which is being thrown.

Change-Id: Ic7fc356f38a8faa943fcc222079a3a680e15c818
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "Bug 981: Make sure QName is not null in RPC case."
Robert Varga [Sat, 17 May 2014 16:10:45 +0000 (16:10 +0000)]
Merge "Bug 981: Make sure QName is not null in RPC case."

10 years agoBug 981: Make sure QName is not null in RPC case.
Tony Tkacik [Fri, 16 May 2014 16:09:05 +0000 (18:09 +0200)]
Bug 981: Make sure QName is not null in RPC case.

Change-Id: I7316918102342ce0375cfa6b14e00a6888eed43b
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoBUG-987: improve generated type allocation
Robert Varga [Wed, 14 May 2014 07:17:51 +0000 (09:17 +0200)]
BUG-987: improve generated type allocation

This patch improves ArrayList allocation such it does not waste space in
generated types, since we know how big an array we need before hand. We
also use singletonList() and emptyList() as appropriate. Shaves off
about 2MB from retained size on a vanilla SP edition.

Change-Id: Ief18a029613f14c13abc985aa60388b704bae79e
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-1021: improve efficiency of generated builders.
Martin Vitez [Fri, 16 May 2014 08:28:48 +0000 (10:28 +0200)]
BUG-1021: improve efficiency of generated builders.

Improved construction of augmentation field.

Change-Id: I5106c271dd7d73eafd3c35678a78a9906a1aa8c2
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoMerge "Fix a warning generic warning"
Tony Tkacik [Thu, 15 May 2014 06:56:59 +0000 (06:56 +0000)]
Merge "Fix a warning generic warning"

10 years agoFix a warning generic warning
Robert Varga [Wed, 14 May 2014 06:47:54 +0000 (08:47 +0200)]
Fix a warning generic warning

We do not need to use <T>, just use <?>, making eclipse happy.

Change-Id: Id22b775ca4e9a9d11a42697586e6cbb09197c01c
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "Don't throw NPE if we fail to find ChildOf interface"
Tony Tkacik [Mon, 12 May 2014 16:22:27 +0000 (16:22 +0000)]
Merge "Don't throw NPE if we fail to find ChildOf interface"

10 years agoDon't throw NPE if we fail to find ChildOf interface
Robert Varga [Mon, 12 May 2014 14:26:05 +0000 (16:26 +0200)]
Don't throw NPE if we fail to find ChildOf interface

Check for null return, this NPE can happen in the following path:

2014-05-12 06:56:56.740 PDT [http-bio-8080-exec-3] WARN  o.o.y.s.b.g.i.LazyGeneratedCodecRegistry - Exception during preparation of instance identifier codec for  path InstanceIdentifier{targetType=interface org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.basic.explicit.route.subobjects.subobject.type.ip.prefix._case.IpPrefix, path=[org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology, org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology, org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev131024.Node1, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev131024.pcep.client.attributes.PathComputationClient, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev131024.pcep.client.attributes.path.computation.client.ReportedLsp, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev131024.pcep.client.attributes.path.computation.client.reported.lsp.Path, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.Ero, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.Subobject, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.basic.explicit.route.subobjects.subobject.type.ip.prefix._case.IpPrefix]}.
java.lang.NullPointerException: null
at org.opendaylight.yangtools.yang.binding.util.BindingReflections.isAugmentationChild(BindingReflections.java:173) ~[bundlefile:na]
at org.opendaylight.yangtools.sal.binding.generator.impl.InstanceIdentifierCodecImpl._serializePathArgument(InstanceIdentifierCodecImpl.java:165) ~[bundlefile:na]

Change-Id: I8d4b94d3c98dbf1f6cae36ab015282ae7afa098f
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-981: improve waitForSchema() reliability
Robert Varga [Sun, 11 May 2014 20:29:29 +0000 (22:29 +0200)]
BUG-981: improve waitForSchema() reliability

SchemaLock.waitForSchema() should not check presence of codecs, but
rather only look at available definitions. Rework it such that it is
more useful.

Change-Id: I0e6240dad78d1e4987b3c7e8b4171b0e117e4792
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-981: force callers to handle exceptions
Robert Varga [Sun, 11 May 2014 16:01:35 +0000 (18:01 +0200)]
BUG-981: force callers to handle exceptions

This patch makes sure all the callsites acknowledge that the
transformer generator may fail. Also introduces proper chaining so we do
not lose information.

Change-Id: Ifce672b52a4f9d07104778f4e5060f51804747cc
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-981: make some methods static and non-public
Robert Varga [Sun, 11 May 2014 13:34:30 +0000 (15:34 +0200)]
BUG-981: make some methods static and non-public

These two methods can be made static, allowing for further code
reorganization. Also renames log to LOG to comply with standards.

Change-Id: I63abecfbb3d2fc891b6f37123cf503e8d20dc289
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-981: untangle interfaces
Robert Varga [Sun, 11 May 2014 11:05:34 +0000 (13:05 +0200)]
BUG-981: untangle interfaces

This patch untangles the interactions between the three classes that
constitute the binding generator implementation. This provides a
baseline for analyzing thread safety and ensuring its proper function.

TypeResolver is a new interface, which encapsulates the lookup services
provided by RuntimeGeneratedMappingServiceImpl to TransformerGenerator.

AbstractTransformerGenerator is a new abstract class, which defines the
interface of TransformerGenerator to the rest of the package, such that
Java classes do not have direct dependency on xtend code. Furthermore it
acts defines the interface which the xtend code expects of the Java
runtime.

Change-Id: I0a4fdc23aa25c69e45a3cea63aab0168ee2fe3ce
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBug 981: Make sure InstanceIdentifier codec is able to deserialize all written data.
Tony Tkacik [Sun, 11 May 2014 16:22:27 +0000 (18:22 +0200)]
Bug 981: Make sure InstanceIdentifier codec is able to deserialize all written data.

Preparation is done in LocationAwareDispatchCodec, which
is location-aware, hand-written (not generated) and it's
direct subclass AugmentableCompositeCodec has one instance
associated with every generated codec for data containers
and it's method adaptForPath is triggered allways for
first run of parent codec in different location.

This make sure when codec is reused via groupings
it has proper initialization for use in that place.

Change-Id: If15a07caa26162de1e34e9656968b120925a2011
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoBUG-981: RuntimeGeneratedMappingServiceImpl thread safety
Robert Varga [Sun, 11 May 2014 09:52:04 +0000 (11:52 +0200)]
BUG-981: RuntimeGeneratedMappingServiceImpl thread safety

This patch improves and documents thread safety of waiting for schema to
become available. There was an obvious race condition between schema
context change and registering for notification.

Change-Id: Ieb3999b3d6af5fbbee63015c92a87353a71229d7
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-981: improve RuntimeGeneratedMappingServiceImpl clarity
Robert Varga [Sat, 10 May 2014 21:55:10 +0000 (23:55 +0200)]
BUG-981: improve RuntimeGeneratedMappingServiceImpl clarity

This clarifies some of the locking interactions and well as it isolates
privay value.

Change-Id: Ic8961c9f9d32307fdd582191cab55bc633d081c5
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-981: cleanup superfluous use of Callable
Robert Varga [Sat, 10 May 2014 14:54:20 +0000 (16:54 +0200)]
BUG-981: cleanup superfluous use of Callable

As it turns out, wrapping code in a callable is completely unnecessary.
Removing it makes the code much more clear and allows for proper
inspection.

Change-Id: Ib57c9996fc8faaa8388736d469334eb2952bf018
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-981: defensive checks
Robert Varga [Sun, 11 May 2014 08:59:46 +0000 (10:59 +0200)]
BUG-981: defensive checks

This patch rewrites getClassForPath() to be more defensive and helpful
in diagnosing problems.

Change-Id: I24cd31819f0aea7f67bf6bc2e6c65168b1f3cae5
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "BUG-731: fix order of modifiers"
Tony Tkacik [Sat, 10 May 2014 18:21:56 +0000 (18:21 +0000)]
Merge "BUG-731: fix order of modifiers"

10 years agoMerge "Remove unused imports"
Tony Tkacik [Sat, 10 May 2014 18:20:11 +0000 (18:20 +0000)]
Merge "Remove unused imports"

10 years agoBUG-731: fix order of modifiers
Robert Varga [Thu, 8 May 2014 06:48:18 +0000 (08:48 +0200)]
BUG-731: fix order of modifiers

'abstract protected' -> 'protected abstract' et al.

Change-Id: Id124ddc8281a5f880b9cd5b1e1b2de5a6722b391
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-731: add curly braces
Robert Varga [Thu, 8 May 2014 06:11:01 +0000 (08:11 +0200)]
BUG-731: add curly braces

Automated addition of curly braces.

Change-Id: I475657dc778601124610d0415cdf05e6a4495cc5
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "BUG-731: remove unneded temp variables"
Tony Tkacik [Sat, 10 May 2014 17:00:58 +0000 (17:00 +0000)]
Merge "BUG-731: remove unneded temp variables"

10 years agoMerge "BUG-731: make sure utility classes are not instantiated"
Tony Tkacik [Sat, 10 May 2014 17:00:41 +0000 (17:00 +0000)]
Merge "BUG-731: make sure utility classes are not instantiated"

10 years agoBUG-981: remove use of deprecated getPath()
Robert Varga [Sat, 10 May 2014 14:27:42 +0000 (16:27 +0200)]
BUG-981: remove use of deprecated getPath()

Here we're only iterating through, so there's no need to get the
Collection.

Change-Id: I32f9005dafc8df8ae059bb5da2c6d57132749219
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-893: improve ClassLoaderUtils safety
Robert Varga [Sat, 10 May 2014 14:00:17 +0000 (16:00 +0200)]
BUG-893: improve ClassLoaderUtils safety

There is a slight possiblity for
ClassLoaderUtils.withClassLoaderAndLock() to not release the lock. Fix
this by refactoring it properly and letting users pick which flavor of
the method they want to use.

Change-Id: I07edd05323d26bfdf6800fbcd28ad9c150599a74
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-893: do not use deprecated contructor
Robert Varga [Sat, 10 May 2014 13:50:03 +0000 (15:50 +0200)]
BUG-893: do not use deprecated contructor

This gets rid of using JavassistUtils' deprecated contructor. It also
removes storage of ClassPool, so it makes it easier to reason about it.

Change-Id: I2deb15e7ce85527bdfb7fb79ae46bb5d25466ca2
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-983: remove the use of xtend Conversions
Robert Varga [Sat, 10 May 2014 10:27:14 +0000 (12:27 +0200)]
BUG-983: remove the use of xtend Conversions

This removes the last remnant of xtend for this codebase. As it turns
out, it make the code much more efficient, too.

Change-Id: Ie6f67ae308075c9af79a2a849309002d501dc646
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-983: prepare for proper wrapping
Robert Varga [Sat, 10 May 2014 10:04:17 +0000 (12:04 +0200)]
BUG-983: prepare for proper wrapping

This patch introduces a factory method to get instances, such that there
only ever is a single instance for a particular class pool. This fixes
the potential issue of adding a class path multiple times.

Change-Id: Ia8ff47674b768bd85ae50200734b8f14927f8a5c
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-983: convert sneakyThrow into checked exception
Robert Varga [Sat, 10 May 2014 09:45:08 +0000 (11:45 +0200)]
BUG-983: convert sneakyThrow into checked exception

This documents the type of exceptions the utility classes can throw.

Change-Id: I98433a4650872d2c0c379ab2784cb25f97da7757
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-893: fix loaderClassPaths safety
Robert Varga [Sat, 10 May 2014 09:29:28 +0000 (11:29 +0200)]
BUG-893: fix loaderClassPaths safety

This fixes thread safety of loaderClassPaths, as there was a
TOCTOU error. Furthermore this actually populates the map, such that we
do not continue to add classloaders.

Drive-bys include final keywords and cleanup on utility classes.

Change-Id: I3c96a4e98b242d34d7036bcb81f71f36ff88223c
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-981: harden exception handling
Robert Varga [Sat, 10 May 2014 09:00:38 +0000 (11:00 +0200)]
BUG-981: harden exception handling

This patch hardens the RuntimeGeneratedMappingServiceImpl error handling
by eliminating the use of sneakyThrow and properly chaining/logging
error causes.

Change-Id: Ia974c8cce3aab8c0f12dd318e4168932a025bb07
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoRevert "Add ietf-inet-types@2013-07-15 and ietf-yang-types@2013-07-15. Rename"
Robert Varga [Thu, 8 May 2014 09:38:22 +0000 (11:38 +0200)]
Revert "Add ietf-inet-types@2013-07-15 and ietf-yang-types@2013-07-15.  Rename"

This reverts commit a0862137aa3baf9c47ff54a3ca81dfff846baef4. The reason
is incomplete patch, which is missing key features. It also breaks
upstram (controller) build.

Change-Id: I0d4f0dc089cc7afd324dace1386cc88234480401
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoRemove unused imports
Robert Varga [Thu, 10 Apr 2014 21:45:54 +0000 (23:45 +0200)]
Remove unused imports

Change-Id: I1cbc9fb3941c8630df21fc63ecf68576a883ae8c
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-731: remove unneded temp variables
Robert Varga [Wed, 7 May 2014 12:14:47 +0000 (14:14 +0200)]
BUG-731: remove unneded temp variables

Holding temporary variables just before returning them -- not really
useful, so fix the warnings.

Change-Id: I169f7ce215145c9d39dbb041c88680f8b7d241c4
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-731: make sure utility classes are not instantiated
Robert Varga [Wed, 7 May 2014 09:00:11 +0000 (11:00 +0200)]
BUG-731: make sure utility classes are not instantiated

Change-Id: Icdda7afefa3e67c2b3a1b14ad0bbab565963a779
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "Add ietf-inet-types@2013-07-15 and ietf-yang-types@2013-07-15. Rename older...
Jan Medved [Thu, 8 May 2014 04:14:12 +0000 (04:14 +0000)]
Merge "Add ietf-inet-types@2013-07-15 and ietf-yang-types@2013-07-15.  Rename older versions as ietf-inet-types@2010-09-24.yang and ietf-yang-types@2010-09-24.yang."

10 years agoBUG-970: Fix bug in BindingMapping.getClassName.
Martin Vitez [Wed, 7 May 2014 10:37:42 +0000 (12:37 +0200)]
BUG-970: Fix bug in BindingMapping.getClassName.

Numeric class name prefix was not handled.

Change-Id: I88bc2d6324e87b7837f1c04abda53b1cb3b73f62
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoMerge changes I412fb3fc,Iccef8d2e
Tony Tkacik [Wed, 7 May 2014 08:35:22 +0000 (08:35 +0000)]
Merge changes I412fb3fc,Iccef8d2e

* changes:
  BUG-592: introduce InstanceIdentifier.child()
  BUG-592: Format BI InstanceIdentifier

10 years agoAdd ietf-inet-types@2013-07-15 and ietf-yang-types@2013-07-15. Rename
Rob Adams [Tue, 6 May 2014 21:20:07 +0000 (14:20 -0700)]
Add ietf-inet-types@2013-07-15 and ietf-yang-types@2013-07-15.  Rename
older versions as ietf-inet-types@2010-09-24.yang and
ietf-yang-types@2010-09-24.yang.

Change-Id: I1df03675f6796440c71ad4ab41b0e04a20f5a716
Signed-off-by: Rob Adams <readams@readams.net>
10 years agoBUG-832 Fix deserialization of Empty type leaves.
Maros Marsalek [Wed, 30 Apr 2014 11:29:09 +0000 (13:29 +0200)]
BUG-832 Fix deserialization of Empty type leaves.

Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Change-Id: I4474f6790a7c17b9f3a0b5fb54a9fdc93dc0e72c

10 years agoBUG-592: introduce InstanceIdentifier.child()
Robert Varga [Thu, 10 Apr 2014 20:52:15 +0000 (22:52 +0200)]
BUG-592: introduce InstanceIdentifier.child()

These methods return an immediate descendant of the base identifier.
It turns out these utility methods are open-coded on quite a few places.

Change-Id: I412fb3fcdf538a71fca1d4cb180ac4bc2a9eaeb1
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBug 527: fixed augment deserialization from xml.
Martin Vitez [Thu, 3 Apr 2014 11:07:04 +0000 (13:07 +0200)]
Bug 527: fixed augment deserialization from xml.

Refactored deserialization process to work with augment target node InstanceIdentifier.
Codec for augmentation binded to augment target node InstanceIdentifier.
Added method isAcceptable to AugmentationCodec.
Added new interface AugmentableCodec.
Updated tests.

Change-Id: I8d83e21183b8dd55e197f3d0ad1efc68c962c842
Signed-off-by: Martin Vitez <mvitez@cisco.com>
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoBUG-592: Migrate users to new build() method
Robert Varga [Wed, 26 Mar 2014 20:38:08 +0000 (21:38 +0100)]
BUG-592: Migrate users to new build() method

The static builder method is deprecated, move users off of it.

Change-Id: I2b6758c13e2eb4c6357b97f37de327594a1a7faf
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-592: Optimize equals() a bit
Robert Varga [Wed, 26 Mar 2014 18:50:06 +0000 (19:50 +0100)]
BUG-592: Optimize equals() a bit

This commit optimizes the equals() method by attempting to bypass the
full check of iterables by looking at cached state that is derived from
them.

Change-Id: I10b6e7164874992ae0dc041cffd934d292e61694
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "BUG-592: Rework instance identifier"
Tony Tkacik [Wed, 23 Apr 2014 08:04:32 +0000 (08:04 +0000)]
Merge "BUG-592: Rework instance identifier"

10 years agoBUG-592: Rework instance identifier
Robert Varga [Wed, 26 Mar 2014 14:18:50 +0000 (15:18 +0100)]
BUG-592: Rework instance identifier

This patch reworks the way InstanceIdentifier is implemented, gearing it
up for performance.

The entire implementation is based on Iterables instead of Lists, which
allows us to avoid copying them over and over as we construct new
identifiers. Simple .child() operation is a lot quicker, saving
instantiation of two intermediate classes.

The implementation gets rid of constructors, such that there is no
direct construction, but rather all paths are validated for content.
This also acts as a gate-keeper, enforcing the immutable nature of the
identifier.

Another optimization is that the hashCode() value is now built
incrementally as more members are added and cached.

InstanceIdentifierBuilder, now a full class, does not explictly copy the
base identifier, but reuses it -- there is no reason not to, as the base
identifier is immutable.

Change-Id: I0826ed3169a107c8f4b6e3026569e87387305ce0
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "Bug 735 - Part 1 - add ietf-restconf.yang back into yang-tools."
Tony Tkacik [Wed, 16 Apr 2014 13:23:00 +0000 (13:23 +0000)]
Merge "Bug 735 - Part 1 - add ietf-restconf.yang back into yang-tools."

10 years agoBug:700 Mapped description from the yang file to the generated java file
Debolina Bandyopadhyay [Tue, 15 Apr 2014 22:55:58 +0000 (15:55 -0700)]
Bug:700 Mapped description from the yang file to the generated java file

Change-Id: I732d7d4b2c708295ec1358994b4078d35de1769b
Signed-off-by: Debolina Bandyopadhyay <dbandyop@cisco.com>
10 years agoBug 735 - Part 1 - add ietf-restconf.yang back into yang-tools.
Devin Avery [Mon, 14 Apr 2014 18:45:54 +0000 (14:45 -0400)]
Bug 735 - Part 1 - add ietf-restconf.yang back into yang-tools.

Added a bundle into yang-tools to ship the ietf-restconf.yang yang file, required by MD-SAL.

NOTE: We are adding the first draft (00) of the ietf-restconf.yang so we
dont have to upgrade all of the other core yang files. It appears that
ietf-yang-types would need to be upgraded as well if we went with the
latest ietf releases. That should happen, but as part of an intention
upgrade to all ietf core.

Note: Gerrit DRAFT https://git.opendaylight.org/gerrit/#/c/6185 provideds
the fixes to the controller project to resolve the issue with the restconf
/modules endpoint, but we can not push that one forward until the yangtools
(this CS) is pushed to master because of dependencies.

Signed-off-by: Devin Avery <devin.avery@brocade.com>
10 years agoBug 613: Minimize use of xtend in binding-generator-impl.
Martin Vitez [Tue, 1 Apr 2014 08:20:39 +0000 (10:20 +0200)]
Bug 613: Minimize use of xtend in binding-generator-impl.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoMerge "Bug 447 - Yang documentation generator improvements"
Tony Tkacik [Tue, 8 Apr 2014 09:53:38 +0000 (09:53 +0000)]
Merge "Bug 447 - Yang documentation generator improvements"

10 years agoMerge "Fix for Bug 586."
Tony Tkacik [Tue, 8 Apr 2014 09:51:29 +0000 (09:51 +0000)]
Merge "Fix for Bug 586."

10 years agoBug 447 - Yang documentation generator improvements
Milos Fabian [Thu, 3 Apr 2014 14:29:11 +0000 (16:29 +0200)]
Bug 447 - Yang documentation generator improvements

-added summaries at the top of page + linked localy
-added nested child nodes of grouping and augmentation nodes
-added local links between type definitions and their users
-minor fixes

Change-Id: I573f4ee257e66c140e52327534e840801f7b3c5f
Signed-off-by: Milos Fabian <milfabia@cisco.com>