Robert Varga [Thu, 3 Jul 2014 21:17:59 +0000 (23:17 +0200)]
Do not use "".equals(String)
This is an ugly shorthand for String.isEmpty(), so let's not use it.
Change-Id: I6f00cc0676f982e99690294a11e703832b404977
Signed-off-by: Robert Varga <rovarga@cisco.com>
Tony Tkacik [Thu, 3 Jul 2014 11:59:46 +0000 (11:59 +0000)]
Merge "BUG-1119: optimize length and range checks in generated sources."
Tony Tkacik [Thu, 3 Jul 2014 11:55:58 +0000 (11:55 +0000)]
Merge "BUG-597: removed dependency on GeneratedTOBuilderImpl from BindingGeneratorUtil to break a package cycle."
Tony Tkacik [Thu, 3 Jul 2014 11:52:17 +0000 (11:52 +0000)]
Merge "BUG-1143: binding-generator-impl: tests refactoring."
Robert Varga [Wed, 2 Jul 2014 10:58:22 +0000 (12:58 +0200)]
BUG-1275: do not copy arrays in XmlDocumentUtilsforEachChild()
ImmutableList.Builder() has a nasty habit of performing poorly for
anything that is larger than 2 elements. Let's elide it by following
smarts:
- check if the list of children is empty
- pre-allocate an arraylist, thus copying the array at most once
Change-Id: I08825e15fba92e256bd415c192d3f30d52d6d8eb
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Wed, 2 Jul 2014 11:17:41 +0000 (13:17 +0200)]
Optimize BindingGeneratorUtil.parseToCamelCase()
This replaces the relatively expensive replace operation with
CharMatcher.removeFrom().
Change-Id: I74123797427c76b3584394a3a203500bb9dea73b
Signed-off-by: Robert Varga <rovarga@cisco.com>
Martin Vitez [Wed, 2 Jul 2014 11:03:20 +0000 (11:03 +0000)]
Merge "BUG-868: do not use InstanceIdentifier constructor"
Robert Varga [Wed, 2 Jul 2014 08:37:43 +0000 (10:37 +0200)]
BUG-868: do not use InstanceIdentifier constructor
Change-Id: Iffe519a5720d50c3ad6a88c747e36019507b6781
Signed-off-by: Robert Varga <rovarga@cisco.com>
Tony Tkacik [Wed, 2 Jul 2014 08:22:57 +0000 (08:22 +0000)]
Merge "Improvements REST documentation generation"
Martin Vitez [Thu, 12 Jun 2014 10:46:14 +0000 (12:46 +0200)]
BUG-597: removed dependency on GeneratedTOBuilderImpl from BindingGeneratorUtil to break a package cycle.
Change-Id: I6dfbf217982e1128ab22db70af261ade250642c3
Signed-off-by: Martin Vitez <mvitez@cisco.com>
Martin Vitez [Tue, 10 Jun 2014 13:40:43 +0000 (15:40 +0200)]
BUG-1119: optimize length and range checks in generated sources.
Constraints are generated only once (by double-checked locking) and stored as immutable static variable.
BigInteger and BigDecimal values 0, 1 and 10 are represented as Big*.ZERO, ONE or TEN.
BigInteger values are created via BigInteger.valueOf(long) call.
Change-Id: Idb54d841fe64fd5a32af38b30126a314d6bc7a0d
Signed-off-by: Martin Vitez <mvitez@cisco.com>
Martin Vitez [Fri, 27 Jun 2014 08:00:38 +0000 (10:00 +0200)]
BUG-1143: binding-generator-impl: tests refactoring.
Optimalized existing tests, removed useless test files.
Change-Id: I5dbe03b66b6d3251b87bc9eb1f1c89ebe6f03c3d
Signed-off-by: Martin Vitez <mvitez@cisco.com>
Martin Vitez [Wed, 2 Jul 2014 07:45:26 +0000 (07:45 +0000)]
Merge "RevisionIdentifier.getDefaultInstance() is static"
Tony Tkacik [Tue, 1 Jul 2014 14:51:27 +0000 (14:51 +0000)]
Merge "Bug 762: Verify input in typedef codecs"
Robert Varga [Tue, 1 Jul 2014 14:13:00 +0000 (16:13 +0200)]
RevisionIdentifier.getDefaultInstance() is static
This fixes warnings about static method being invoked on an instance,
plus it removes the now-unused instance.
Change-Id: I7c4594908d6b3a5c10e9b3f12e32ca203d3aa3d2
Signed-off-by: Robert Varga <rovarga@cisco.com>
Tony Tkacik [Tue, 1 Jul 2014 14:48:35 +0000 (14:48 +0000)]
Merge "Cleanup pom.xml"
Tony Tkacik [Tue, 1 Jul 2014 14:46:36 +0000 (14:46 +0000)]
Merge "BUG-994: use SchemaPath.getPathTowardRoot()"
Robert Varga [Tue, 1 Jul 2014 14:08:37 +0000 (16:08 +0200)]
Cleanup pom.xml
This cleans up eclipse warnings about duplicate groupIds and overriding
versions.
Change-Id: Id920e7bb01814c5184f1157b093e3f449cfdf955
Signed-off-by: Robert Varga <rovarga@cisco.com>
Martin Vitez [Tue, 1 Jul 2014 14:07:31 +0000 (16:07 +0200)]
BUG-865: removed deprecated code from binding-java-api-generator tests.
Fixed warning in ClassTemplate.xtend.
Change-Id: I4add39082ab10c8b8ddb6dc7c4062470b198e2f6
Signed-off-by: Martin Vitez <mvitez@cisco.com>
Robert Varga [Thu, 26 Jun 2014 17:43:13 +0000 (19:43 +0200)]
BUG-994: use SchemaPath.getPathTowardRoot()
Instead of dereferencing the old API, use the new API, which gives the
same information more conveniently.
Change-Id: I485bae608bfb4aa1f6dae9838458a58ff4b23793
Signed-off-by: Robert Varga <rovarga@cisco.com>
Martin Vitez [Tue, 1 Jul 2014 12:35:16 +0000 (12:35 +0000)]
Merge "Bug 1027: Decreased log level from INFO to DEBUG."
Tomas Olvecky [Wed, 18 Jun 2014 13:16:35 +0000 (15:16 +0200)]
Bug 1198: Make URLSchemaContextResolver thread safe
Make YangModelParser interface deprecated as recommended methods are in
YangContextParser.
yang-parser-impl - Introduce dependency on findbugs for documentation.
URLSchemaContextResolver - first round of refactoring, add
synchronized everywhere where data is changed.
Change-Id: Id53f165740301d085ad8374fc02897a0a19faa38
Signed-off-by: Tomas Olvecky <tolvecky@cisco.com>
Tony Tkacik [Tue, 1 Jul 2014 09:20:33 +0000 (09:20 +0000)]
Merge "BUG 428 remove importing unnecessary imports"
Ladislav Borak [Tue, 1 Jul 2014 08:27:58 +0000 (10:27 +0200)]
Improvements REST documentation generation
Signed-off-by: Ladislav Borak <lborak@cisco.com>
Tony Tkacik [Mon, 30 Jun 2014 12:57:28 +0000 (14:57 +0200)]
Bug 1027: Decreased log level from INFO to DEBUG.
Change-Id: I79452e344c23aa593505ac41337c9d9306b6f1d5
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Jozef Gloncak [Mon, 28 Apr 2014 11:41:40 +0000 (13:41 +0200)]
BUG 428 remove importing unnecessary imports
List of imports is created from all GeneratedTypes which were used while
generating interface or class.
Fully qualified name is always used for classes which belongs to
java.lang.* package
Change-Id: I14dcf1bd852ef596c6001c5bf2ffeac9a65d962b
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
tpantelis [Tue, 27 May 2014 17:07:42 +0000 (13:07 -0400)]
Bug 762: Verify input in typedef codecs
- Modified the Bits, Union, Enum, and Empty TypeDefinitionAwareCodecs to
verify
the input in the deserialize method and throw IllegalArgEx if invalid.
- Modified IdentityCompositeCodec to throw IllegalArgEx if input not
found in identity map.
- Added unit tests to cover all the TypeDefinitionAwareCodec-derived
classes.
Change-Id: I10e963b83bfb9e4200f3ea0e77cd41bd48d04474
Signed-off-by: tpantelis <tpanteli@brocade.com>
Tony Tkacik [Thu, 26 Jun 2014 13:46:20 +0000 (13:46 +0000)]
Merge "BUG-1201: make yangtools compilable with java 8."
Tony Tkacik [Thu, 26 Jun 2014 12:15:05 +0000 (14:15 +0200)]
Fixed leak of LazyGeneratedCodecRegistry between restarts of service.
LocationAwareDispatch codecs was inner classes referencing
their parent and between tests leaked incorrect order context.
Updated their implementation, to take latest LazyGeneratedCodecRegistry.
This still assumes there is only one registry at a time
per classloader space.
Change-Id: I1ae58e1c4dd90914893e61172b6d171b458d2ba2
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Martin Vitez [Wed, 25 Jun 2014 10:03:32 +0000 (10:03 +0000)]
Merge "Bug 1203: Reset state of LocationDispatchCodecs"
Tony Tkacik [Wed, 18 Jun 2014 14:09:09 +0000 (16:09 +0200)]
Bug 1203: Reset state of LocationDispatchCodecs
LocationDispatchCodecs must react to schema
context change, which may introduce changes
of locations, in which they are used.
This actually requires reinitialization of these
codecs (cases, augmentations) in order to discover
newly introduced case classes or augmentation classes
or to disable unload ones.
Initialization of codecs is done lazily and uses
same code-path as their first use.
Change-Id: I621edcfbe4bd29612e3358aa2e507b14e3002524
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Robert Varga [Wed, 18 Jun 2014 09:59:40 +0000 (11:59 +0200)]
BUG-1201: make yangtools compilable with java 8.
Changed collection sorting in xtend classes.
Added maven profile to parent pom which is activated in java 8 environment to turn off DocLint.
Change-Id: Ief9dbaf9e029e653e337bf86740cdad0d07734f3
Signed-off-by: Robert Varga <rovarga@cisco.com>
Tony Tkacik [Tue, 24 Jun 2014 07:23:42 +0000 (07:23 +0000)]
Merge "Checkstyle maven plugin check - yangtools"
Tony Tkacik [Tue, 24 Jun 2014 07:21:09 +0000 (07:21 +0000)]
Merge "BUG-579: removed dependency on GeneratedTOBuilderImpl from Types to break a package cycle."
Milos Fabian [Wed, 4 Jun 2014 14:56:43 +0000 (16:56 +0200)]
Checkstyle maven plugin check - yangtools
-violations do not fail build
-rules defined in yangtools/common/checkstyle-logging
https://git.opendaylight.org/gerrit/#/c/7595/
https://git.opendaylight.org/gerrit/#/c/7108/
Change-Id: I26bfa119f3484444fe33d47640db7407f9a3cd55
Signed-off-by: Milos Fabian <milfabia@cisco.com>
Tony Tkacik [Mon, 23 Jun 2014 16:16:52 +0000 (16:16 +0000)]
Merge "Extract typedefs to local variable to avoid error in xtend generated class."
Martin Vitez [Thu, 12 Jun 2014 07:21:58 +0000 (09:21 +0200)]
BUG-579: removed dependency on GeneratedTOBuilderImpl from Types to break a package cycle.
Signed-off-by: Martin Vitez <mvitez@cisco.com>
Martin Vitez [Mon, 26 May 2014 12:14:42 +0000 (14:14 +0200)]
Extract typedefs to local variable to avoid error in xtend generated class.
Change-Id: If58153836a3e619be51f5eeedce44e9f92076f47
Signed-off-by: Martin Vitez <mvitez@cisco.com>
Robert Varga [Thu, 19 Jun 2014 18:00:01 +0000 (20:00 +0200)]
BUG-582: optimize TypeProviderImpl
This just replaces obvious string misuses with more-performant
replacements.
Change-Id: Ib8fe7a3a40e3fe9fa78d3eec2f83c1341040a937
Signed-off-by: Robert Varga <rovarga@cisco.com>
Tony Tkacik [Wed, 4 Jun 2014 13:54:22 +0000 (15:54 +0200)]
BUG 1131: untangling package cyclic dependencies in yang-parser-impl
This untanglement of package cyclic dependencies introduced
better code organization, when more-obvious components
logical blocks are available, most of moved classes
were private to parser and was never meant for public consumption.
- yang.model.util - Utility and simple implementations of yang-model-api
- yang.parser.builder.* - Builders for yang-model-api with
semantic functionality
- yang.parser.impl - Actual implementation of YANG Parser
- yang.parser.impl.util - Utility functions on top of YANG Parser
- yang.parser.util - Utility classes, potential candidates for movements.
Change-Id: Ia5718f4712d91df7cea0f55d4cc1a502d376faea
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
Tony Tkacik [Fri, 20 Jun 2014 14:15:05 +0000 (14:15 +0000)]
Merge "BUG-582: pre-cache Pattern instances"
Tony Tkacik [Fri, 20 Jun 2014 14:14:54 +0000 (14:14 +0000)]
Merge "Introduce HashCodeBuilder"
Maros Marsalek [Fri, 20 Jun 2014 11:11:33 +0000 (13:11 +0200)]
BUG-944 Fix HostBuilder class conflict for domain/ipv4 address
Ipv4 addresses were matched by ipv4 as well as domain-name pattern in HostBuilder class, which caused a conflict.
Now ipv4 pattern is prefered to domain-name.
Change-Id: Ia449d247c04747d6ca50856f92d3aa77b581e60f
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Robert Varga [Sun, 8 Jun 2014 20:41:12 +0000 (22:41 +0200)]
BUG-582: pre-cache Pattern instances
In a few places we did not cache the regex patters we used, resulting in
sub-optimal performance. This patch corrects that, moving them as close
to being static as possible.
Change-Id: I5edb8c1f33dff9178a0101fbb8fa71a6a3237aab
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Sat, 7 Jun 2014 20:13:00 +0000 (22:13 +0200)]
Introduce HashCodeBuilder
This patch moves HashCodeBuilder, and internal yang-binding utility
class, into the util package and make it public.
The class was originally used to incrementally create InstanceIdentifier
hash code. As it turns out, we have at least two other potential users,
who could benefit from that same pattern: SchemaPath and the data-api
InstanceIdentifier, since they really are just different views on the
same concept.
Change-Id: I6a3208de213a47a2ed98e64f73a883dca73034fc
Signed-off-by: Robert Varga <rovarga@cisco.com>
Martin Vitez [Wed, 18 Jun 2014 16:08:07 +0000 (18:08 +0200)]
BUG-1195: made typedef classes serializable.
All classes generated from yang typedef statement now implement java.io.Serializable and contain serialVersionUID property.
Signed-off-by: Martin Vitez <mvitez@cisco.com>
Tony Tkacik [Wed, 18 Jun 2014 12:54:27 +0000 (12:54 +0000)]
Merge "BUG-582: optimize replaceWithCamelCase"
Robert Varga [Sun, 8 Jun 2014 10:23:13 +0000 (12:23 +0200)]
BUG-582: optimize replaceWithCamelCase
Optimize replaceWithCamelCase() by not instantiating a string just to do
a toUppserCase.
Also the initial character lookup is done on the original string, such
that we can elide any object instantiation if the character to be
removed is not found.
Change-Id: Iee81f1967d47a63668bf14b319a2f46715e6866b
Signed-off-by: Robert Varga <rovarga@cisco.com>
Tony Tkacik [Wed, 18 Jun 2014 09:13:04 +0000 (09:13 +0000)]
Merge "BUG-1196, Bug 886: Refactored implementation of Choice Codec"
Martin Vitez [Tue, 17 Jun 2014 11:12:13 +0000 (13:12 +0200)]
BUG-1196, Bug 886: Refactored implementation of Choice Codec
Choice Codec and instantiation of Choice Case codecs
was updated to reuse common reactive instatiation
of mixin codec provided by LocationAwareDispatchCodec
which provides utilities to retrieve all instantiation
of cases in their right context, so codecs
use corect namespaces and see only cases which
are really available in particular subtree.
Serialization of Cases was updated to
use namespace from schema context if and only
if case is added by augmentation.
Added test which test serialization / deserialization.
Change-Id: Id2ff269b6d124a35bdca7f687114d3fa123091d5
Signed-off-by: Martin Vitez <mvitez@cisco.com>
Tony Tkacik [Tue, 17 Jun 2014 19:17:52 +0000 (19:17 +0000)]
Revert "BUG-1196: fixed bug in choice case codec."
This reverts commit
92e4fd194891f567aad81f36352aaf9c80df7838.
Change-Id: I2cf16d72002fce3f8de5ff16008f62a74dc834d5
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Martin Vitez [Tue, 17 Jun 2014 11:12:13 +0000 (13:12 +0200)]
BUG-1196: fixed bug in choice case codec.
Implemented lazy generation of choice case codecs by
using DispatchChoiceCodecImpl - delegator for de/serialization
of case instances in
PublicChoiceCodecImpl. This codec is created for each interface
generated from yang choice. It contains information about all
implementations of choice-cases in context and delegate
de/serialization of concrete case instance to correct case
codec based on given InstanceIdentifier.
ChoiceCaseCodecImpl instances are created when concrete case
is encountered.
By using DispatchChoiceCodecImpl we don't need to hold
COMPOSITE_TO_CASE and CLASS_TO_CASE_MAP variables in runtime
generated codec which were
used to serialization and deserialization before.
Added test which test serialization / deserialization.
Change-Id: I52eb78f66e91695758b825b109639d039860f997
Signed-off-by: Martin Vitez <mvitez@cisco.com>
Tony Tkacik [Fri, 13 Jun 2014 11:59:40 +0000 (11:59 +0000)]
Merge "BUG-865: replaced deprecated code from binding-generator-util."
Tony Tkacik [Fri, 13 Jun 2014 11:58:11 +0000 (11:58 +0000)]
Merge changes I6b5ca1b6,Ib9703600,I5eb25590,I5ea885e0,I08ba5d2c
* changes:
BUG-1143: refactored ChoiceCaseGenTypesTest.
BUG-1143: refactored AugmentRelativeXPathTest.
BUG-1143: refactored AugmentedTypeTest.
BUG-1143: added AbstractTypesTest as base for generated types testing.
BUG-865: removed use of deprecated methods from tests.
Tony Tkacik [Fri, 13 Jun 2014 11:56:31 +0000 (11:56 +0000)]
Merge "BUG-1069: made InstanceIdentifier.PathArgument implement Comparable."
Tony Tkacik [Fri, 13 Jun 2014 11:53:38 +0000 (11:53 +0000)]
Merge "BUG-865: replaced deprecated code from yang-binding."
Martin Vitez [Thu, 12 Jun 2014 15:32:31 +0000 (17:32 +0200)]
BUG-1069: made InstanceIdentifier.PathArgument implement Comparable.
Change-Id: Ib89d5a4240205234f707290e69f29d80841e3504
Signed-off-by: Martin Vitez <mvitez@cisco.com>
Martin Vitez [Fri, 13 Jun 2014 11:24:06 +0000 (13:24 +0200)]
BUG-1143: refactored ChoiceCaseGenTypesTest.
Removed test sources which are irrelevant for choice case generated type testing.
Signed-off-by: Martin Vitez <mvitez@cisco.com>
Martin Vitez [Thu, 12 Jun 2014 11:32:29 +0000 (13:32 +0200)]
BUG-865: replaced some deprecated code from binding-type-provider.
Signed-off-by: Martin Vitez <mvitez@cisco.com>
Martin Vitez [Fri, 13 Jun 2014 10:02:38 +0000 (12:02 +0200)]
BUG-1143: refactored AugmentRelativeXPathTest.
Removed test sources which are irrelevant for relative path augment generated type testing.
Signed-off-by: Martin Vitez <mvitez@cisco.com>
Martin Vitez [Fri, 13 Jun 2014 09:37:49 +0000 (11:37 +0200)]
BUG-1143: refactored AugmentedTypeTest.
Removed test sources which are irrelevant for augment generated type testing.
Signed-off-by: Martin Vitez <mvitez@cisco.com>
Martin Vitez [Fri, 13 Jun 2014 09:11:17 +0000 (11:11 +0200)]
BUG-1143: added AbstractTypesTest as base for generated types testing.
Signed-off-by: Martin Vitez <mvitez@cisco.com>
Martin Vitez [Wed, 11 Jun 2014 15:49:20 +0000 (17:49 +0200)]
BUG-865: removed use of deprecated methods from tests.
Removed use of deprecated methods from parser in binding-generator-impl tests.
Change-Id: I08ba5d2c2abc55b818e389502512f35774a90db3
Signed-off-by: Martin Vitez <mvitez@cisco.com>
Rob Adams [Fri, 13 Jun 2014 00:52:56 +0000 (17:52 -0700)]
Bug 1193: Use format string correctly and fix corresponding unit test
as well
Change-Id: Ib05078ee9045f60cff663407aa401045ac9d885b
Signed-off-by: Rob Adams <readams@readams.net>
Martin Vitez [Thu, 12 Jun 2014 13:03:19 +0000 (15:03 +0200)]
BUG-865: replaced deprecated code from yang-binding.
Removed groupId declaration from pom (duplicate of parent groupId).
Signed-off-by: Martin Vitez <mvitez@cisco.com>
Martin Vitez [Thu, 12 Jun 2014 11:45:10 +0000 (13:45 +0200)]
BUG-865: replaced deprecated code from binding-generator-util.
Signed-off-by: Martin Vitez <mvitez@cisco.com>
Martin Vitez [Wed, 11 Jun 2014 14:02:12 +0000 (16:02 +0200)]
BUG-1172: nested uses-augmentation fails in code-generation phase.
Added test case.
Change-Id: I22e506fcaf4f643f5cecb995e3e5f0e5d8ef1fa8
Signed-off-by: Martin Vitez <mvitez@cisco.com>
Tony Tkacik [Mon, 9 Jun 2014 12:41:50 +0000 (12:41 +0000)]
Merge "Fixed mismatch in ietf-restconf-version variable"
Giovanni Meo [Mon, 9 Jun 2014 07:11:25 +0000 (09:11 +0200)]
Fixed mismatch in ietf-restconf-version variable
- ietf-restconf-version is defined to be 2013.09.04.1-SNAPSHOT while
the module is defined to be 2013.10.19.1-SNAPSHOT. The mismatch causes
issue in the usage as well in the releasing process
Change-Id: Ieee018314370416fc3ba37e0f7f7eb2f1f55c06b
Signed-off-by: Giovanni Meo <gmeo@cisco.com>
Robert Varga [Fri, 6 Jun 2014 15:03:05 +0000 (15:03 +0000)]
Merge "bug 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>
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>
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>
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>
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>
Tony Tkacik [Fri, 6 Jun 2014 08:24:42 +0000 (08:24 +0000)]
Merge "Improved sorting of augmentations before code generation."
Robert Varga [Mon, 2 Jun 2014 15:18:23 +0000 (15:18 +0000)]
Merge "Bug 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>
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."
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>
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>
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: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 [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 [Mon, 26 May 2014 19:32:20 +0000 (19:32 +0000)]
Merge "BUG-868: stop using getChildren()"
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 [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: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>
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 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>