Robert Varga [Wed, 10 Apr 2019 22:43:45 +0000 (00:43 +0200)]
Bump versions to 2.1.10-SNAPSHOT
This starts the next development cycle.
Change-Id: Ife54f124f946cac5be6c01602ba8a0e55ac46931
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 9 Apr 2019 21:08:32 +0000 (23:08 +0200)]
Expand CollectionWrappers
We recognize cross-wrapping between List and Set and unpeel
the backing collection, so reducing object retention chains.
Change-Id: Ie6bd5826c328ab6db656758e3bad2f3b9f656255
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
173801fff4ff9edfc81d37b6d61411d59586ab3b)
Robert Varga [Tue, 9 Apr 2019 17:16:37 +0000 (19:16 +0200)]
Use XMLStreamException for reporting parsing errors
Using IllegalStateException is pure evil, as users do not expect
a RuntimeException to be thrown from contexts which can clearly
report a checked exception.
Use a properly-formatted XMLStreamException instead.
Change-Id: Iecee17e19b3ac380bcb2b7fc1c46f27e789c20bd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
b61a476ed2b4a896b549995a075a687066ecc715)
Robert Varga [Mon, 8 Apr 2019 07:32:09 +0000 (09:32 +0200)]
Remove misleading comment
The comment about .get() being safe is not relevant, remove it.
Change-Id: I92ed59e6ef72968ed7cfbdc1da0e22817431483c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 8 Apr 2019 01:10:04 +0000 (03:10 +0200)]
Fix NONE operation node with automatic lifecycle
In case when previous operations fizzle into a NONE operation
on top of a non-present node, automatic lifecycle would fail
because there is no node to disappear.
Fix this case by not requiring the delegate operation to return
a present node.
JIRA: YANGTOOLS-938
Change-Id: I6b4a01af61e148efa0bae3953dd5aa80b2e63398
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
43f0b88599538edd48b971c8e99bbb758baef3e6)
Robert Varga [Fri, 29 Mar 2019 09:51:31 +0000 (10:51 +0100)]
Expose QueuedNotificationManager statistics
This backports the MXBean defined in the controller project and makes
an implementation of it available through getMXBean().
JIRA: CONTROLLER-653
BUGZILLA: BUG-1446
Change-Id: Ica8dff7aef8989f2b23b1fc8c100a535998273b1
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
e74ded11579d1413a8e8d89129660b81048d26bd)
Robert Varga [Thu, 28 Mar 2019 16:21:53 +0000 (17:21 +0100)]
Backport YangInstanceIdentifier serialized form
This backports 3.0.0 serializable forms to allow 3.0.0->2.1.x
compatibility.
JIRA: YANGTOOLS-979
Change-Id: I6823c55c2cbd1abe9e05945a4fbb2de411fe0792
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
9f4a6257aceb0b81b037984da83189a6055b797f)
Robert Varga [Thu, 21 Mar 2019 09:00:07 +0000 (10:00 +0100)]
Backport QNameModule externalizable proxy
This is a backport of the proxy class only, so that yangtools-2.1.x
can understand data serialized by yangtools-3.0.x.
Change-Id: I5688c2c930282307f2cf5bf9ebd23295fb314c63
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
808a600f23b5b806da2d7715787a3bdcb4941574)
Robert Varga [Thu, 21 Mar 2019 08:12:13 +0000 (09:12 +0100)]
Backport QName externalizable proxy
This is a backport of the proxy class only, so that yangtools-2.1.x
can understand data serialized by yangtools-3.0.x.
Change-Id: I1be13e02ed4eec537cb86f86e009ba058687f153
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
7768e923cc12f467ad7e5e32577bdd1a10a4d581)
Robert Varga [Tue, 26 Mar 2019 22:14:43 +0000 (23:14 +0100)]
Bump yang-xpath-api/impl version to 0.3.9-SNAPSHOT
XPath support underwent significant changes, so bump its version
by a 0.1.0 to make sure people do not get surprised.
Change-Id: Id0b7277292be62ce2c8cf84001a5b8c183c24282
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 26 Mar 2019 09:00:52 +0000 (10:00 +0100)]
YangNamespaceContext should not have a default namespace
Default namespace is usually bound separately from prefix, hence
YangNamespaceContext should not contain it.
Change-Id: I14543635dd33997f5cbc7d0f23405a59446de24c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
ce60296cca9da1d3201c43751c6e6016bd2ca9d5)
Robert Varga [Mon, 25 Mar 2019 20:27:52 +0000 (21:27 +0100)]
Fix YangXPathMathSupport serializability
Supports should always resolve to a singleton.
Change-Id: I9888465d7fe89fbf9c2e75aa4e7a807ea16ed0e0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
286b3f576052d25922f56621cfe0da4eeaf0e05e)
Robert Varga [Wed, 20 Mar 2019 17:37:20 +0000 (18:37 +0100)]
Define the concept of unresolved QName
YANG Xpaths have dynamic namespace resolution for the default
namespace: during parse time we can only bind qualified node
identifiers.
Unqualified node identifiers require an explicit default namespace
binding step, which happens between when the XPath is parsed and
when it is evaluated, when the context node is determined.
This is quite visible in the context of leafref path expressions:
- typedef expressions are bound to the leaf/leafset referencing them
- leaf expressions in groupings are bound only after they have been
completely instantiated (i.e. 'uses' outside of grouping context)
Change-Id: I65341793dc520bcc36c45dec76a303080be115a1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
8b9ebd167b78bf49ba5dfa28105a2cba4c9e4f67)
Robert Varga [Wed, 20 Mar 2019 22:15:16 +0000 (23:15 +0100)]
Introduce UnqualifiedQName and QualifiedQName
For the purposes of XPath expressions we need the concept of a future
node-identifier which is not bound to a concrete namespace (which
is already covered by QName).
This node identifier comes in two forms, qualified and unqualified,
each of which undergoes different namespace binding lifecycle.
This patch introduces AbstractQName, which serves as the base class
for all QName constructs and two separate classes UnqualifiedQName
and QualifiedQName, which have the ability to be be converted to
a full QName.
Note that due to Serializable contract, QName cannot be made a
subclass of AbstractQName. This fact is marked up for a future
API change.
Change-Id: I87242dcab93ecdd1050630fd4b3c320419ae10d5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
ad70665ed1617f38468a19d4becf33c08e1e950e)
Robert Varga [Thu, 21 Mar 2019 16:46:28 +0000 (17:46 +0100)]
Remove YangXPathParserFactory @ThreadSafe annotation
Replace JSR305 with explicit documentation of the fact we expect
implementations to be thread-safe.
Change-Id: If04d9b930f731387c794731261e745064048db0c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
78eb140040353f5b276c778a12ba6172838e5795)
Robert Varga [Tue, 26 Mar 2019 11:43:00 +0000 (12:43 +0100)]
Remove a stray FIXME
This FIXME was addressed already, remove it.
Change-Id: I697fbf5dec237b6a1b726058d58abd6bf9862805
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
578f3922793006daef79354b2d692b83cd8f1570)
Danielle Mustillo [Mon, 25 Mar 2019 18:27:45 +0000 (14:27 -0400)]
Strings Ending in Backslash are Improperly Lexed
Using greedy match for SUB_STRING fragment's forward lookahead
is troublesome because it will consume all non-double-quotes
until the final one -- including any escapes present.
This patch fixes the lexer to use non-greedy subrule, so that
escapes are properly accounted for.
JIRA: YANGTOOLS-971
Change-Id: Ic93c5c2bfa807001735125bd0367c29a1a25ea99
Signed-off-by: Danielle Mustillo <danielle.mustillo@ericsson.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
e307e3f6893f94bc0a6b3fac094270f3e206eef2)
Robert Varga [Thu, 21 Mar 2019 09:11:35 +0000 (10:11 +0100)]
Shorten QName.toString()
Take advantage of fluent StringBuilder, removing a bit of bytecode.
Change-Id: I8d7c55b6118066529c2b62d8b48134affd58c1ea
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
89dd96f6dd4261aa44427c7358352dac60fe0a7a)
Robert Varga [Wed, 20 Mar 2019 22:17:37 +0000 (23:17 +0100)]
Speed up QName.intern() a bit
In case we end up interning the localName, we should use the private
constructor to side-step re-validating localName.
Change-Id: I54029d15c93ae32f5c857e890c8313a9f62f58f0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
d5c6acd3148e3a659cce1091955b0b32c9730944)
Robert Varga [Wed, 20 Mar 2019 12:20:38 +0000 (13:20 +0100)]
Expose Relative/Absolute YangLocationPath
This patch exposes the two concretizations of YangLocationPath,
so they can be used for constructing type-safe APIs.
Change-Id: I9f0678141d7f6df668020531250a6a10fab67512
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
0f34062d55824dcfdaf703ded5a17a0fe22f6bc6)
Robert Varga [Wed, 20 Mar 2019 12:04:46 +0000 (13:04 +0100)]
Fix XPathExpr parsing
The parser mistakenly treated filter/path concatenation as a binary
expression, which lead to its inability to parse leafrefs, which
contain such a concatenation in predicates.
This fixes the parser to correctly use XPathExpr in this case.
Change-Id: Ica1ac3ee7d099273dccdf8565da2a69d9f11c046
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
10f37913cf44e52bf76802aa97acb306a4db904f)
Robert Varga [Wed, 27 Feb 2019 14:38:10 +0000 (15:38 +0100)]
Refactor yang-xpath-impl error handling
Separate out CapturingErrorListener and make sure we install it
in InstanceIdentifierParser.
Change-Id: I9313161708daa122854b423015bdbcffef369bda
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
6a0b071158446b55bf400fa5b5d6c1fe87f50cb0)
Robert Varga [Wed, 27 Feb 2019 14:22:23 +0000 (15:22 +0100)]
Remove generics from YangNumberExpr
Generics are only getting in the way with the class and its support,
remove them from interface classes and move them to
AbstractYangXPathMathSupport.
Change-Id: I81b69e88786db1ce014c4ee83b65c01da09fbdad
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
44dfbfccf41427d0da771af5d3280743aa560b38)
Robert Varga [Wed, 27 Feb 2019 12:50:00 +0000 (13:50 +0100)]
Propagate namespaceContext/mathSupport to FunctionSupport
A number of operations in Functions requires either mathSupport
or namespaceContext to work correctly. This patch makes sure it
is available.
Change-Id: Icdbf6eda25017f9c921d2009b52e1fa012d08033
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
c6eaba9285b16605a7d022d189cef31ec8955585)
Robert Varga [Wed, 20 Mar 2019 11:19:08 +0000 (12:19 +0100)]
Merge location step shorthand handling
This eliminates duplicate code by introducing parseStepShorthand()
and adjusting its two users to use it.
Change-Id: I0e4db3e9a7fd062e5085ce27f6ba6d21cf6cf668
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
82cc304f600f4033570dbbcbcaa6bf735418b65c)
Robert Varga [Tue, 26 Feb 2019 21:14:28 +0000 (22:14 +0100)]
Update yang-xpath-api design
This is the first round of API design update, bringing the following
changes:
- MathMode is now a top-level enumeration
- YangXPathMathSupport is an API interface providing common functions
- Prefix resolution is done through YangNamespaceContext
- YangNaryExpr is final
- math-specific YangNumberExprs are hidden classes
- YangFunctionCallExpr.NoArgs is folded into YangFunctionCallExpr
- YangLiteralExpr is now final
- YangXPathExpression exposes MathMode
- Literal interpretation is lazy and works on subexpressions
Change-Id: Ie721678b5513dc088c1a267b98f38d9b0643cb33
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
d3bd58ed1f89d2bc84c420b93529ef0f9182d277)
Robert Varga [Wed, 27 Feb 2019 11:17:48 +0000 (12:17 +0100)]
Add ModuleNameNamespaceContext
This adds a utility YangNamespaceContext, which maps QNameModules
to their corresponding module name as contained in a SchemaContext.
Change-Id: I3be6316d0e7c1f9f98439e3bca3b9b0d385f63bb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
a8b6aec2bf3770000f25d9d91ca797d41c1d9d52)
Robert Varga [Wed, 27 Feb 2019 08:35:18 +0000 (09:35 +0100)]
Add YangNamespaceContext
We require prefix/QNameModule mapping in multiple contexts, some
of which are bound to a SchemaContext, some of which are bound to
a particular Module.
This patch adds a generalized YangNamespaceContext to serve in these
situations and provides a simple BiMap-based implementation.
Change-Id: I3d44a55ea3569532395b3acb9dc7dedba70c1f4e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
00de9246637af8cec3e494d8c023eb683da71eb9)
Robert Varga [Wed, 20 Mar 2019 07:59:22 +0000 (08:59 +0100)]
Eliminate unneeded YangLocationPath subclasses
*WithSteps subclasses are not that helpful, as we only have single
onjects which do not have steps. Integrate steps into YangLocationPath,
making it bimorphic (and its getSteps() method monomorphic).
Also clean up arguments/returns, so that we propagate only Immutable
collections.
Change-Id: Ie0cdd2fb558b0b51071fd49eded9bfa1f6e20b1b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
ba9a6e8b099b98dc3522b06a5e2e255f0be65256)
Robert Varga [Wed, 20 Mar 2019 09:20:26 +0000 (10:20 +0100)]
Cleanup LeafRefPath{Lexer,Parser}
Drop CRLFs and remove a trailing space.
JIRA: YANGTOOLS-969
Change-Id: I24fabf164db72164e07bc3ea149e11e028ba91a2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
a7773958b4f50c62ddc75d86e069683eb669488e)
Robert Varga [Wed, 20 Mar 2019 07:40:02 +0000 (08:40 +0100)]
Add YangXPathAxis.asStep() methods without predicates
In some contexts we know we do not not have any predicates, add
convenience functions for instantiating such steps.
Change-Id: I141053c041095add35590b6ff77440036450cb58
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
716ec69210f2c7e3cc4bd865b41fdab77e1c43a5)
Robert Varga [Mon, 18 Mar 2019 16:53:20 +0000 (17:53 +0100)]
Fixup xpath resolution
Add basic handling for method invocations, namely deref() and
interrupted '..' chains.
JIRA: YANGTOOLS-968
Change-Id: I9b99a5aa84039749fb04f1dca8420d41b24ba6e2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
f5b7a9cf4d9cafe0e8b4c7c38168ab0fdb7719fc)
Robert Varga [Sat, 16 Mar 2019 00:40:07 +0000 (01:40 +0100)]
Fix HTML5 javadoc compliance
We are using HTML4 tags for no good reason, migrate to better
concepts to improve compatibility.
Change-Id: I4f5bb01ed2bb163ba7775f36469c94f9b2cbfd89
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
8317f464f4aa79688728280d7df0a5c88b95e69c)
Robert Varga [Sat, 16 Mar 2019 15:37:13 +0000 (16:37 +0100)]
Remove object cache declaration
object-cache has been removed in 2.1.0, remove its declaration.
Change-Id: I3aaad19fd21a306f32d4f2b661564df40ab3fa36
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 7 Mar 2019 19:18:21 +0000 (20:18 +0100)]
Add YANG Schema Mount parser support
This adds the necessary bits and pieces to properly support
mount-point extension in the parser.
JIRA: YANGTOOLS-965
Change-Id: I7ca1b6c8c961e3033dc8023089d9169573dc3c4e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
18f08017dcdc114f5f7e22c171cac79b38ea0526)
Robert Varga [Sat, 16 Mar 2019 00:08:54 +0000 (01:08 +0100)]
Update .gitreview
Point to v2.1.x, not master.
Change-Id: I4c03bdd5b5073d0b200881612318b148854e4476
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 8 Mar 2019 17:10:07 +0000 (18:10 +0100)]
Hook if-feature statements onto FeatureNamespace
IfFeatureStatementSupport should perform a check against FeatureNamespace,
so that invalid feature references are properly caught and reported.
JIRA: YANGTOOLS-964
Change-Id: If9fe8da3235533a702a34ceac26d62d91acc03c3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
1e6da8dcec386c56a626d7982e20a67e35d8a4f7)
Robert Varga [Fri, 8 Mar 2019 14:04:34 +0000 (15:04 +0100)]
Define IfFeature via a specialized class
This reworks the grammar to use less recursion, as we can use
wildcards to eagerly combine expressions like "foo || bar || baz"
into any(foo, bar, baz) rather than or(foo, or(bar, baz)).
In order to properly support this contract, we define IfFeatureExpr,
which we specialize, so that we do not need to lug an opaque
predicate tree.
JIRA: YANGTOOLS-964
Change-Id: I048c3ced9c074e340031ac53c1117ce881b0a78b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
5874f5da6ff34f70c5754f5a98dbd0a32820fba1)
Robert Varga [Fri, 8 Mar 2019 17:38:04 +0000 (18:38 +0100)]
Make sure we populate features
The way features work with EffeciveModules means features are not
populated into FeatureNamespace. In fact that namespace is not
activated at all.
Fix this up, so features can be cross-referenced with if-feature.
Change-Id: I73cb4e8cf648e5f8ef72edce00556e4e69ee908c
JIRA: YANGTOOLS-964
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
33bc94f1abc68aebd26bc12ac1c085d6ba001eb9)
Robert Varga [Fri, 8 Mar 2019 16:38:03 +0000 (17:38 +0100)]
Make getIfFeaturePredicate() a default method
This is just a reference to the argument, there is no point in
forcing implementations to deal with this.
Change-Id: I40cb0c349694f9fe9e224e4458fea2b2c05fa870
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 6 Mar 2019 10:39:13 +0000 (11:39 +0100)]
Add YangInstanceIdentifier.createReverse(Deque)
There are use cases when we need to instantiate a YangInstanceIdentifier
and we have the components available in a stack (i.e. deque). We can
provide an optimized instantiator which will walk the stack in reverse
order, reducing the need for one invert operation.
This patch adds two methods, one operating on a Deque<PathArgument>
and one operating on Deque<Object> with an extractor function.
Change-Id: If2b05d62dcbfb5d37415a2ecb241c8265ceb1be6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 5 Mar 2019 09:32:15 +0000 (10:32 +0100)]
Add AnnotationSchemaNodeAware interface
It seems that having annotations indexed at the SchemaContext level.
To support that, add AnnotationSchemaNodeAware interface and make it
trivially implemented by SimpleSchemaContext.
Also retrofit AnnotationSchemaNode.find(SchemaContext) to recognize
AnnotationSchemaNodeAware and defer to the index if its available.
JIRA: YANGTOOLS-960
Change-Id: I1f3cd68a8356b20bceb2d0d620992ade10649e5b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
366d11917e78439aea6dfe0b1cb5aefc9978158d)
Robert Varga [Mon, 4 Mar 2019 12:56:05 +0000 (13:56 +0100)]
Use ForwardingNormalizedNodeStreamWriter for QName tranformation
We have a utility forwarder, which can be used as a baseline, reducing
transformation complexity a bit. Also make sure we reuse identifiers
when they are not transformed.
Change-Id: Ife4025cd47145b4501ff9f6186f47503cfb2aa45
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
dc2251929ad3e3dc5aaec0102e80d345b51911b6)
Robert Varga [Mon, 4 Mar 2019 12:34:56 +0000 (13:34 +0100)]
Fix ForwardingNormalizedNodeStreamWriter
Forwarding objects should allow all methods to be overridden, fix
that.
Change-Id: Ibb57fa99880914ffd2aff62b67e9e20ecadd4696
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
9e4bf58e9552bcd38fa5823a44a63df290a5ca7f)
Robert Varga [Thu, 28 Feb 2019 14:54:24 +0000 (15:54 +0100)]
Make NormalizedNodeStreamWriter extensible
NormalizedNodeStreamWriter needs to cater to at least one extension,
which is metadata emission. Introduce
NormalizedNodeStreamWriterExtension and add a getExtensions() method,
which returns no extensions by default.
JIRA: YANGTOOLS-497
Change-Id: Iebe11b80c3199f6b37b46c85bd7362a764de4ed6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
61759f1441b7480bc5a2b46bb8f15a5837809b8f)
Robert Varga [Thu, 28 Feb 2019 15:10:14 +0000 (16:10 +0100)]
Add ExtensibleObject interface
This adds the basic ExtensibleObject and ObjectExtension interfaces,
which can be reused to define extensible objects.
Unlike a full-blown implementation, these interfaces provide only
access interface, not a mechanism to perform actual state attachment.
The attachment mechanism will be defined in future, when the need
for it actually arises.
JIRA: YANGTOOLS-497
Change-Id: Ie390b6174b8909c87595dddc0d467858f36ef8bf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
33e06bd2f202c270f70b99091029cb18afeb792a)
Robert Varga [Thu, 28 Feb 2019 18:48:44 +0000 (19:48 +0100)]
Fix YangParserImpl streaming use
We should not be returning null, but "this", fix that.
Change-Id: I0683da43a4c1d0b30f8f7d0680be2aa17f4e05ec
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 26 Feb 2019 09:51:53 +0000 (10:51 +0100)]
Remove unneeded build-helper-plugin
yang-parser-impl does not include any antlr sources, hence we do
not need to helper plugin anymore.
Change-Id: I0b1439a24afae1cb0733846226161d5482adb67d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
3676af83eaa43cb27466a0a3479e511d5cc225f2)
Robert Varga [Tue, 19 Feb 2019 10:36:27 +0000 (11:36 +0100)]
Add StatementMap.toString()
This aids debugging by adding value content, making it easier
to read what is actually in the map.
Change-Id: Ibc4025b34ae2d1485462360069b5ce095c8bc222
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
19123bdf5d11bcb109965b70099b962e7423fd1a)
Robert Varga [Thu, 14 Feb 2019 16:47:37 +0000 (17:47 +0100)]
Prefer Immutable collections over Collections.emptyFoo()
Our immutable-checking logic works best on known classes, hence
we bias towards using ImmutableCollection-derived classes.
Change-Id: Ifdcfe3642f33b4ef050051b9cdbec74690740e37
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 14 Feb 2019 16:40:47 +0000 (17:40 +0100)]
Fix ImmutableUnkeyedListNodeBuilder.valueEquals()
Returning an empty Set from getValue() means that if we ever
encountered two instances of this class in comparison, their values
would fail to compare, as valueEquals() expects a List.
Fix this by returning ImmutableList.of() and codify that in the
return value.
Change-Id: I4301f4161648ea391f2e0a1e712e3f87c6dca33c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 14 Feb 2019 15:10:02 +0000 (16:10 +0100)]
Defang immutables.org
We do not want to leak annotations, so specify that in our style,
removing the need to suppress javax.annotation.
JIRA: YANGTOOLS-907
Change-Id: Ic363fc10e79336cd26274fb91d3791e3f8ba1334
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
6b0c1f975b558c3aef366e1e0c05a5abd2a4c946)
Robert Varga [Wed, 13 Feb 2019 11:52:14 +0000 (12:52 +0100)]
Refactor checkTouchApplicable()
We can remove direct overrides of checkTouchApplicable() by making
the method smarter in its checking of preconditions. Notably we
do not check TreeNode presence multiple times, but rather perform
a step-wise unpacking of state.
This has the benefit of having a clean place where we check if
automatic lifecycle is in effect and that happens only if the node
does not exist.
JIRA: YANGTOOLS-943
Change-Id: I72f4316c77d8f36efaf95209c36e898c9b4873cd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 13 Feb 2019 11:32:37 +0000 (12:32 +0100)]
Add ModificationPath.toString()
While we use ModificationPath internally only, having a toString()
on it is useful for debugging.
Change-Id: I516ae9a02f8467e67209c32ead5c7ccdcc20e146
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
098079dd4e4f335ae9648a668b852ac638818bd8)
Robert Varga [Tue, 12 Feb 2019 19:44:45 +0000 (20:44 +0100)]
Remove checkApplicable() overrides
The only time we are overriding checkApplicable() is in the TOUCH
case, which can more easily be handled through applyTouch().
Refactor AbstractNodeContainerModificationStrategy to include
the utility bits from AutomaticLifecycleMixin and move the override.
This reduces the number of implementations of checkApplicable()
from 7 to 2, while increasing the number of implementations of
checkTouchApplicable() from 3 to 7.
JIRA: YANGTOOLS-943
Change-Id: Iaf198ba852ff88d8e6b570b7c88b01f1064bb3a2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
136e34b09aa90ccbe5d20c0035fb3d573c45daeb)
Robert Varga [Tue, 12 Feb 2019 12:49:06 +0000 (13:49 +0100)]
Remove DelegatingModificationApplyOperation
MinMaxElementsValidation is the only subclass, hence merge the two
classes into one, making MinMaxElementsValidation type-safe through
use of the SchemaNode-generic of SchemaAwareApplyOperation.
Change-Id: I00700d2b45f4163072d8c4d4c364bd8047e5b430
JIRA: YANGTOOLS-955
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 12 Feb 2019 12:39:25 +0000 (13:39 +0100)]
Remove AlwaysFailOperation
AlwaysFailOperation guards the case when we do not have a schema
context, which is exceeding rare and there is exactly one place
where we can check for null to detect non-presence of an operation.
Remove this implementation along with
NonApplyDelegatedModificationApplyOperation, making
MinMaxElementsValidation the only delegating implementation.
JIRA: YANGTOOLS-955
Change-Id: Id70814eced80dd80948a1a5601287977fa77cf12
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 11 Feb 2019 14:23:06 +0000 (15:23 +0100)]
Remove unneeded Iterator.remove() overrides
Java 8 has retrofitted remove() to be a default method which
throws UnsupportedOperationException. Take advantage of this and
remove some of our code.
Change-Id: Ie4e4ac4ef947d5d65a3f5b80c249c21c35909f92
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 6 Feb 2019 15:55:16 +0000 (16:55 +0100)]
Cleanup yang-data-impl nullness annotations
This migrates yang-data-impl to use JDT nullness annotations, expanding
use of @NonNull in return types.
JIRA: YANGTOOLS-907
Change-Id: I16869db150ce28a94df5f6e5b55b5cf0fa07c34c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
5e2ee5120180b2cff62a6e8c2a2c172fbc625817)
Robert Varga [Wed, 6 Feb 2019 01:13:22 +0000 (02:13 +0100)]
SchemaAwareApplyOperation has getSchema()
Obviously, if an ModificationApplyOperation knows abouts its schema
it should expose it through getSchema(). This allows us to concentrate
fields a bit.
Change-Id: I9656b28dfb32fe7951e3ccd32b43eabe4427929f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
fd5c52cfb196a8d1dd6d6f2fb94f9a395c28afa7)
Robert Varga [Mon, 11 Feb 2019 10:46:17 +0000 (11:46 +0100)]
Correct mandatory leaf enforcement
Previous patch broke mandatory leaf enforcement on operational
data store. This patch fixes the logic to again apply this check.
Change-Id: I7b5d6ea05fea0b4df60c8cde9075168a3fa18e9c
JIRA: YANGTOOLS-947
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
875459db2abd73cbe5c9977c421e923e2c428de3)
Robert Varga [Tue, 5 Feb 2019 02:07:37 +0000 (03:07 +0100)]
Remove MapModificationStrategy hack
MapModificationStrategy has special handling to deal with DataTrees
rooted at a MapEntryNode, which really papered over failure of
InMemoryDataTree to properly resolve its root strategy.
Fix up InMemoryDataTree to use ListEntryModificationStrategy instead
of MapModificationStrategy when it is rooted at a particular map
entry.
JIRA: YANGTOOLS-951
Change-Id: I2e0306d1bf88fcee517a32c5903dfa98c287eb2c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
39d6912a0df959abf070bcec53d2157f938eb7fc)
Robert Varga [Tue, 5 Feb 2019 11:11:05 +0000 (12:11 +0100)]
Rework DataNodeContainerModificationStrategy child tracking
Since we do not want to expand the entire modification tree, but
instantiate it lazily, we have used a Guava LoadingCache to load
children.
Unfortunately this has couple of disadvantanges, namely:
- memory overhead of the cache and its entries
- access through a ConcurrentHashMap
- synchronized entry loading
As it turns out, we can do much better by maintaining an immutable
map ourselves, with compare-and-swap locking. This results in
much lower memory overhead as well as fast access, as we perform
only a single volatile read in that case.
JIRA: YANGTOOLS-950
Change-Id: I7b8c6d6561d65373e54cf5a5dd9f0bc2537531ac
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 4 Feb 2019 17:15:15 +0000 (18:15 +0100)]
Squash value-based ModificationStrategies
LeafSetEntryModificationStrategy and LeafModificationStrategy
share all of their codebase, rendering them useless. Remove them
and promote AbstractValueNodeModificationStrategy to a full
class.
JIRA: YANGTOOLS-941
Change-Id: I95f6d5eb106a003dee85028bc8bb0251a25a6130
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
d3ea78c642c428f640ab29f8f197a65e4c4477e1)
Robert Varga [Thu, 31 Jan 2019 14:36:28 +0000 (15:36 +0100)]
Separate out ModificationApplyOperation.verifyStructure()
The boolean handling of this method makes it really two distinct
methods, quickVerifyStructure() and fullVerifyStructure().
Refactor them so that we have two separate invocation paths, which
meet in SchemaAwareApplyOperation and from there are properly
dispatched to subclasses.
This reduces the number of implementations and makes it much clearer
as to what the specific and shared logic is. Most notably it makes
fullVerifyStructure() have only three implementations and
quickVerifyStructure() becomes bimorphic.
JIRA: YANGTOOLS-947
Change-Id: Ife836c7b9011e97a421746efa575148b1e77f6e9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
20df7021c844ccf06d1378f615c2988fff60edee)
Robert Varga [Mon, 28 Jan 2019 21:17:54 +0000 (22:17 +0100)]
Move NormalizedNode-based DataTreeCandidateNodes into API
These utility classes are useful for downstreams, and we have
an API point from where we can expose them in a relatively clean
fashion.
Move them to API package and expose them through DataTreeCandidateNodes
utility class.
Change-Id: Idaa276323f78baa273200f8d8c6b77e53fa60c6a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
e8ac6b68244f35fce04f421314259ec8683652aa)
Robert Varga [Thu, 31 Jan 2019 08:17:31 +0000 (09:17 +0100)]
Separate out RootModificationApplyOperation
RootModificationApplyOperation is an operation holder, which has
particular lifecycle and can give access to the current
ModificationApplyOperation.
Rename it to RootApplyStrategy and have it *not* a subclass of
ModificationApplyOperation. This makes the flow more consistent
as well as making it obvious the three classes constituing its
associated logic cannot every come up in the context of traversing
a modification tree.
JIRA: YANGTOOLS-949
Change-Id: I01061db38c6d631f804eef1b241a93eaf11626e5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 29 Jan 2019 23:38:13 +0000 (00:38 +0100)]
Add utility wrappers for instantiating builders/nodes
This removes the need for subclasses of
AbstractNodeContainerModificationStrategy to provide separate
methods, moving through a dispatch class instead. This lowers
the number of potential implementations down to one, with
the functionality being supported by 2 distinct classes.
As it turns out, this refactor actually has no additional overhead,
because the support instance reference can completely supplant
the Class reference we are holding.
JIRA: YANGTOOLS-941
Change-Id: I53a26981d41fb0cc6dd71dffd4e1bd71f9e9387d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
c91afd55c080cf25473767536b4509ae3b5e2603)
Robert Varga [Wed, 30 Jan 2019 12:49:40 +0000 (13:49 +0100)]
Eliminate no-op MandatoryLeafEnforcer
Running through a no-op enforcer, while efficient, still requires
a bimorphic invocation, which results most of the time in a no-op.
Eliminate the no-op implementation and refactor its two users, so
that they provide dedicated subclasses which use enforcer. This has
the benefit of not overriding SchemaAwareApplyOperation just to
run a noop invocation.
JIRA: YANGTOOLS-945
Change-Id: Iff44eb6efa048bb86a71b0d7753d3e58425b5e4d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
8dbd4934c7ed38b62a36a27322c663c6ddb45159)
Robert Varga [Wed, 30 Jan 2019 13:54:51 +0000 (14:54 +0100)]
Add Abstract{LeafSet,Map}ModificationStrategy
This allows us to remove some code duplication in constructor,
but notably share the implementation of getChild().
Furthermore it allows us to make the rooted-at-MapEntry hack work
consistently for ordered map nodes too.
JIRA: YANGTOOLS-946
Change-Id: Id91529c31341afd46a693f24eb1ac4ea0dc4800d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 30 Jan 2019 17:20:39 +0000 (18:20 +0100)]
Hide SchemaAwareApplyOperation.checkWriteApplicable()
The refactor of MinMaxValidation allows us to optimize
checkWriteApplicable() by completely hiding it.
JIRA: YANGTOOLS-944
Change-Id: I804ddb5e4c8b7562bde11994be8b1a5615228d7c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 30 Jan 2019 11:46:10 +0000 (12:46 +0100)]
Introduce DelegatingModificationApplyOperation
As it turns out implementations outside of SchemaAwareApplyOperation
can share implementations of most methods through delegation. Create
two new abstract classes, DelegatingModificationApplyOperation and
FullyDelegatedModificationApplyOperation which host partial and full
set of methods implemented as delegates.
FullyDelegatedModificationApplyOperation is used by AlwaysFailOperation
and RootModificationApplyOperation, as they the always-fail behaviour
is easily implemented through throwing ISE in delegate().
This eliminates 1-2 implementations of each ModificationApplyOperation
method.
Change-Id: I578769418baafb285593fefe8868e97e1d171157
JIRA: YANGTOOLS-944
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 30 Jan 2019 13:31:16 +0000 (14:31 +0100)]
Cleanup AbstractValueNodeModificationStrategy
The implementation did not log offending values and reused
verifyStructure() to perform validation, making analysis difficult.
Refactor the value check so that it is in a private method invoked
from the three codepaths which need to perform it, making code flow
clearer.
Change-Id: I315899982c0f304e0459d5ad33a19e56af0d2355
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 28 Jan 2019 13:19:00 +0000 (14:19 +0100)]
Fix automatic lifecycle delete stacking
Nodes with automatic lifecycle have the strange property that their
delete operations may actually stack with other operations.
Unfortunately delete operation itself has no semantics of having
underlying modifications, as it has no baseline to which to apply
them.
In order to fix this, we need to turn deletes into empty writes
for these constructs and once we are performing disappearing, undo
this trick. This effectively means that both empty writes and deletes
result in a delete operation, if they ended up modifying the tree,
or into a no-op if they did not.
JIRA: YANGTOOLS-938
Change-Id: I68b9f304e76d6b1bdb707f411a87cd6085ed8bc7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
75e30d2678989947221aef0fed94301faa785a9e)
Robert Varga [Mon, 28 Jan 2019 16:36:53 +0000 (17:36 +0100)]
Update junit link
javadoc.io breaks with JDK11, update the link.
Change-Id: Ia3a1bb2905a0e55797514537f220332754515c1d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
98665375f594ccb71face3ce2fa84c4b088ebaeb)
Robert Varga [Fri, 25 Jan 2019 11:14:28 +0000 (12:14 +0100)]
Fix artifacts typo
yangtools-docs is at the same version as yangtools, i.e. 2.1.9,
not 2.0.9.
Change-Id: I3d2473cee9d8b884931fc8a1960d992d2cd0d690
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 28 Jan 2019 12:55:19 +0000 (13:55 +0100)]
Optimize IMDT tests
These tests are sharing a SchemaContext, do not set it up multiple
times but reuse it across runs.
Change-Id: If9e27ace5e0e3af966102019d57ef074aa652c5b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 22 Jan 2019 15:34:20 +0000 (16:34 +0100)]
Fix yangtools-docs
Current docs fail to correctly deploy, fix that up. Also group
packages to make them more readable.
Change-Id: Iebf8c785ca0fd7968724759a2b593ca559620057
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 20 Jan 2019 23:48:17 +0000 (00:48 +0100)]
Rework aggregate javadocs
Since javadoc:aggregate-jar is forcing a full re-generate and compile
of the project, let's take a different approach.
This patch overloads the purpose of the docs directory so that it
participates on maven build. It produces a pom file with attached
sources and javadocs. Later we can add more stuff to it, too.
Change-Id: I866e8405e73f297c552194a7caf10c1fd8b26731
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 20 Jan 2019 23:30:35 +0000 (00:30 +0100)]
Remove unneded artifacts entries
object cahce is a thing of the past, remove these stale
entries.
Change-Id: I3d81196819c291364b7dad2d53431b8f0024516c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 20 Jan 2019 18:25:12 +0000 (19:25 +0100)]
Allow {Json,Xml}ParserStream to handle actions
Generalize the support for RPCs to include actions, so that we can
use both. Also fix null handling to comply with javadoc.
Change-Id: Id84052c1d1f20aa9d0371015f01b0c8845152de2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 20 Jan 2019 18:43:42 +0000 (19:43 +0100)]
Allow JSON/XML writers to be instantiated with root node
Rather than requiring a SchemaContext/SchemaPath combination, allow
writers to be instantiated by specifying a DataNodeContainer.
Change-Id: I9eb470587cad2af9b3390d134dcc03abc95e8645
JIRA: YANGTOOLS-935
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 18 Jan 2019 14:42:20 +0000 (15:42 +0100)]
Bump version to 9-SNAPSHOT
This starts the next development cycle.
Change-Id: I0be6ec1cb52f2603c2d2d6077df26f9892d69495
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Stephen Kitt [Fri, 18 Jan 2019 13:50:35 +0000 (14:50 +0100)]
Bump to odlparent 4.0.9
Change-Id: Ie33ea4ef73069041ec5883c461f08ea31740d8c0
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Robert Varga [Fri, 18 Jan 2019 12:08:07 +0000 (13:08 +0100)]
Remove writeValue()'s IOException throws
Neither implementation can throw an IOException, hence tighten
internal API contract.
Change-Id: I7e3fe5bebfae87f5130f85cd4f40c87061d528d1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 16 Jan 2019 21:27:05 +0000 (22:27 +0100)]
Clean up XMLStreamWriterUtils
This is slight refactor propagating @NonNull annotations and
acting on them:
- we do not need to use String.valueOf()
- we do not need guard against null values
- ValueWriter is a nice place to have a utility for doing
writeCharacters(obj.toString())
Change-Id: Idcbc24036c2ae07cf93481cba1a2e311db7def6f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 16 Jan 2019 16:29:52 +0000 (17:29 +0100)]
Delay calling writeStartElement()
Java's default XMLStreamWriter is rather bad at emitting self-closing
tags, in that it will not do that unless we explicitly call
writeEmptyElement().
This is rather unfortunate, as there is plenty of cases, where it's
the writer's job to realize the element should be self-closing, for
example in case it carries only attributes -- which we simply have
no way of driving through XMLStreamWriter.
In order to make this work, we need to delay the call to
writeStartElement() until we see the next event, which can end up
being writeEndElement() -- which is where when we need to use
writeEmptyElement() instead.
Since value serializers can end up emitting namespace declarations
and characters into the stream, we hide the writer behind two classes:
- ValueWriter, which is abstract class strictly for use by serializers
and exposes minimal methods required for them
- StreamWriterFacade, which is the sole implementation of ValueWriter,
which holds methods required by XMLStreamNormalizedNodeStreamWriter
StreamWriterFacade thus has visibility into activity of both call
sites and can make appropriate decisions.
JIRA: YANGTOOLS-927
Change-Id: Ib42d7662d0b9b648132e93bc4ea9fbe012104deb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 16 Jan 2019 22:16:33 +0000 (23:16 +0100)]
Deprecate XMLStreamNormalizedNodeStreamWriter.toString(Element)
This is an unused method, deprecate it for removal.
Change-Id: I6c0706d9d74ee7cae983b767c1b98e7899e04916
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 16 Jan 2019 21:38:04 +0000 (22:38 +0100)]
Do not write empty string in EmptyXmlCodec
Emitting an empty string does nothing but churn writer state,
so speed up EmptyXmlCodec by not touching the writer.
Change-Id: Iab7db37089b84ec1a3c2e3c9381265025e21fdca
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 16 Jan 2019 15:23:21 +0000 (16:23 +0100)]
Refactor implementations to hide XMLStreamWriter
In order to have control over when we output an element, we need
to make sure we know how the writer is being used.
Refactor XMLStreamNormalizedNodeStreamWriter interaction with its
subclasses so we know when we are leaking the writer -- which
happens only in writeValue().
JIRA: YANGTOOLS-927
Change-Id: I7e7bd62016e994a31fe6d69995e9d088746359da
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 14 Jan 2019 19:55:36 +0000 (20:55 +0100)]
Rework anyxml encoding
It seems JRE's Transformers are broken in the DOM->StAX direction,
such they do not work with external StAX implementations like
woodstox-core.
As it turns out, this is quite unnecessary complexity because
stax2-api gives us XMLStreamReader wrapping a DOM Element, which
we are already using in the parser side.
This patch removes the the use the transformer in favor of rather
simpler forwarding of XMLStreamReader events to the underlying
XMLStreamWriter.
Also move StAX-based transformer to XmlParserStream, as it is now
the only user of StAX->DOM, updating required feature to StAXSource.
Performs plain old DOM->stream translation, hence it can use any
old transformer.
JIRA: YANGTOOLS-926
Change-Id: I25d0210a6b76f7cbbd5956814773d26776cbace6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 16 Jan 2019 18:38:52 +0000 (19:38 +0100)]
Remove unused XMLStreamWriterUtils.writeAttribute() method
This method is completely unused, remove it.
Change-Id: I74c5eb42a1d20464270a41329bb849dd0e5b0b0e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 15 Jan 2019 18:19:08 +0000 (19:19 +0100)]
Fix default namespace emission
When we are emitting opening a new element, we need to consult
XMLStreamWriter before we emit the element, otherwise its state
already reflects the newly-started element.
In non-repairing mode the JDK writer will accept our invocation
and update the namespace mapping, which will lead us to erroneously
assume we do not need to emit the declaration.
Since it is non-repairing, it will not emit the declaration itself,
leading to a blank document -- something for which we are actually
testing in one of our tests.
In order to improve the confidence in results, also update tests
which used only repairing factories to use both repairing and
non-repairing ones.
JIRA: YANGTOOLS-801
Change-Id: I6975cf21121f7a8f92056b5b49b31d53b685dc0f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 15 Jan 2019 16:50:03 +0000 (17:50 +0100)]
Improve JAXP implementation compatibility
Testing with woodstox-core shows a couple of UT failures that
are really assumptions on the implementation. Address them so we
do not get failures when implementation changes (too much).
While we are at it, improve startsWith/contains string checks
by using hamcrest.
Change-Id: I4af0c9cc370e5699255725f049ee7bb9b5c171ac
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 10 Jan 2019 11:45:59 +0000 (12:45 +0100)]
Add javadoc.io badge
With aggregated javadocs out there, add a badge pointing to
javadoc.io.
Change-Id: I4fe75f7df39e56b01e6f33603f622577b90bdc9b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 10 Jan 2019 10:15:52 +0000 (11:15 +0100)]
Start 2.1.8 release development
This bumps artifacts to .8-SNAPSHOT version.
Change-Id: I023530bb8d3599149e74607ab97f0c92f96edd9c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Stephen Kitt [Wed, 9 Jan 2019 14:01:54 +0000 (15:01 +0100)]
Bump to odlparent 4.0.8
Change-Id: Iee91b1e015ee6c8a122b427860d5e96fd9f8cd42
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Robert Varga [Mon, 7 Jan 2019 09:30:49 +0000 (10:30 +0100)]
Remove JSR305 annotations from yang-data-codec-gson
Ditch JSR305 annotations in favor of JDT annotations.
JIRA: YANGTOOLS-907
Change-Id: I9b5a19f88f54ca92e07ce8404b469cc76a7858a5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 7 Jan 2019 10:06:53 +0000 (11:06 +0100)]
Remove JSR305 annotations from yang-data-codec-xml
Ditch JSR305 annotations in favor of JDT annotations.
JIRA: YANGTOOLS-907
Change-Id: Ife00f06b20b562f62514f8fbd2e36e3179223857
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 7 Jan 2019 09:39:47 +0000 (10:39 +0100)]
Remove JSR305 annotations from yang-data-util
Ditch JSR305 annotations in favor of JDT annotations.
JIRA: YANGTOOLS-907
Change-Id: Ia183995a947277ea78cb9e37e2aa1494f937c43e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>