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 6e5ba1c90c998102d8878d6b8e6a7c659a475ea4..932c36fe3469f00b5c1d5ed6b38706f48783117f 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 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;
 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 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
 
 /**
  * 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(
                     } 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;
                     }
                 }
                         return;
                     }
                 }
@@ -239,7 +239,7 @@ public class ThreePhaseCommitCohortProxy implements DOMStoreThreePhaseCommitCoho
                     for(Object response: responses) {
                         if(!response.getClass().equals(expectedResponseClass)) {
                             exceptionToPropagate = new IllegalArgumentException(
                     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;
                         }
                                             response.getClass()));
                             break;
                         }
index 9f48ef96cf517e265970b744b87af014dc51cbca..af1e4e92b60ef80effd9b3d443fd9743cef54900 100644 (file)
@@ -901,7 +901,7 @@ public class TransactionProxy implements DOMStoreReadWriteTransaction {
 
                     } else {
                         // Throwing an exception here will fail the Future.
 
                     } 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()));
                     }
                 }
                                 serializedReadyReply.getClass()));
                     }
                 }
index 3f2125746300f5350ae42be63d10e6b761840a2e..87c78bd27535cdbd08ed2e86c3af3b59abb7c8ca 100644 (file)
@@ -37,7 +37,7 @@ public final class SerializationUtils {
             NormalizedNodeWriter.forStreamWriter(streamWriter).write(node);
             streamWriter.writeYangInstanceIdentifier(path);
         } catch (IOException e) {
             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);
         }
     }
                     path, node), e);
         }
     }
@@ -61,7 +61,7 @@ public final class SerializationUtils {
                 NormalizedNodeWriter.forStreamWriter(streamWriter).write(node);
             }
         } catch (IOException e) {
                 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);
         }
     }
                     node), e);
         }
     }