Use Preconditions 87/15487/1
authorRobert Varga <rovarga@cisco.com>
Thu, 19 Feb 2015 08:32:05 +0000 (09:32 +0100)
committerRobert Varga <rovarga@cisco.com>
Thu, 19 Feb 2015 08:32:05 +0000 (09:32 +0100)
Instead of an explicit if/throw, use a checkState.

Change-Id: Ia871c93649bfa6bd2f6e2283a3baa7eca6a8ca91
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/md-sal/messagebus-impl/src/main/java/org/opendaylight/controller/messagebus/app/impl/Topic.java

index aebde0c0432df8fb3f75085f8cc749d0b8e39bdc..a32413064e429403aeaa9a032845e3a34ee8fbde 100644 (file)
@@ -63,10 +63,7 @@ public class Topic implements DataChangeListener {
     public void notifyNode(final NodeId nodeId) {
         JoinTopicInput jti = getJoinTopicInputArgument(nodeId);
         EventSourceService ess = mdSal.getRpcService(EventSourceService.class);
-
-        if (ess == null) {
-            throw new IllegalStateException("EventSourceService is not registered.");
-        }
+        Preconditions.checkState(ess != null, "EventSourceService is not registered");
 
         ess.joinTopic(jti);
     }