Robert Varga [Tue, 27 May 2014 15:58:27 +0000 (17:58 +0200)]
BUG-648: use MapAdaptor
This converts the un-ordered nodes to using the MapAdaptor utility,
which should result in reductions to the amount of copies being made.
Change-Id: I9a427d97d18534a6fb76cb52e4fde59dcd54e9c4
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Wed, 28 May 2014 19:59:02 +0000 (21:59 +0200)]
BUG-648: fix util building
It turns out that the util package had incorrect build instructions,
resulting in unresolved dependencies. Fix that.
Change-Id: I3ba8ecc5070b2d7aa1804f52511437cca6e504d9
Signed-off-by: Robert Varga <rovarga@cisco.com>
Tony Tkacik [Wed, 28 May 2014 15:14:21 +0000 (15:14 +0000)]
Merge "Fixed setting yang sources to modules."
Robert Varga [Tue, 27 May 2014 11:40:19 +0000 (13:40 +0200)]
BUG-648: Create MapAdaptor and friends
This introduces the MapAdaptor class, which allows transforming one Map
implementation to another, balancing the isolation and access patterns.
The core of the idea is that we are using patterns which would benefit
from persistent structures where we can take a point-in-time stable
snapshot, update it and publish the new version all the while clients
accessing the old version suspect nothing. So far we have implemented
the isolation by copying maps around -- which is fine as long as there
are not too many elements.
We do have a persistent strucutre (Ctrie), which allows snapshot and
isolation to happen in O(1), but exacts heavy price on access due to
volatile variables.
Change-Id: I4b745eecc5a915862ab75921703cfce3c2747ab6
Signed-off-by: Robert Varga <rovarga@cisco.com>
Martin Vitez [Wed, 21 May 2014 09:57:57 +0000 (11:57 +0200)]
Fixed setting yang sources to modules.
Change-Id: I2f3a070fd3afcb49ac3ecc9ce232fd7f299be71b
Signed-off-by: Martin Vitez <mvitez@cisco.com>
Tony Tkacik [Wed, 28 May 2014 08:43:43 +0000 (08:43 +0000)]
Merge "BUG-864: decrease log level when sorting and parsing modules"
Tony Tkacik [Wed, 28 May 2014 08:42:36 +0000 (08:42 +0000)]
Merge "BUG-973: fixed (de)serialization of union type."
Tony Tkacik [Tue, 27 May 2014 13:56:36 +0000 (13:56 +0000)]
Merge "BUG-1070: split off YangSourceContext"
Tony Tkacik [Tue, 27 May 2014 13:54:14 +0000 (13:54 +0000)]
Merge "BUG-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>
Robert Varga [Sun, 25 May 2014 17:47:55 +0000 (19:47 +0200)]
BUG-1070: split off YangSourceContext
This patch just splits up the various static classes out of
YangSourceContext, making the structure more navigable.
Change-Id: I26c973ebe6d931d870e22d5965ba7baab0cc24e9
Signed-off-by: Robert Varga <rovarga@cisco.com>
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>
Tony Tkacik [Tue, 27 May 2014 07:39:09 +0000 (09:39 +0200)]
Bug 1076: Updated SchemaPath hashcode to behave as previously.
Change in hashCode of SchemaPath uncovered other issue
where code was expecting sorted set from HashSet.
Updated hashCode to behave as previously defined.
Change-Id: I2eea3b5890f985553127e11b50143d7714313ced
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Tony Tkacik [Mon, 26 May 2014 22:39:17 +0000 (22:39 +0000)]
Merge "BUG-582: use shared thread-safe SimpleDateFormat"
Tony Tkacik [Mon, 26 May 2014 22:38:48 +0000 (22:38 +0000)]
Merge "BUG-1070: introduce YangSyntaxErrorException"
Robert Varga [Sun, 25 May 2014 15:50:59 +0000 (17:50 +0200)]
BUG-582: use shared thread-safe SimpleDateFormat
This concentrates the per-parser DateTimeFormat into the pre-existing
yang-common one, lowering resource parser resource usage, while
remaining thread-safe.
Change-Id: I30d677ba4c66196bb5df551349c1d8abc31702b9
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sun, 25 May 2014 10:29:57 +0000 (12:29 +0200)]
BUG-1070: introduce YangSyntaxErrorException
This introduces a proper checked exception, which is trown when a
syntactic error is encountered during parsing of the YANG module text.
Change-Id: If7445edce99d60306bad98e61b34d09c5bf06eb1
Signed-off-by: Robert Varga <rovarga@cisco.com>
Tony Tkacik [Mon, 26 May 2014 19:35:23 +0000 (19:35 +0000)]
Merge "BUG-994: introduce SchemaPath.create() and friends"
Tony Tkacik [Mon, 26 May 2014 19:33:57 +0000 (19:33 +0000)]
Merge changes Ib8372167,I1b7aeca9
* changes:
BUG-382: optimize BooleanType
BUG-582: optimize BinaryType
Tony Tkacik [Mon, 26 May 2014 19:32:20 +0000 (19:32 +0000)]
Merge "BUG-868: stop using getChildren()"
Martin Vitez [Wed, 21 May 2014 13:08:11 +0000 (15:08 +0200)]
BUG-864: decrease log level when sorting and parsing modules
Decrease log level from debug to trace.
Change-Id: Ife96f80a88efa067745f4853bf521878c91919e3
Signed-off-by: Martin Vitez <mvitez@cisco.com>
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>
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>
Robert Varga [Mon, 26 May 2014 08:39:26 +0000 (10:39 +0200)]
BUG-382: optimize BooleanType
This optimizes the BooleanType definition, reducing it's class memory
footprint.
Change-Id: Ib837216703e5ab19cefd3604a2caa185b7733cbd
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Mon, 26 May 2014 08:30:09 +0000 (10:30 +0200)]
BUG-582: optimize BinaryType
This optimizes the defintion of BinaryType, such that it is smaller and
faster.
Change-Id: I1b7aeca92823743e0fd1995ac4476a3e3cf26698
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sun, 25 May 2014 08:19:48 +0000 (10:19 +0200)]
BUG-868: Eliminate StringBufferInputStream
StringBufferInputStream has been deprected since JDK 1.1 -- so let's not
use it.
Change-Id: Ic436c5082e58ced632957b439ef7bca5412cf583
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sun, 25 May 2014 06:32:26 +0000 (08:32 +0200)]
BUG-582: Use Splitter instead of String.split()
String.split() instantiates a pattern, which in itself is not efficient.
Splitters are a lot more efficient, so let's use one in this codepath.
Change-Id: I896c3e743a6c21041af027f7512e21f5b5533e03
Signed-off-by: Robert Varga <rovarga@cisco.com>
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>
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>
Robert Varga [Sat, 24 May 2014 07:37:53 +0000 (09:37 +0200)]
BUG-582: reuse SimpleDataTimeUtil
Thisreuses the already-existing thread-local safe formatter, squeezing
extra performance in this path.
Change-Id: I4f57f8f462cd2f1b82c9c2cd312f375461b312b5
Signed-off-by: Robert Varga <rovarga@cisco.com>
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>
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>
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>
Robert Varga [Fri, 23 May 2014 21:43:44 +0000 (23:43 +0200)]
BUG-582: Sort modules on initialization
Rather than sorting them each time they are accessed, pay the price
upfront and create a sorted view of modules.
Change-Id: Ib8e02c930f936bf1354d1f7849a72ef8f8698625
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Fri, 23 May 2014 21:28:12 +0000 (23:28 +0200)]
BUG-582: Optimize SchemaContextImpl.findModuleByNamespace()
This is by far the hottest method, taking full 10 seconds from the
startup. Optimizing it looks simple enough: just create a SetMultimap
and precompute the URI->Module mappings.
Change-Id: Icf9b42424a083f665911c5b3a8853c38662b1e87
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sat, 24 May 2014 08:10:30 +0000 (10:10 +0200)]
BUG-1070: log exceptions
When we fail to construct a schema context, we do not log any sensible
cause at all, leaving not nearly enough evidence to pin down the
problem. Step one is to start reporting thrown exceptions.
Change-Id: Ie8ccc8f77eb18dfc385d13b81b5c5094866df177
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Fri, 23 May 2014 18:21:34 +0000 (20:21 +0200)]
BUG-868: add deprecation hint
This just adds the hint for users to know where to migrate to.
Change-Id: I33ae1097c1b35f7d5459d90f9c7a3efae6314b0b
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Fri, 23 May 2014 18:25:15 +0000 (18:25 +0000)]
Merge "Checkstyle logging rules"
Robert Varga [Wed, 21 May 2014 18:38:44 +0000 (20:38 +0200)]
BUG-994: introduce SchemaPath.create() and friends
This introduces a proper static constructor method, which does not
necesssarily have to allocate a new object. It also does not require an
explicit list as initializer, giving more flexibility to both users and
implementation itself.
Also introduces a couple of utility methods which make manipulating
SchemaPath easier.
This patch obsoletes the public contructor and getPath() method.
Change-Id: I4ec49d4336f4c30a9732c0bd95650e19c5d5e3f2
Signed-off-by: Robert Varga <rovarga@cisco.com>
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>
Tony Tkacik [Tue, 20 May 2014 16:11:12 +0000 (16:11 +0000)]
Merge "BUG-580: Improved parsing."
Tony Tkacik [Tue, 20 May 2014 13:35:46 +0000 (13:35 +0000)]
Merge "BUG-990: fixed deserialization of enums."
Tony Tkacik [Tue, 20 May 2014 13:34:04 +0000 (13:34 +0000)]
Merge "BUG-865: removed use of deprecated parseToClassName method."
Tony Tkacik [Tue, 20 May 2014 13:23:59 +0000 (13:23 +0000)]
Merge "BUG-865: removed unused code."
Tony Tkacik [Tue, 20 May 2014 13:18:00 +0000 (13:18 +0000)]
Merge "Bug 571 - Throwing an exception to fail the build when the outputBaseDir is null in the pom.xml"
Tony Tkacik [Tue, 20 May 2014 13:06:10 +0000 (13:06 +0000)]
Merge "BUG-994: Create QNameModule for resource sharing"
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"
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>
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>
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>
Tony Tkacik [Tue, 20 May 2014 08:05:02 +0000 (08:05 +0000)]
Merge "BUG-509: InstanceIdentifier should be Comparable"
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>
Mayank Agarwal [Mon, 19 May 2014 18:44:37 +0000 (11:44 -0700)]
Bug 571 - Throwing an exception to fail the build when the outputBaseDir is null in the pom.xml
Also modifying the pom.xmls of tests to specify the outputBaseDir
Change-Id: Ic149ee6d65c225af302eba80cb1d30469a47ade5
Signed-off-by: Mayank Agarwal <mayagarw@cisco.com>
Robert Varga [Mon, 19 May 2014 18:04:35 +0000 (18:04 +0000)]
Merge "Improved 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>
Robert Varga [Mon, 19 May 2014 15:58:27 +0000 (15:58 +0000)]
Merge "Bug 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>
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>
Milos Fabian [Fri, 16 May 2014 10:11:22 +0000 (12:11 +0200)]
Checkstyle logging rules
added rules:
-avoid using printStackTrace
-avoid using System.out|err.print
-logger must be declared as "private static final"
-no more than one logger declared
-avoid using string concatenation in log message
-logger variable name must be "LOG"
-LoggerFactory#getLogger input Class type parameter is equal to wrapping class name.
-logger must be Slf4j
-log message placeholders count equals to parameters count following (excluding exception type param.)
Change-Id: I6da0c22d80de032eb047b4ca8776f2a38c4a4959
Signed-off-by: Milos Fabian <milfabia@cisco.com>
Tony Tkacik [Mon, 19 May 2014 09:59:40 +0000 (09:59 +0000)]
Merge "BUG-987: improve generated type allocation"
Robert Varga [Tue, 13 May 2014 22:26:20 +0000 (00:26 +0200)]
BUG-994: Create QNameModule for resource sharing
This splits out the per-module invariants out of QName into a separate
class, QNameModule. This simplifies the QName logic quite a bit and
allows sharing of QNameModule in the future.
As a cleanup we get rid of static imports and improve exception texts.
Change-Id: Ic2651fe12f1982360afcfae0549cdee426de1556
Signed-off-by: Robert Varga <rovarga@cisco.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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."
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>
Tony Tkacik [Fri, 16 May 2014 15:42:18 +0000 (15:42 +0000)]
Merge "BUG-1023: fix warnings emitted during loading of OF13 models"
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>
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>
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>
Robert Varga [Thu, 15 May 2014 10:12:41 +0000 (12:12 +0200)]
BUG-509: InstanceIdentifier should be Comparable
This patch does several things in one go:
It guards InstanceIdentifiers which are not permitted to have an empty
nodeType with a checkNotNull().
Based on that it optimizes NodeIdentifier.hashCode() and makes it
implement Comparable interface, which is trivial givven that QName
already implements it.
Change-Id: Ib249034fba875df7ad0455786b74c908d80893fb
Signed-off-by: Robert Varga <rovarga@cisco.com>
Tony Tkacik [Thu, 15 May 2014 06:56:59 +0000 (06:56 +0000)]
Merge "Fix a warning generic warning"
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>
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>
Tony Tkacik [Tue, 13 May 2014 15:02:23 +0000 (15:02 +0000)]
Merge "BUG-987: optimize illegal character search"
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>
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>
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
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>
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"
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>
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>
Tony Tkacik [Mon, 12 May 2014 14:31:06 +0000 (14:31 +0000)]
Merge "Memory hog: ImmutableList is appropriate here"
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>
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>
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>
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>
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>
Tony Tkacik [Mon, 12 May 2014 07:06:14 +0000 (07:06 +0000)]
Merge "BUG-865: removed unnecessary test file."
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>
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>
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>
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>
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>