Clean up DataContainerCodecContext exception handling 82/106182/1
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 22 May 2023 23:13:00 +0000 (01:13 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Sat, 27 May 2023 02:11:48 +0000 (04:11 +0200)
commitc2062da0098f79cdb237cc89b16ae4818399d55d
tree3020cd39d1a573b04823da61b32b94c95d6b3a3d
parent3b0c227f98ceaaef7d5c73cbb95b9c0b87cc9a4c
Clean up DataContainerCodecContext exception handling

We are getting confused between immediate throws and returns. The
exception factory methods should be returning the exception and not
throwing it.

Fix this up and add a SpotBugs annotation so that throws are guarded.
Also mark IncorrectNestingException for evolution. Final improvement
that we now have a completely-static factory method.

Change-Id: I5262c0dbb31d6935f258909828aac5331c70801b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 469a57c3adac4b6ae0df0c6398d926096cca13e2)
binding/mdsal-binding-dom-codec-api/src/main/java/org/opendaylight/mdsal/binding/dom/codec/api/IncorrectNestingException.java
binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/mdsal/binding/dom/codec/impl/DataContainerCodecContext.java