Improve RestconfDocumentedException 32/107232/1
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 3 Aug 2023 16:01:39 +0000 (18:01 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 3 Aug 2023 16:01:39 +0000 (18:01 +0200)
commite6e2b79e4e644950ac3ea0c16d9fbe5ed9696fac
tree6d6955d783b11d07ff72c5a6be66b83ae4994af0
parent6151f0444151183903debc231039dbf3183cd560
Improve RestconfDocumentedException

Use instanceof pattern to remove an explicit cast. Also check incoming
errors and do not allocate an ArrayList if the list is null or empty.

Change-Id: I2201438e0fdb11239dfad071987cdc116f748a48
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/errors/RestconfDocumentedException.java