Fix precondition formatting 57/9957/1
authorRobert Varga <rovarga@cisco.com>
Thu, 14 Aug 2014 19:45:42 +0000 (21:45 +0200)
committerRobert Varga <rovarga@cisco.com>
Thu, 14 Aug 2014 19:45:42 +0000 (21:45 +0200)
Preconditions take String.format() arguments, not {} placeholders.

Change-Id: I6fe863e3954ccb0c6a861ec969691072933406a2
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/messages/SendErrorExceptionUtil.java

index 4c4ff2fc583a0a1007ccd4b4706054c097eb2d0c..6604834fe42c02b3b3188fd7cd7f85c7b887ff3d 100644 (file)
@@ -59,12 +59,12 @@ public final class SendErrorExceptionUtil {
             final NetconfDocumentedException sendErrorException) {
         try {
             final Element incommingRpc = incommingDocument.getDocumentElement();
-            Preconditions.checkState(incommingRpc.getTagName().equals(XmlNetconfConstants.RPC_KEY), "Missing "
-                    + XmlNetconfConstants.RPC_KEY + " " + "element");
+            Preconditions.checkState(incommingRpc.getTagName().equals(XmlNetconfConstants.RPC_KEY), "Missing %s element",
+                    XmlNetconfConstants.RPC_KEY);
 
             final Element rpcReply = errorDocument.getDocumentElement();
-            Preconditions.checkState(rpcReply.getTagName().equals(XmlNetconfConstants.RPC_REPLY_KEY), "Missing "
-                    + XmlNetconfConstants.RPC_REPLY_KEY + " element");
+            Preconditions.checkState(rpcReply.getTagName().equals(XmlNetconfConstants.RPC_REPLY_KEY), "Missing %s element",
+                    XmlNetconfConstants.RPC_REPLY_KEY);
 
             final NamedNodeMap incomingAttributes = incommingRpc.getAttributes();
             for (int i = 0; i < incomingAttributes.getLength(); i++) {
@@ -97,7 +97,7 @@ public final class SendErrorExceptionUtil {
 
         @Override
         public void operationComplete(final ChannelFuture channelFuture) throws Exception {
-            Preconditions.checkState(channelFuture.isSuccess(), "Unable to send exception {}", sendErrorException,
+            Preconditions.checkState(channelFuture.isSuccess(), "Unable to send exception %s", sendErrorException,
                     channelFuture.cause());
         }
     }