[ 
https://issues.apache.org/jira/browse/JCLOUDS-1433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16539130#comment-16539130
 ] 

Jesse Glick commented on JCLOUDS-1433:
--------------------------------------

Filed PRĀ 1228 with a fix.

> IllegalArgumentException from Strings2.replaceTokens
> ----------------------------------------------------
>
>                 Key: JCLOUDS-1433
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-1433
>             Project: jclouds
>          Issue Type: Bug
>          Components: jclouds-core
>    Affects Versions: 2.2.0
>            Reporter: Jesse Glick
>            Priority: Major
>
> While testing scenarios related to JCLOUDS-1401, I noticed that some 
> operations on blobs with funny filename characters resulted in exceptions 
> like:
> {code:none}
> java.lang.IllegalArgumentException: Illegal group reference
>       at java.util.regex.Matcher.appendReplacement(Matcher.java:857)
>       at java.util.regex.Matcher.replaceAll(Matcher.java:955)
>       at org.jclouds.util.Strings2.replaceTokens(Strings2.java:185)
>       at 
> org.jclouds.rest.internal.RestAnnotationProcessor.addHeader(RestAnnotationProcessor.java:763)
>       at 
> org.jclouds.rest.internal.RestAnnotationProcessor.addHeaderIfAnnotationPresentOnMethod(RestAnnotationProcessor.java:756)
>       at 
> org.jclouds.rest.internal.RestAnnotationProcessor.buildHeaders(RestAnnotationProcessor.java:719)
>       at 
> org.jclouds.rest.internal.RestAnnotationProcessor.apply(RestAnnotationProcessor.java:268)
>       at 
> org.jclouds.rest.internal.RestAnnotationProcessor.apply(RestAnnotationProcessor.java:137)
>       at 
> org.jclouds.rest.internal.InvokeHttpMethod.toCommand(InvokeHttpMethod.java:189)
>       at 
> org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:85)
>       at 
> org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:74)
>       at 
> org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:45)
>       at 
> org.jclouds.rest.internal.DelegatesToInvocationFunction.handle(DelegatesToInvocationFunction.java:156)
>       at 
> org.jclouds.rest.internal.DelegatesToInvocationFunction.invoke(DelegatesToInvocationFunction.java:123)
>       at com.sun.proxy.$Proxy98.copyObject(Unknown Source)
>       at org.jclouds.s3.blobstore.S3BlobStore.copyBlob(S3BlobStore.java:324)
> {code}
> This seems to be due to a failure to notice that {{Matcher.replaceAll}} 
> interprets some metacharacters in its argument.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to