Fix checkArgument() use 40/96840/1
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 8 Jul 2021 16:59:01 +0000 (18:59 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 8 Jul 2021 17:13:27 +0000 (19:13 +0200)
We do not want to concat the strings here, use a proper formatting
string -- speeding things up.

Change-Id: I0585752e07a4e58abf22d3e0facc93d0623ee198
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/SubscribeToStreamUtil.java

index ff06d5b24de99e422d92f8c350749812f8c0e591..c38443cc9d5d9464697f037345e4abf9ad049e39 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.restconf.nb.rfc8040.rests.services.impl;
 
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+
 import com.google.common.base.Strings;
 import java.net.URI;
 import java.util.HashMap;
@@ -193,7 +194,7 @@ abstract class SubscribeToStreamUtil {
 
         final String streamName = ListenersBroker.createStreamNameFromUri(identifier);
         final Optional<ListenerAdapter> listener = ListenersBroker.getInstance().getDataChangeListenerFor(streamName);
-        Preconditions.checkArgument(listener.isPresent(), "Listener doesn't exist : " + streamName);
+        checkArgument(listener.isPresent(), "Listener does not exist : %s", streamName);
 
         listener.get().setQueryParams(
                 notificationQueryParams.getStart(),