> @@ -101,7 +102,8 @@ public MockResponse dispatch(RecordedRequest request) 
> throws InterruptedExceptio
>                  * access.json or accessRackspace) for the declared service
>                  * endpoints.
>                  */
> -               String newBody = new 
> String(response.getBody()).replace(":\"URL", ":\"" + url.toString());
> +               String newBody = new 
> String(response.getBody()).replaceAll("\\s*\"\\s*URL", " \"" + 
> url.toString());

Not checking for the `:` any more? is that intentional? Could you also add a 
comment along the lines of "support patterns with spaces such as `    "  URL`"?

Also, if this is called often, perhaps consider pulling the pattern out into a 
`urlTokenPattern` constant and using
```
urlTokenPattern.matcher(new String(response.getBody())).replaceAll(" \"" + 
url.toString());
```
instead? I'm guessing from the above import that you may have been thinking 
about that too..? ;-)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/404/files#r13710630

Reply via email to