yangtools.git
10 years agoBUG-994: improve object cache 30/6930/6
Robert Varga [Sun, 18 May 2014 19:50:36 +0000 (21:50 +0200)]
BUG-994: improve object cache

This fixes the object cache to work in face of missing concrete
implementation. Also fixes up previous mistakes in cache interaction,
adding tests.

Change-Id: Icd041045ab360630788775c2e6a3ed091c527029
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMove ClassLoaderUtils 60/7160/2
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 59/7159/1
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 58/7158/1
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 50/7150/3
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 51/7151/3
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 57/7157/1
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 56/7156/1
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 agoDo not declare Throwable as thrown 55/7155/1
Robert Varga [Sun, 18 May 2014 13:38:43 +0000 (15:38 +0200)]
Do not declare Throwable as thrown

Let's not force our callers to deal with Throwable -- Exception is bad
enough.

Change-Id: I938ddfd6c08d5cf5a954a3455cfea612ea742784
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. 18/7118/1
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 agoMerge "BUG-1023: fix warnings emitted during loading of OF13 models"
Tony Tkacik [Fri, 16 May 2014 15:42:18 +0000 (15:42 +0000)]
Merge "BUG-1023: fix warnings emitted during loading of OF13 models"

10 years agoBUG-1023: fix warnings emitted during loading of OF13 models 12/7112/1
Robert Varga [Fri, 16 May 2014 10:29:29 +0000 (12:29 +0200)]
BUG-1023: fix warnings emitted during loading of OF13 models

This fixes a thinko when multiple entities exist with the same base
schema path.

Also reformats the file, adds final keywords and logging which was used
to find the problem. Finally it cleans up exception formatting to
improve readability.

Change-Id: Iab6b7959d7a305bf790d5ca38ad5f4452b185987
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-1021: improve efficiency of generated builders. 06/7106/2
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 agoBUG-579: memory improvements in parser's builders. 22/6922/5
Martin Vitez [Tue, 13 May 2014 07:37:02 +0000 (09:37 +0200)]
BUG-579: memory improvements in parser's builders.

Change-Id: I8b7e660c79d55154693ba91ae061dcad4b5c2f63
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoFix a warning generic warning 86/6986/1
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 "BUG-987: optimize illegal character search"
Tony Tkacik [Tue, 13 May 2014 15:02:23 +0000 (15:02 +0000)]
Merge "BUG-987: optimize illegal character search"

10 years agoBUG-994: QName.toString() performance 23/6923/1
Robert Varga [Tue, 13 May 2014 08:42:54 +0000 (10:42 +0200)]
BUG-994: QName.toString() performance

This fixes an obvious mistake: QName.toString() was not using the
cached, pre-formatted revision string.

Change-Id: I9cae1e97e038eaad01c7ce5d3b47c6c1b94cd575
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-987: optimize illegal character search 12/6912/1
Robert Varga [Mon, 12 May 2014 22:36:44 +0000 (00:36 +0200)]
BUG-987: optimize illegal character search

As it turns out, we are not search for a substring, but rather for
characters. Move the array into static field so we do not allocate it
needlessly over and over. And make it a char array to save space and
increase checking speed.

Change-Id: I307813ad363441cf8ee63d383896e5fa6d2fb6e6
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge changes Ib555d8f4,I6a6fb601
Tony Tkacik [Mon, 12 May 2014 18:49:27 +0000 (18:49 +0000)]
Merge changes Ib555d8f4,I6a6fb601

* changes:
  BUG-987: share empty instance
  BUG-987: improve EnumerationType

10 years agoBUG-987: share empty instance 07/6907/1
Robert Varga [Mon, 12 May 2014 16:42:22 +0000 (18:42 +0200)]
BUG-987: share empty instance

This shares the typically empty constraint instance, for both
mandatory=true and mandatory=false cases.

Change-Id: Ib555d8f4a2f6147a354d71432c86d065a359ec8b
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 agoBUG-987: improve EnumerationType 05/6905/1
Robert Varga [Mon, 12 May 2014 15:51:37 +0000 (17:51 +0200)]
BUG-987: improve EnumerationType

Use ImmutableList. Also we can use a shared instance for Qname, which
lowers overhead and speeds up hashCode()/equals(), too.

Change-Id: I6a6fb601a33c0c5b2a502fdb6880d3b4cf5e653c
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-987: Fixed parsing of identity nodes. 04/6904/2
Martin Vitez [Mon, 12 May 2014 14:28:24 +0000 (16:28 +0200)]
BUG-987: Fixed parsing of identity nodes.

Change-Id: I97ff6ae9247b9a6b0b9f7d1ca6e48d56cd79e937
Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoMerge "Memory hog: ImmutableList is appropriate here"
Tony Tkacik [Mon, 12 May 2014 14:31:06 +0000 (14:31 +0000)]
Merge "Memory hog: ImmutableList is appropriate here"

10 years agoDon't throw NPE if we fail to find ChildOf interface 03/6903/1
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 agoMemory hog: ImmutableList is appropriate here 01/6901/1
Robert Varga [Mon, 12 May 2014 14:08:27 +0000 (16:08 +0200)]
Memory hog: ImmutableList is appropriate here

There is no need to allocate two objects. Let's optimize for memory, as
these objects may be retained for a long time.

Change-Id: I73ba2b95e6e80876ba115a751b69be801da39063
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMemory hog: these collections are not fields 00/6900/1
Robert Varga [Mon, 12 May 2014 13:21:33 +0000 (15:21 +0200)]
Memory hog: these collections are not fields

This builder collections are only used in build() and not used
afterwards. Do not store them in the object, such that they can be freed
as soon as possible.

Change-Id: Iffad875b618f4cecbcda424c6f75275046189c90
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMemory hog: ImmutableSet is appropriate here 99/6899/1
Robert Varga [Mon, 12 May 2014 13:07:29 +0000 (15:07 +0200)]
Memory hog: ImmutableSet is appropriate here

Change-Id: Idf204d69636af931c1e2cd454528a276947f29d9
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMemory hog: ConstraintDefinitionImpl should be static 98/6898/1
Robert Varga [Mon, 12 May 2014 13:04:03 +0000 (15:04 +0200)]
Memory hog: ConstraintDefinitionImpl should be static

Change-Id: I22e61fc030b0a4e004bb078c4ea29b950a9b7f7b
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "BUG-865: removed unnecessary test file."
Tony Tkacik [Mon, 12 May 2014 07:06:14 +0000 (07:06 +0000)]
Merge "BUG-865: removed unnecessary test file."

10 years agoBUG-981: improve waitForSchema() reliability 82/6882/1
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 79/6879/8
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 77/6877/7
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 76/6876/7
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: drop use of deprecated interfaces 80/6880/2
Robert Varga [Sun, 11 May 2014 17:22:24 +0000 (19:22 +0200)]
BUG-981: drop use of deprecated interfaces

This is a follow-up migrating to new constructors.

Change-Id: Ib76ff216e52c7142fd822b4e7e0b5004e5d54915
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBug 981: Make sure InstanceIdentifier codec is able to deserialize all written data. 81/6881/2
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 75/6875/1
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 72/6872/4
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 71/6871/3
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 74/6874/1
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 changes Id6a27004,I7baa722d
Tony Tkacik [Sat, 10 May 2014 21:17:14 +0000 (21:17 +0000)]
Merge changes Id6a27004,I7baa722d

* changes:
  BUG-868: Move getInstance() from Registration into ObjectRegistration
  BUG-868: Require ObjectRegistration in CompositeObjectRegistration

10 years agoMerge "BUG-731: remove XmlToNodes class"
Tony Tkacik [Sat, 10 May 2014 18:45:14 +0000 (18:45 +0000)]
Merge "BUG-731: remove XmlToNodes class"

10 years agoMerge "BUG-731: StringBufferInputStream is deprecated"
Tony Tkacik [Sat, 10 May 2014 18:45:00 +0000 (18:45 +0000)]
Merge "BUG-731: StringBufferInputStream is deprecated"

10 years agoMerge "BUG-731: remove empty statement"
Tony Tkacik [Sat, 10 May 2014 18:44:27 +0000 (18:44 +0000)]
Merge "BUG-731: remove empty statement"

10 years agoMerge "BUG-731: eliminate magic constants"
Tony Tkacik [Sat, 10 May 2014 18:22:16 +0000 (18:22 +0000)]
Merge "BUG-731: eliminate magic constants"

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 "Fix InstanceIdentifier toString()"
Tony Tkacik [Sat, 10 May 2014 18:20:54 +0000 (18:20 +0000)]
Merge "Fix InstanceIdentifier toString()"

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 agoMerge "BUG-648: add missing copy builders"
Tony Tkacik [Sat, 10 May 2014 18:19:30 +0000 (18:19 +0000)]
Merge "BUG-648: add missing copy builders"

10 years agoBUG-731: remove XmlToNodes class 10/6810/2
Robert Varga [Thu, 8 May 2014 07:06:59 +0000 (09:06 +0200)]
BUG-731: remove XmlToNodes class

This is an unused class and it is a heavy offender. Let's just remove
it.

Change-Id: I04fd2f5d1426fc8bd54fe13e751845285c092a1c
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-731: StringBufferInputStream is deprecated 09/6809/2
Robert Varga [Thu, 8 May 2014 06:59:17 +0000 (08:59 +0200)]
BUG-731: StringBufferInputStream is deprecated

Change-Id: Idee23a2c94bd3e8cc1b4f8b656377f9fa087056c
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-731: remove empty statement 08/6808/2
Robert Varga [Thu, 8 May 2014 06:56:14 +0000 (08:56 +0200)]
BUG-731: remove empty statement

Change-Id: I15e1371ff6b69f4c8af2ffda81fae68c09fc6538
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-731: eliminate magic constants 07/6807/2
Robert Varga [Thu, 8 May 2014 06:54:35 +0000 (08:54 +0200)]
BUG-731: eliminate magic constants

We can use a boxed Boolean, whose hashCode() does precisely the same
thing. So let's keep magic down to a minimum.

Change-Id: Ie855a1508cc2c6b19d744dbdab04ed8794fdcd95
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-731: fix order of modifiers 06/6806/2
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: remove unneeded public modifier 05/6805/2
Robert Varga [Thu, 8 May 2014 06:26:17 +0000 (08:26 +0200)]
BUG-731: remove unneeded public modifier

Change-Id: I1890ca89060a136ca85f824cda03c96454706970
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-731: add final modifiers 04/6804/2
Robert Varga [Thu, 8 May 2014 06:18:33 +0000 (08:18 +0200)]
BUG-731: add final modifiers

These members are constants, mark them as such.

Change-Id: Ied83e05dba3dfd3cebae1afd821253796c236093
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-731: add curly braces 03/6803/2
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() 59/6859/1
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 58/6858/2
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 57/6857/1
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 51/6851/1
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 50/6850/1
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 49/6849/1
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 48/6848/1
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 47/6847/1
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 agoBUG-648: add missing copy builders 20/6820/2
Robert Varga [Thu, 8 May 2014 20:15:11 +0000 (22:15 +0200)]
BUG-648: add missing copy builders

This completes the set of initialized builders. We also complete picking
up nodeIdentifier from the passed-in node.

Change-Id: I229582457c77d9225c37f89054872abe0aeb016e
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" 13/6813/1
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 agoFix InstanceIdentifier toString() 54/6154/4
Robert Varga [Mon, 14 Apr 2014 11:34:32 +0000 (13:34 +0200)]
Fix InstanceIdentifier toString()

This fixes the issue where InstanceIdentifier.toString() would remain
empty, causing weird debug statements like:

2014-04-14 02:26:50.284 PDT [nettyThreadgroupModule$NioEventLoopGroupCloseable-6-2] TRACE o.o.c.m.s.d.s.impl.MutableDataTree - Resolving modification apply strategy for

Change-Id: Ibde143c614d49f27385da729ac4054627e601b57
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-868: Move getInstance() from Registration into ObjectRegistration 88/5688/8
Robert Varga [Wed, 19 Mar 2014 16:08:51 +0000 (17:08 +0100)]
BUG-868: Move getInstance() from Registration into ObjectRegistration

This finishes up the conversion of Registration into an
object-independent concept.

Change-Id: Id6a27004de23ca6faff31303304e1171a8552d9f
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-868: Require ObjectRegistration in CompositeObjectRegistration 87/5687/8
Robert Varga [Wed, 19 Mar 2014 15:54:55 +0000 (16:54 +0100)]
BUG-868: Require ObjectRegistration in CompositeObjectRegistration

With Registration becoming an abstract concept, force users to use
ObjectRegistration.

Change-Id: I7baa722d2adf3e399a0c477b303983b92fbd5fcf
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoRemove unused imports 39/6039/6
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 86/6786/3
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 78/6778/3
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. 81/6781/3
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 "BUG-592: Introduce InstanceIdentifier.relativeTo()"
Tony Tkacik [Wed, 7 May 2014 12:24:25 +0000 (12:24 +0000)]
Merge "BUG-592: Introduce InstanceIdentifier.relativeTo()"

10 years agoBUG-731: do not throw declared Exception 77/6777/2
Robert Varga [Wed, 7 May 2014 08:54:36 +0000 (10:54 +0200)]
BUG-731: do not throw declared Exception

Change-Id: Icbd9e700873702bcf3a8acfd066820263dd9f2ff
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "BUG-731: do not use raw exceptions"
Tony Tkacik [Wed, 7 May 2014 11:08:40 +0000 (11:08 +0000)]
Merge "BUG-731: do not use raw exceptions"

10 years agoMerge "BUG-731: remove empty while() loop"
Tony Tkacik [Wed, 7 May 2014 11:08:32 +0000 (11:08 +0000)]
Merge "BUG-731: remove empty while() loop"

10 years agoMerge "BUG-731: remove unused methods"
Tony Tkacik [Wed, 7 May 2014 11:08:23 +0000 (11:08 +0000)]
Merge "BUG-731: remove unused methods"

10 years agoBUG-592: Introduce InstanceIdentifier.relativeTo() 37/6037/5
Robert Varga [Thu, 10 Apr 2014 21:32:03 +0000 (23:32 +0200)]
BUG-592: Introduce InstanceIdentifier.relativeTo()

This centralizes another useful utility method.

Change-Id: Ifbc1dbb08150ff1d9805f27bad3416b5f1afece0
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-731: do not use raw exceptions 76/6776/1
Robert Varga [Wed, 7 May 2014 08:43:53 +0000 (10:43 +0200)]
BUG-731: do not use raw exceptions

Instead of throwing Exception, but use Preconditions. Also remove
declaration of Exception being thrown, and throw concrete exceptions.

Change-Id: I861e7c6d93080ba01ef9474ccd9dbf1b443f9e2d
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-731: remove empty while() loop 75/6775/1
Robert Varga [Wed, 7 May 2014 08:29:36 +0000 (10:29 +0200)]
BUG-731: remove empty while() loop

This loop is completely unused, as it just busy-waits on the same
condition, which is implied by Future.get().

Also fix generic parameter naming clash while we're here.

Change-Id: I9b43e9db7b018459ddf925369ac7fa323f0173e0
Signed-off-by: Robert Varga <rovarga@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 agoBUG-731: remove unused methods 74/6774/1
Robert Varga [Wed, 7 May 2014 08:23:50 +0000 (10:23 +0200)]
BUG-731: remove unused methods

This removes unused private contructor and superfluous equals() methods.

Change-Id: I3bf31ebfbce92c55a04491d88229a7d1d469c073
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-865: removed unnecessary test file. 71/6771/1
Martin Vitez [Wed, 7 May 2014 08:17:21 +0000 (10:17 +0200)]
BUG-865: removed unnecessary test file.

Removed ietf-inet-types yang model which is needless for testing groupings.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoAdd ietf-inet-types@2013-07-15 and ietf-yang-types@2013-07-15. Rename 57/6757/1
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 identity-ref leaves 24/6624/2
Maros Marsalek [Wed, 30 Apr 2014 13:00:02 +0000 (15:00 +0200)]
BUG-832 Fix deserialization of identity-ref leaves

Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
10 years agoBUG-832 Fix deserialization of Empty type leaves. 21/6621/3
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-114: added artifact version check in yang-maven-plugin. 24/6724/2
Martin Vitez [Wed, 30 Apr 2014 09:35:14 +0000 (11:35 +0200)]
BUG-114: added artifact version check in yang-maven-plugin.

This patch bypasses use of maven aether due to version incompatibility between maven 3.0.x and 3.1.x.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
Change-Id: If1c09a59353ef32a320131f7cbdbe92aa66acae2

10 years agoAdd a feature directory for yangtools that could support karaf 63/6663/6
Ed Warnicke [Fri, 2 May 2014 18:45:12 +0000 (13:45 -0500)]
Add a feature directory for yangtools that could support karaf

Many thanks to Heath Kesler <heath@gmail.com> who did most of the real
work :)

Change-Id: Idae8bdd6c96477a0ecd186269247eefcca40a764
Signed-off-by: Ed Warnicke <eaw@cisco.com>
10 years agoBUG-592: introduce InstanceIdentifier.child() 36/6036/4
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-592: Format BI InstanceIdentifier 34/6034/2
Robert Varga [Wed, 30 Apr 2014 15:55:59 +0000 (17:55 +0200)]
BUG-592: Format BI InstanceIdentifier

This is the initial commit which formats the file, adding final keywords
and fixing missing braces, etc. No functional change is made.

Change-Id: Iccef8d2e7d80621ecd7fb077202eb19ecf09727b
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG 274 nicer formating of output error message 59/6359/2
Jozef Gloncak [Thu, 24 Apr 2014 14:05:21 +0000 (16:05 +0200)]
BUG 274 nicer formating of output error message

Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
10 years agoRevert "Fix for Bug 114." 10/6610/1
Martin Vitez [Wed, 30 Apr 2014 07:14:51 +0000 (09:14 +0200)]
Revert "Fix for Bug 114."

This reverts commit 47538f5568578658ba89f62281a46bab28e81974.

Signed-off-by: Martin Vitez <mvitez@cisco.com>
10 years agoBug 527: fixed augment deserialization from xml. 01/6001/16
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>