Instead of an explicit if/throw, use a checkState.
Change-Id: Ia871c93649bfa6bd2f6e2283a3baa7eca6a8ca91
Signed-off-by: Robert Varga <rovarga@cisco.com>
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);
}