Do not leak Optional in QNameWithPredicateImpl.toString() 66/75766/2
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 5 Sep 2018 15:19:49 +0000 (17:19 +0200)
committerRobert Varga <nite@hq.sk>
Wed, 5 Sep 2018 16:31:31 +0000 (16:31 +0000)
commit5f2b4c86401574da7eafae5a1e86d28388767de9
tree86fba6a4f63d0cbe37d31ba3ad2c606b1cb065ba
parent5a97c944ecd784de5146cd1cb25134e0be7d29f3
Do not leak Optional in QNameWithPredicateImpl.toString()

The toString() method blindly appends the revision, leading to
Optional[] being present in the result. Fix the method to look
at the returned version and append the query only when it is
present -- just like QName does.

Change-Id: I47dcdaa3c7ca7b3bfaf34898f76b10dfb2ddbe00
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 1951860b7c0ae2a74735a138b3227e09fd718745)
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/leafref/QNameWithPredicateImpl.java