bug - missing excaping of % character in String.format() method 32/5932/1
authorJozef Gloncak <jgloncak@cisco.com>
Mon, 7 Apr 2014 06:27:19 +0000 (08:27 +0200)
committerJozef Gloncak <jgloncak@cisco.com>
Mon, 7 Apr 2014 06:28:44 +0000 (08:28 +0200)
Change-Id: Ic44ff0cf558efbba9c465ac760da13fcf3add2cb
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/RestconfImpl.xtend

index 8ebf28f35f1771ec778fc6e1a5b16088f6aafe16..fa478ac72e398ae928c619004023b8aae6cc68fe 100644 (file)
@@ -305,7 +305,7 @@ class RestconfImpl implements RestconfService {
         return callRpc(rpc, null)
     }
 
-    def resolveIdentifierInInvokeRpc(String identifier) {
+    private def resolveIdentifierInInvokeRpc(String identifier) {
         if (identifier.indexOf("/") === -1) {
             val identifierDecoded = identifier.urlPathArgDecode
             val rpc = identifierDecoded.rpcDefinition
@@ -314,8 +314,8 @@ class RestconfImpl implements RestconfService {
             }
             throw new ResponseException(NOT_FOUND, "RPC does not exist.");
         }
-        val slashErrorMsg  = String.format("Identifier %n%s%ncan't contain slash character (/). +
-            If slash is part of identifier name then use %2F placeholder.",identifier)
+        val slashErrorMsg = String.format(
+            "Identifier %n%s%ncan't contain slash character (/).%nIf slash is part of identifier name then use %%2F placeholder.", identifier)
         throw new ResponseException(NOT_FOUND, slashErrorMsg);
     }