Fix String.format() strings 31/14531/2
authorRobert Varga <rovarga@cisco.com>
Tue, 27 Jan 2015 10:59:50 +0000 (11:59 +0100)
committerRobert Varga <rovarga@cisco.com>
Wed, 28 Jan 2015 16:19:00 +0000 (17:19 +0100)
String.format() takes %s as a placeholder.

Change-Id: I1465b36b4d5ef56f25d3ee433450bbdd2ee97c3b
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ThreePhaseCommitCohortProxy.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TransactionProxy.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/SerializationUtils.java

index 6e5ba1c..932c36f 100644 (file)
@@ -15,6 +15,8 @@ import com.google.common.annotations.VisibleForTesting;
 import com.google.common.collect.Lists;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.SettableFuture;
+import java.util.Collections;
+import java.util.List;
 import org.opendaylight.controller.cluster.datastore.messages.AbortTransaction;
 import org.opendaylight.controller.cluster.datastore.messages.AbortTransactionReply;
 import org.opendaylight.controller.cluster.datastore.messages.CanCommitTransaction;
@@ -27,8 +29,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import scala.concurrent.Future;
 import scala.runtime.AbstractFunction1;
-import java.util.Collections;
-import java.util.List;
 
 /**
  * ThreePhaseCommitCohortProxy represents a set of remote cohort proxies
@@ -133,7 +133,7 @@ public class ThreePhaseCommitCohortProxy implements DOMStoreThreePhaseCommitCoho
                     } else {
                         LOG.error("Unexpected response type {}", response.getClass());
                         returnFuture.setException(new IllegalArgumentException(
-                                String.format("Unexpected response type {}", response.getClass())));
+                                String.format("Unexpected response type %s", response.getClass())));
                         return;
                     }
                 }
@@ -239,7 +239,7 @@ public class ThreePhaseCommitCohortProxy implements DOMStoreThreePhaseCommitCoho
                     for(Object response: responses) {
                         if(!response.getClass().equals(expectedResponseClass)) {
                             exceptionToPropagate = new IllegalArgumentException(
-                                    String.format("Unexpected response type {}",
+                                    String.format("Unexpected response type %s",
                                             response.getClass()));
                             break;
                         }
index 9f48ef9..af1e4e9 100644 (file)
@@ -901,7 +901,7 @@ public class TransactionProxy implements DOMStoreReadWriteTransaction {
 
                     } else {
                         // Throwing an exception here will fail the Future.
-                        throw new IllegalArgumentException(String.format("Invalid reply type {}",
+                        throw new IllegalArgumentException(String.format("Invalid reply type %s",
                                 serializedReadyReply.getClass()));
                     }
                 }
index 3f21257..87c78bd 100644 (file)
@@ -37,7 +37,7 @@ public final class SerializationUtils {
             NormalizedNodeWriter.forStreamWriter(streamWriter).write(node);
             streamWriter.writeYangInstanceIdentifier(path);
         } catch (IOException e) {
-            throw new IllegalArgumentException(String.format("Error serializing path {} and Node {}",
+            throw new IllegalArgumentException(String.format("Error serializing path %s and Node %s",
                     path, node), e);
         }
     }
@@ -61,7 +61,7 @@ public final class SerializationUtils {
                 NormalizedNodeWriter.forStreamWriter(streamWriter).write(node);
             }
         } catch (IOException e) {
-            throw new IllegalArgumentException(String.format("Error serializing NormalizedNode {}",
+            throw new IllegalArgumentException(String.format("Error serializing NormalizedNode %s",
                     node), e);
         }
     }