Robert Varga [Wed, 27 May 2015 20:00:18 +0000 (22:00 +0200)]
BUG-1485: switch ClassTemplate to new range enformcement
Switch range checks for simple classes (typedefs and similar) to the new
range checker. Also move printRangeConstraint() from BaseTemplate to
BuilderTemplate, as it ends up being used only there.
Change-Id: I16e4c1faf239d838ff415c0173ef3d06acc61701
Signed-off-by: Robert Varga <[email protected]>
(cherry picked from commit
02e503a09314f2e3192b85ed9fccaff5efb4942c)
Robert Varga [Thu, 28 May 2015 23:50:23 +0000 (01:50 +0200)]
BUG-1485: optimize primitive range checks
When we are dealing with a primitive type, we can force unboxing of the
type by declaring the range checker method's argument as the primitive
type. This will result in the stack not containing references for the
fast path (e.g. successful check) as well as reduce the number of
virtual calls to one. Checks will then be performed using primitive
manipulation instructions, which should result in better fast-path
execution.
The slow path will take a hit, as for throwing the exception, we will
end up re-boxing the primitive type.
Change-Id: I7e6b0e25790f9a43dc99f2fc7426bb9fe25c505c
Signed-off-by: Robert Varga <[email protected]>
(cherry picked from commit
9b5366d775b93f0e2a37f028cda11832ba65ce6d)
Robert Varga [Thu, 28 May 2015 14:57:20 +0000 (16:57 +0200)]
BUG-1485: make AbstractRangeGenerator deal with GTOs
For enforcement of ranges in builders, we will need to deal with types
other than ConcreteType. Also clean up internal interfaces, add some
javadocs and remove some trailing whitespace.
Also perform Number class conversion silently if it does not result in
loss of precision. Emit a warning if it does.
Change-Id: I8f3ba96c104fb28f6d2cfc4b05b5d24bb7f80aa1
Signed-off-by: Robert Varga <[email protected]>
(cherry picked from commit
d8f544b093f024ff156873c66eebf976f6738382)
Robert Varga [Thu, 28 May 2015 00:46:35 +0000 (02:46 +0200)]
BUG-1485: deprecate public static range/length methods
These methods are not efficient and expose implementation internals.
Mark them as deprecated for removal. This mirrors the deprecation in
ClassTemplate, which was not instantiated before due to how the code is
structured.
Change-Id: I7fcb831f00fd3baab02e1f25e10655c8288c6d4e
Signed-off-by: Robert Varga <[email protected]>
(cherry picked from commit
da603ecd3b0e093bf00ff75d80c0957196d9856d)
Robert Varga [Thu, 28 May 2015 00:26:42 +0000 (02:26 +0200)]
BUG-1485: move generateLengthMethod to BuilderTemplate
While it looks this method is shared, it is not, as ClassTemplate
defines its own. Move it to BuilderTemplate and make it private,
reducing confusion.
Change-Id: I998f200a963dea39b1e2fedaf7a9fd1e394db58d
Signed-off-by: Robert Varga <[email protected]>
(cherry picked from commit
c2bf3960924fd870b8d3183f396c5e43b84e0aa3)
Robert Varga [Thu, 28 May 2015 00:14:29 +0000 (02:14 +0200)]
BUG-1485: move *Range* methods to BuilderTemplate
printRangeConstraint and generateRangeMethod are used by BuilderTemplate
only, move them there to preserve locality and stop them from spreading.
Change-Id: I5d5421b50bd5e4ac65182ad1a11e7bfad199df51
Signed-off-by: Robert Varga <[email protected]>
(cherry picked from commit
c49ff3a94cc0b0f98dc73647a7fdc308fdaa3052)
Robert Varga [Wed, 27 May 2015 19:24:59 +0000 (21:24 +0200)]
BUG-1485: Move restriction generation
It is only used in the class template, so move it and make it private to
increase clarity.
Change-Id: I751c4a5a0af06dd89a79ce43546ec9c12490f166
Signed-off-by: Robert Varga <[email protected]>
(cherry picked from commit
76c57ce16f7b1b90325214e05f916bc486ad792d)
Robert Varga [Wed, 27 May 2015 23:06:14 +0000 (01:06 +0200)]
BUG-3399: fix BaseYangTypes' range constraints
Constraints Number type should match the Java type a particular type is
bound to. Users dealing with values trying to correlate it to the
metadata available can then rely on things like
value.getClass.cast(rangeMin) just working instead of concocting
conversions to deal with all possible combinations of types.
Also changes BaseConstraints to enforce the two components of a
constraint being the same type, preventing things like min being Integer
while max is a Long.
Change-Id: I38e646b4c08b032248349f3e618354aa2114efd3
Signed-off-by: Robert Varga <[email protected]>
(cherry picked from commit
af2244fc083e788645ac689b543af447efdf5b70)
Robert Varga [Tue, 26 May 2015 20:49:36 +0000 (22:49 +0200)]
BUG-1485: Introduce AbstractRangeGenerator and friends
Adds utility classes for dealing with various range constraints in
generated code. These classes are implemented in pure Java and attempt
to make sure generated code runs as efficiently as possible.
Change-Id: Ie1d05b514937507e225b9bc7559b1949a7e6eb76
Signed-off-by: Robert Varga <[email protected]>
(cherry picked from commit
c5e1800bc2851c90273b6218295ffe2e59fccf91)
Robert Varga [Tue, 26 May 2015 18:32:20 +0000 (20:32 +0200)]
BUG-1485: store patterns in an array
Internal compiled patters are only ever iterated over, hence there is no
need to store them in a list. Convert the field into an array, improving
both CPU and memory efficiency very slightly. Also saves instantiation
of a temporary list.
Change-Id: I5140bc81d0a78d4f91d4ad2d6f81cbd6ed1f6d55
Signed-off-by: Robert Varga <[email protected]>
(cherry picked from commit
29c2d3351bdf371274433e71909236f133130bfb)
Robert Varga [Thu, 28 May 2015 01:59:22 +0000 (03:59 +0200)]
Make test utilities static
These two can be static, make them static.
Change-Id: I3fe54607edbadea4250928e99260906cbaef4629
Signed-off-by: Robert Varga <[email protected]>
(cherry picked from commit
0341b340283af8efa8c7604c1d65ac87aaeecfd1)
Robert Varga [Tue, 26 May 2015 22:18:57 +0000 (00:18 +0200)]
Do not instantiate augmentation HashMap in DTO builders
Tracing has revealed that the OpenFlowPlugin creates a lot of builders,
instantiation a million HashMaps, which accounts for 1% of CPU time.
Most of these maps are never touched, so we can easily optimize this
away by lazily instantiating a HashMap when the first augmentation is
added. Also prevents copying of empty augmentation in the copy
constructor.
Change-Id: I592fe6af65c9f3b65038def8bb4069666bfdc375
Signed-off-by: Robert Varga <[email protected]>
(cherry picked from commit
2cb012f4e814859e10726d02cb1c073321316ab3)
Robert Varga [Thu, 28 May 2015 15:23:27 +0000 (17:23 +0200)]
Clarify GeneratedTransferObject.getSuperType()
The Javadoc for this method is confusing and actually misleading.
Clarify it a bit for future's sake.
Change-Id: I52f09e2e9cf864dc00fb4883099ca4df5219327f
Signed-off-by: Robert Varga <[email protected]>
(cherry picked from commit
a2a7dee2cc6a9e83f53acd08408b227416f29bff)
Robert Varga [Wed, 3 Jun 2015 17:32:11 +0000 (19:32 +0200)]
BindingReflections' cache should use cached references
Since we will be giving out these all over the place, it is a good idea
to make sure the returned reference is system-global.
Change-Id: I46c4f62c5ea8f8ee13e7745e6c9efd7d865bd6d4
Signed-off-by: Robert Varga <[email protected]>
(cherry picked from commit
47e801b7f26d9e8ce68738bdfd0d1b6e6c83ae0c)
Tomas Cere [Tue, 2 Jun 2015 12:03:58 +0000 (14:03 +0200)]
Stop calling get on a possible absent value.
Change-Id: I76cc4d6decd7cf65f988dcb87553b280aab21b24
Signed-off-by: Tomas Cere <[email protected]>
Robert Varga [Wed, 27 May 2015 10:54:03 +0000 (12:54 +0200)]
Allow instantiation of more efficient RpcServiceInvokers
Current invoker derived from binding class has the downside of
performing localName->methodName conversion on each invocation, which
costs us in the lookup path, as deriving the binding method name is a
costly operation.
Add a new static factory method for creating a RpcServiceInvoker
instance base on a QName->Method map. Provide two additional
implementations: a generic one, which performs a direct lookup in the
map and a specialized one, which performs lookup only on the localName
part of the qname. The latter is used after we have made sure all QNames
come from the same QNameModule.
Change-Id: I6a4b33f0487838b3ae6c15470823e4bc01114aa5
Signed-off-by: Robert Varga <[email protected]>
(cherry picked from commit
aab5a09be514bc7622416bf2a6d4d6a7465f9d7c)
Robert Varga [Tue, 26 May 2015 13:09:00 +0000 (15:09 +0200)]
Optimize binding InstanceIdentifier methods
Openflow traces show some overhead from UnmodifiableIterable. As it
turns out, we are instantiating them needlessly for internal iteration.
This stems from accessing getPathArguments() instead of pathArguments,
which are exposed precisely for this optimization.
Make sure to access pathArguments directly, eliminating this overhead.
Change-Id: I3ef053baa35c80f555b6b9f0b8813692236afa48
Signed-off-by: Robert Varga <[email protected]>
(cherry picked from commit
96639b4fd02beb3590f62fdfc096936e71ad4a32)
Maros Marsalek [Mon, 11 May 2015 14:40:26 +0000 (16:40 +0200)]
BUG-2453 Add enum yang <-> Java mapping to BindingRuntimeContext
BindingRuntimeContext already posses the information about all generated
classes from yang (also enums). This commit makes it public.
Change-Id: I638d73625bdc4720ee6427027246455c6c05aa03
Signed-off-by: Maros Marsalek <[email protected]>
Peter Kajsa [Thu, 8 Jan 2015 12:50:02 +0000 (13:50 +0100)]
Bug 2528 - Binding Generator: Generated notification implements ChildOf
interface
Generated Notification interface implements ChildOf<DataObject> interface
which is incorrect. Generated Notification should not implement ChildOf
interface since it is not part of data tree. This could lead to use of
Notification in wrong context and may confuse consumers of APIs.
Notice: The solution replaces "implements ChildOf<DataObject>" with
"implements DataObject" in generated Notification interface. Notification
has structured content, so I think the generated Notification interface should
implements at least DataObject interface in order to be able to construct
InstanceIdentifier for the notification (analogously as it is by RPC's input
and output).
Change-Id: I55c7a8cc4ce450fd712c63f8e77881d4a18674e6
Signed-off-by: Peter Kajsa <[email protected]>
Maros Marsalek [Thu, 7 May 2015 12:12:17 +0000 (14:12 +0200)]
BUG-2453 Remove custom hashcode/equals from Enum type
Custom hashcode and equals made it impossible to match Enum types based on
packageName and name.
Change-Id: Ib3eed1f0892234b44f8e3459e48f303732a86ffe
Signed-off-by: Maros Marsalek <[email protected]>
Martin Bobak [Mon, 25 May 2015 13:09:01 +0000 (15:09 +0200)]
Bug 2988 - DTO equality appears to be broken by proxy
Change-Id: Ib068be34371e8863ef6f2ef8d936d3d6918aba37
Signed-off-by: Martin Bobak <[email protected]>
Tony Tkacik [Wed, 29 Apr 2015 13:35:08 +0000 (15:35 +0200)]
Bug 3067: Improved error reporting in Binding Data Codec
Error reporting in Binding Data Codec was reworked
to throw three additional subclasses of IllegalArgumentException
for specific case of failure:
MissingSchema and MissingSchemaForClass - exception thrown
when schema context associated with codec does not contain
models for supplied class or DOM argument.
IncorrectNesting is thrown when schema is available an user
constructed data with invalid nesting (bypassed generic
compile-time checks).
The checks to determine type of exception are done only
if error condition is detected, so non-error fast path
should not be affected by advanced checks.
Added test which tests these types of exceptions.
Change-Id: Iad020a42317ab46df4d2240568fd6e8205383857
Signed-off-by: Tony Tkacik <[email protected]>
(cherry picked from commit
3f754cccb393b989bafb8b194edf9da0ec3e9e8a)
Thomas Bachman [Thu, 7 May 2015 14:55:03 +0000 (10:55 -0400)]
Bug 3151: Fix Not a Proxy Instance Exception
This fixes a bug where a "Not a Proxy Instance"
exception (also IllegalArgumentException) is thrown
when hashCode is invoked in a yangtools generated
builder.
Change-Id: Iddc7ca6e4785e5ce11e41900a438dbb49baeaf6d
Signed-off-by: Thomas Bachman <[email protected]>
pkajsa [Thu, 13 Nov 2014 13:51:20 +0000 (14:51 +0100)]
Bug 2333 - Java code generation error, when yang model contains Choice node
in module body at top level
BindingGeneratorImpl fails (NoSuchElementException) during java source code
generation from yang model which contains Choice node directly in module body
at top level. The parent path of Choice node is empty (because the parent
is the module) and therefore iterator.next() on the path fails. For more
information see Bug 2333.
Change-Id: I6e617eca91bb5d8d2b91ad058a4df5c2793ec81d
Signed-off-by: pkajsa <[email protected]>
Tony Tkacik [Thu, 30 Apr 2015 13:37:48 +0000 (13:37 +0000)]
Merge "Add hooking into NormalizedNodeParsers."
Tomas Cere [Tue, 28 Apr 2015 12:35:13 +0000 (14:35 +0200)]
Add hooking into NormalizedNodeParsers.
Makes it possible to add a ParsingStrategy into the parsers,
to allow for callbacks/custom processing while parsing.
DefaultParsingStrategy has the same behaviour as the already present parsers.
Change-Id: I5998af4befaf31d3af3f4cf5e2f46ddc32b1e05b
Signed-off-by: Tomas Cere <[email protected]>
Signed-off-by: Maros Marsalek <[email protected]>
Robert Varga [Fri, 24 Apr 2015 11:03:54 +0000 (11:03 +0000)]
Merge "Bug 3051: Fixed pattern checks in generated DTOs"
Tony Tkacik [Fri, 24 Apr 2015 08:37:21 +0000 (10:37 +0200)]
Bumped model versions to .8-SNAPSHOT
Change-Id: I1b1c6c3fcd875795f2b8cab1d4146b25c87ee7e7
Signed-off-by: Tony Tkacik <[email protected]>
Tony Tkacik [Thu, 23 Apr 2015 10:03:12 +0000 (10:03 +0000)]
Bumped Yangtools by minor version.
Change-Id: I0c357c757ed78607982abfbf788433e16c88835c
Signed-off-by: Tony Tkacik <[email protected]>
Tony Tkacik [Thu, 23 Apr 2015 15:13:36 +0000 (17:13 +0200)]
Bug 3051: Fixed pattern checks in generated DTOs
Pattern checks in generated DTOs were generated as
OR checks in case model type specified multiple
patterns, but correct behaviour is to do AND.
So in order string needs to verified against
all patterns and match all of them.
Change-Id: If82e282312c82dd71de79534c7fa599fcdcefab4
Signed-off-by: Tony Tkacik <[email protected]>
Tony Tkacik [Tue, 21 Apr 2015 08:05:53 +0000 (08:05 +0000)]
Merge "change to interface"
Debalina Ghosh [Fri, 17 Apr 2015 17:47:06 +0000 (10:47 -0700)]
change to interface
Change-Id: Id16a68b5486e334c01341a646a9e83bb0407272c
Signed-off-by: Debalina Ghosh <[email protected]>
Vishal Thapar [Tue, 14 Apr 2015 12:40:19 +0000 (18:10 +0530)]
workaround for BUG: 2974
Suggested workaround for bug2974 is to add
yang-types revision to ietf-interfaces.yang
This change imports latest revision as well as
changes the dependency to ietf-yang-type-
20130715
Change-Id: If0ad60b435ae311db656d1a7e49402bc3ef6bb2f
Signed-off-by: Vishal Thapar <[email protected]>
Tony Tkacik [Mon, 13 Apr 2015 09:27:14 +0000 (09:27 +0000)]
Merge "BUG-1485: deprecate length/range methods"
Robert Varga [Mon, 13 Apr 2015 09:18:48 +0000 (09:18 +0000)]
Merge "Bug 1260: Implemented Binding Caching Codec"
Robert Varga [Mon, 13 Apr 2015 08:40:23 +0000 (08:40 +0000)]
Merge "Bug 2374 - YANG Binding: Added support for AugmentationHolder interface"
Robert Varga [Wed, 18 Mar 2015 17:20:15 +0000 (18:20 +0100)]
BUG-1485: deprecate length/range methods
These methods leak the internals of how constraints are enforced. No
outside parties should rely on them, so lets mark them deprecated. If we
do not get reports of use, we should be removing them in a future
release.
Change-Id: I128c5abe5c894a4808ff30dcebd6af42d8f682cb
Signed-off-by: Robert Varga <[email protected]>
Tony Tkacik [Wed, 8 Apr 2015 17:41:05 +0000 (19:41 +0200)]
Bug 1260: Implemented Binding Caching Codec
Implemented Bidning Caching Codec which maintains
API-user configured cache of serialized data
from Bidning to NormalizedNode.
These cached data are used in subsequent serializations
in order to not allocate new NormalizedNodes for
logically equivalent data.
Change-Id: Iafaed957453569c3e8ecfbb2aed333f3a1fd418f
Signed-off-by: Tony Tkacik <[email protected]>
Robert Varga [Sat, 11 Apr 2015 20:40:02 +0000 (22:40 +0200)]
Do not declare RuntimeExceptions as thrown
Fix a bunch of sonar warnings around declaring runtime exceptions.
Change-Id: I6e8267e29ef6c0d3f2d220531ca656ff564331ec
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Sat, 11 Apr 2015 15:03:58 +0000 (17:03 +0200)]
Fix constant names
Constants should have capitalized names. Fixes a few sonar warnings.
Change-Id: I600b482a817055784874e91f9cb8c5b06b948302
Signed-off-by: Robert Varga <[email protected]>
Tony Tkacik [Thu, 9 Apr 2015 12:33:42 +0000 (12:33 +0000)]
Merge "Make sure LOOKUP is a proper constant"
Tony Tkacik [Thu, 9 Apr 2015 12:32:56 +0000 (12:32 +0000)]
Merge "Fix modifier ordering"
Robert Varga [Thu, 9 Apr 2015 11:23:22 +0000 (13:23 +0200)]
Make sure LOOKUP is a proper constant
Change-Id: I684ead0df12bdc5c012f8a20e04f4508c5bbb429
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 9 Apr 2015 11:11:05 +0000 (13:11 +0200)]
Fix modifier ordering
JLS specifies annotations need to to come before other modifiers, of
which visbility should be first.
Change-Id: I754ef08c13256647d024c121e75fd3617ef6d064
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 8 Apr 2015 22:55:45 +0000 (22:55 +0000)]
Merge "Fixed incorrect signature in NotificationListenerInvoker"
Tony Tkacik [Wed, 8 Apr 2015 17:42:29 +0000 (19:42 +0200)]
Fixed incorrect signature in NotificationListenerInvoker
Change-Id: I01e54f6193e54b1488a506ae47d24ba8c808281a
Signed-off-by: Tony Tkacik <[email protected]>
Robert Varga [Thu, 2 Apr 2015 14:21:46 +0000 (14:21 +0000)]
Merge "Fixed NPE in BindingCodecTree#getSubtreeCodec(YangInstanceIdentifier)"
Tony Tkacik [Thu, 2 Apr 2015 13:35:03 +0000 (15:35 +0200)]
Fixed NPE in BindingCodecTree#getSubtreeCodec(YangInstanceIdentifier)
Change-Id: If77807004779ce6ade106f1bacc9918f98f996ee
Signed-off-by: Tony Tkacik <[email protected]>
Robert Varga [Tue, 31 Mar 2015 21:11:08 +0000 (23:11 +0200)]
BUG-869: kill more sonar warnings
Empty statement, mis-ordered annotations and keywords, unneeded
keywords.
Change-Id: I88a7ba62b5fe22cda96a1b5243a2ae4968c31ab3
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 31 Mar 2015 20:55:31 +0000 (22:55 +0200)]
BUG-869: remove public modifier
Public is implied for all methods in an interface, do not specify it
explicitly.
Change-Id: Ic673b60111f9ecf62a6242d3bedf8607036a3403
Signed-off-by: Robert Varga <[email protected]>
Tony Tkacik [Tue, 31 Mar 2015 12:57:44 +0000 (14:57 +0200)]
Bug 2374 - YANG Binding: Added support for AugmentationHolder interface
Binding specification v1 was originally designed and implemented
in only one implementation of interfaces in mind, which were generated one,
but during Helium additional implementation was introduced, but
specification and generated copy builder constructor did not accounted for
that change. Added additional interface which is implemented by LazyDataObject
that allow copy of augmenations.
Updated code generator to allow for that change and implementation of
LazyDataObject to support new interface contract.
Change-Id: I15aec38259f7f5e95301368d0264dfcf0571e2ba
Signed-off-by: Tony Tkacik <[email protected]>
Robert Varga [Tue, 31 Mar 2015 11:19:49 +0000 (11:19 +0000)]
Merge "Bug 2924: DataCodecTree expose (de)serialization methods for path arguments."
Tony Tkacik [Tue, 31 Mar 2015 08:39:37 +0000 (10:39 +0200)]
Bug 2924: DataCodecTree expose (de)serialization methods for path arguments.
Change-Id: I21129df70829a6b9a35af8350352907d46d27de2
Signed-off-by: Tony Tkacik <[email protected]>
Robert Varga [Mon, 30 Mar 2015 15:34:59 +0000 (17:34 +0200)]
BUG-869: remove unused assignment
This assignment in return does not make sense, remove it.
Change-Id: Ie999973df471af9f5364ddf2154a24ce237278dc
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Mon, 30 Mar 2015 15:33:17 +0000 (17:33 +0200)]
BUG-869: do not use StringBuffer
StringBuilder is the right one, so let's use that one.
Change-Id: Ic84383c05c3cd6bb0eacf9df0bbb3ed9ae46ee3f
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Mon, 30 Mar 2015 15:23:40 +0000 (17:23 +0200)]
BUG-869: remove public modifier
public is implied to all identifiers within the enclosing interface.
Change-Id: I43a50c7d51b73074df6d0456cf0d9d9aab24b819
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Mon, 30 Mar 2015 15:13:29 +0000 (17:13 +0200)]
BUG-869: remove empty statements
Sonar warnings point to semicolons after method definitions and ;;.
Remove all instances.
Change-Id: I1ba067720abd4c9df3a0c457b947736c9bc6313e
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Fri, 27 Mar 2015 10:52:48 +0000 (10:52 +0000)]
Merge "Bug 2906 - Added support of entering notification by #streamChild()"
Tony Tkacik [Fri, 27 Mar 2015 10:04:50 +0000 (11:04 +0100)]
Bug 2906 - Added support of entering notification by #streamChild()
Root Tree Node context did not allowed to enter notification
using binding classes by #streamChild method, since
notifications were cached in different collection.
Added support for entering notifications using such method.
Change-Id: I28779e763a81519d25d71e319776cdc6f179ef33
Signed-off-by: Tony Tkacik <[email protected]>
Robert Varga [Wed, 25 Mar 2015 07:01:57 +0000 (08:01 +0100)]
Cleanup checkstyle warnings
We have various reported problems, from missing spaces, javadocs to
undocumented classes and parameters.
Change-Id: I38a15258ea5ba8eb8d97f257a36a4d890165b5a0
Signed-off-by: Robert Varga <[email protected]>
Kinsey Nietzsche [Wed, 12 Nov 2014 13:47:30 +0000 (14:47 +0100)]
extended test coverage of InstanceIdentifier
Change-Id: Id18ae2ec969612e6c52a19449453f47e4e7e5fff
Signed-off-by: Kinsey Nietzsche <[email protected]>
Robert Varga [Fri, 20 Mar 2015 07:17:23 +0000 (07:17 +0000)]
Merge "Bug 868: Removed Binding to Composite Node codecs."
Tony Tkacik [Thu, 19 Mar 2015 14:29:06 +0000 (15:29 +0100)]
Bug 868: Removed Binding to Composite Node codecs.
Change-Id: Ia54519c88870fada74bd2d7ce579c0e77d687157
Signed-off-by: Tony Tkacik <[email protected]>
Vishal Thapar [Wed, 18 Mar 2015 13:49:13 +0000 (19:19 +0530)]
BUG 2868: Update iana-if-type with RFC 7224
Change-Id: Ide79db6c34fb23bd2c773a614c35d1e436b7d237
Signed-off-by: Vishal Thapar <[email protected]>
Robert Varga [Wed, 18 Mar 2015 09:34:56 +0000 (09:34 +0000)]
Merge "Bug 2857: Tied pre-existing implementation to BindingCodecTree."
Tony Tkacik [Thu, 12 Mar 2015 11:06:00 +0000 (12:06 +0100)]
Bug 2857: Tied pre-existing implementation to BindingCodecTree.
BindingCodecTree provides public view into backing structure
of binding-data-codec, which was designed and already implemented
as data tree.
By exposing these power-users could build their own
Binding to DOM adapters, where they could customize some aspects
of serialization or precache over-used codecs in order
to speed up performance.
Change-Id: I827eb6014b28d0b6d4256b677ee56d3081ff80b0
Signed-off-by: Tony Tkacik <[email protected]>
Tony Tkacik [Mon, 16 Mar 2015 13:31:50 +0000 (14:31 +0100)]
Bug 2859: Key generation when anonymous Enum was used.
Binding list key was generated with incorrect type,
when anonymous enumeration was defined in leaf in grouping
and that leaf was used for list.
Change-Id: Idcb114be49280f77af8054d8d83c5d8e6f453665
Signed-off-by: Tony Tkacik <[email protected]>
Tony Tkacik [Mon, 16 Mar 2015 07:28:07 +0000 (07:28 +0000)]
Merge "Migrate from BindingGeneratorUtil"
Tony Tkacik [Mon, 16 Mar 2015 07:13:14 +0000 (07:13 +0000)]
Merge "BUG-2829: make static QName field hold a cached reference"
Deepthi V V [Tue, 10 Mar 2015 10:46:23 +0000 (16:16 +0530)]
Add ietf-interfaces to model.
ietf-interfaces is a standard ietf yang model. This will be used by
vpnservice project.
Signed-off-by: Deepthi V V <[email protected]>
Change-Id: I787e945a39417cc85c79b11cb28264b82cd168e6
Signed-off-by: Deepthi V V <[email protected]>
Robert Varga [Thu, 12 Mar 2015 22:50:52 +0000 (23:50 +0100)]
Migrate from BindingGeneratorUtil
BindingMapping is the new home for mapping module namespaces to java
package names.
Change-Id: I61ecf91c2ffa78a6e62c00feaf5fd7879dd89cf9
Signed-off-by: Robert Varga <[email protected]>
Ladislav Borak [Tue, 9 Dec 2014 11:32:24 +0000 (12:32 +0100)]
Bug 2287 - TypeProviderImpl retains empty HashMaps
Allocating default HashMaps is wasteful, especially if we end up not
storing anything in them. This fixes that case by making sure we
allocate a map only after we are sure we are going to put something into
it. Also be conservative about the size, so we do not waste too much
space.
Change-Id: I85ad1506e732a5c3728ef3529e7e0b5b430d758a
Signed-off-by: Ladislav Borak <[email protected]>
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 12 Mar 2015 19:49:11 +0000 (20:49 +0100)]
BUG-2829: make static QName field hold a cached reference
A QName (and QNameModule) exposes an API to obtain a system-wide
shared reference to an object. Use this facility to share QNameModules
across all generated classes, as well as sharing potentially duplicate
QNames.
Change-Id: Icfd0c48edbd37e54be1a436480d5808d4efaf29d
Signed-off-by: Robert Varga <[email protected]>
Tony Tkacik [Thu, 12 Mar 2015 17:10:46 +0000 (17:10 +0000)]
Merge "Eliminate all trailing whitespace in xtend"
Tony Tkacik [Thu, 12 Mar 2015 17:10:41 +0000 (17:10 +0000)]
Merge "Make sure we do not generate trailing whitespace"
Robert Varga [Thu, 12 Mar 2015 16:44:31 +0000 (17:44 +0100)]
Eliminate all trailing whitespace in xtend
The API generator output should not contain trailing whitespace --
cleanup the templates to make sure we do not pollute output.
Change-Id: Ia312d1e2a0218a51eac42a62446bb6af63d69ee6
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 12 Mar 2015 16:42:08 +0000 (17:42 +0100)]
Make sure we do not generate trailing whitespace
If we get an empy line in description, it is possible for us to generate
trailing whitespace. Make sure we don't do that and also clean any
trailing whitespace from the source file itself.
Change-Id: I8ea20c92cce5a6dccc1c107af97b959af4264f84
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 12 Mar 2015 14:50:26 +0000 (14:50 +0000)]
Merge "Bug 2248 - mvn clean install is failing due to checkstyle"
Robert Varga [Thu, 12 Mar 2015 14:47:15 +0000 (14:47 +0000)]
Merge "Fixed generation of UnionBuilders for anonymous unions."
Tony Tkacik [Tue, 3 Mar 2015 11:06:31 +0000 (12:06 +0100)]
Introduction of more powerful binding codec APIs
Introduces new more expresive APIs, which allows
user to customize serialization / deserialization.
Introduced new concepts:
- Subtree codecs
- Tree and cursor based APIs for locating subtree
- Caching Codec - codec which uses cache for serialization
Change-Id: If4868c9cd20c56d2ce0498bd2ded90b1265f7b67
Signed-off-by: Tony Tkacik <[email protected]>
Tony Tkacik [Thu, 12 Mar 2015 13:27:22 +0000 (14:27 +0100)]
Fixed generation of UnionBuilders for anonymous unions.
Change-Id: I18e90e7d7227efe31767734df1ce525df60104d5
Signed-off-by: Tony Tkacik <[email protected]>
Ladislav Borak [Thu, 11 Dec 2014 12:07:59 +0000 (13:07 +0100)]
Bug 2248 - mvn clean install is failing due to checkstyle
- added check in BaseTemplate.imports() if imported type has same package
as generated type
Change-Id: Ifefb4be88c145aa222541cbb901aa9cab63b510d
Signed-off-by: Ladislav Borak <[email protected]>
Robert Varga [Tue, 10 Mar 2015 12:03:32 +0000 (13:03 +0100)]
BUG-1513: introduce ChoiceSchemaNode
This introduces the alternative name, which does not clash with
yang-data-api. Also deprecated ChoiceNode.
Change-Id: I42e93c45804dc8e3952d08c697f772d776c303c3
Signed-off-by: Robert Varga <[email protected]>
Tony Tkacik [Tue, 10 Mar 2015 15:27:24 +0000 (15:27 +0000)]
Merge "Fix a generic warning"
Robert Varga [Tue, 10 Mar 2015 14:47:32 +0000 (15:47 +0100)]
Fix a generic warning
Add generic arguments to fix a warning.
Change-Id: I249258370efe32d26189cf236818c483b8f0d915
Signed-off-by: Robert Varga <[email protected]>
Tony Tkacik [Thu, 5 Mar 2015 21:04:43 +0000 (22:04 +0100)]
Introduced MethodHandle based invokers for Notification and RPCs
This invokers are used to provide genereralized access to any
generated callback / rpc method using one approach for
any RPC.
Change-Id: I4d6ce7c71f658b5e2c6e805479aa47a8f09fb989
Signed-off-by: Tony Tkacik <[email protected]>
Tony Tkacik [Sun, 8 Mar 2015 10:37:07 +0000 (10:37 +0000)]
Merge "Remove unnecessary casts"
Tony Tkacik [Sun, 8 Mar 2015 10:36:48 +0000 (10:36 +0000)]
Merge "Remove unnecessary casts"
Tony Tkacik [Sun, 8 Mar 2015 10:36:37 +0000 (10:36 +0000)]
Merge "Remove unnecessary casts"
Tony Tkacik [Sun, 8 Mar 2015 10:36:28 +0000 (10:36 +0000)]
Merge "Do not rely on transitive dependencies"
Robert Varga [Thu, 5 Mar 2015 13:30:24 +0000 (14:30 +0100)]
Remove unnecessary casts
xtend 2.7.x makes instanceof check an implicit cast for subsequent
variable usage, so these generate warnings. Also remove use of
deprecated types and speed up stringuilder usage by passing characters
instead of strings where possible.
Change-Id: I3131166a2fedf09743e6baf4159ba15357a37993
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 5 Mar 2015 13:30:02 +0000 (14:30 +0100)]
Remove unnecessary casts
xtend 2.7.x makes instanceof check an implicit cast for subsequent
variable usage, so these generate warnings.
Change-Id: I88f7b68cd2fdddf0bb39c2bbc8f2c8533de22006
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 5 Mar 2015 13:28:51 +0000 (14:28 +0100)]
Remove unnecessary casts
xtend 2.7.x makes instanceof check an implicit cast for subsequent
variable usage, so these generate warnings.
Change-Id: Ic28a868eeef8167a1f7e8b3946c2ea13526818dc
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 5 Mar 2015 13:00:23 +0000 (14:00 +0100)]
Do not rely on transitive dependencies
Maven core and build API should have scope=provided.
Change-Id: Id34b075fb92247507a61b79daee6c4ab73647f53
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Sat, 28 Feb 2015 21:03:00 +0000 (22:03 +0100)]
Use Collection.size() instead of Iterables.size()
Now that NormalizedNodeContainer returns a Collection of children, we
can use its size() method directly, speeding things up just a little
bit.
Change-Id: I7b336d0029084140ea853716a38f8abb87da7c26
Signed-off-by: Robert Varga <[email protected]>
Tony Tkacik [Thu, 26 Feb 2015 15:36:36 +0000 (15:36 +0000)]
Merge "Bug 2539: Properly report incorrect Instance Identifiers"
Tony Tkacik [Mon, 19 Jan 2015 14:24:12 +0000 (15:24 +0100)]
Bug 2539: Properly report incorrect Instance Identifiers
Binding Data Codec throws IllegalArgumentException
with description for incorrect instance identifiers
instead of generic NullPointerExceptions.
Change-Id: Ia47c83925a18f029c70b2816e2fcb58632027e3c
Signed-off-by: Tony Tkacik <[email protected]>
Tony Tkacik [Thu, 26 Feb 2015 08:29:44 +0000 (08:29 +0000)]
Merge changes I4f081454,Ibe6f283d,I83acfee3,If7a08ff1,Ia0f847dd, ...
* changes:
Spellcheck AugmentableDataNodeContainerEmitterSource
Use simple string concat in DataObjectSerializerSource
Fix BindingNormalizedNodeCodecRegistry thread safety
Compact BitsCodec
Do not declare Exception as thrown
DataContainerCodecPrototype should be final
Fix code alignment
Robert Varga [Wed, 25 Feb 2015 22:34:26 +0000 (23:34 +0100)]
Spellcheck AugmentableDataNodeContainerEmitterSource
Simple rename of an internal class to fix a typo.
Change-Id: I4f081454b5612d2960ff85158ca5cdf2adf17519
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 25 Feb 2015 22:32:40 +0000 (23:32 +0100)]
Use simple string concat in DataObjectSerializerSource
Allocating a default-sized StringBuilder is not optimal, we'd really
want to preallocate it with the initial string, at which point it
becomes not much more than a simple concat.
Change-Id: Ibe6f283dccebb347982561c4acacf615a8fff4cf
Signed-off-by: Robert Varga <[email protected]>