Fix FindBugs error in DelayedListenerRegistration#getInstance 54/55054/1
authorTom Pantelis <tompantelis@gmail.com>
Fri, 14 Apr 2017 13:50:24 +0000 (09:50 -0400)
committerTom Pantelis <tompantelis@gmail.com>
Fri, 14 Apr 2017 13:50:24 +0000 (09:50 -0400)
commit99c2b121c8c4970c868de6342aac873da29b4ecb
tree9f9175af8116a307a37a916bedc58a88a40f356e
parent378f3ba51e8e49c3e54593656cc193fda7970388
Fix FindBugs error in DelayedListenerRegistration#getInstance

The ObjectRegistration interface was recently changed to annotate
getInstance with @Nonnull to promise it will not return a null.
However DelayedListenerRegistration could return null if the delegate
is not set yet. In reality, we do not and should not ever call this
method on DelayedListenerRegistration instances so I changed it to
throw UnsupportedOperationException to make it explicit and to avoid
the FindBugs error.

Change-Id: I9fe374b23336d8ade65b2f1b697d93f50a090df9
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DelayedListenerRegistration.java