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

ASF subversion and git services commented on KARAF-6120:
--------------------------------------------------------

Commit 6bb884c2cddf4d9d6779e94e509c98bfd77dca52 in karaf's branch 
refs/heads/master from Mike Mansell
[ https://gitbox.apache.org/repos/asf?p=karaf.git;h=6bb884c ]

[KARAF-6120] Fix Windows separator confusing regex in Profiles

A number of places are using the String.replaceAll() method to inject/remove 
the file system path separator. In the case of Windows, the \ is a regex 
partial escape sequence. replaceAll()'s parameters are part of regex. Instead, 
using replace() to fix the problem.


> Karaf Profiles don't parse on Windows
> -------------------------------------
>
>                 Key: KARAF-6120
>                 URL: https://issues.apache.org/jira/browse/KARAF-6120
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf
>    Affects Versions: 4.2.2
>            Reporter: Mike Mansell
>            Assignee: Jean-Baptiste Onofré
>            Priority: Major
>              Labels: profile, windows
>             Fix For: 4.2.3
>
>
> During the handling of Profiles within the 
> org.apache.karaf.profile.impl.Profiles, there are a number of cases where the 
> String.replaceAll() is used that should be using the String.replace().
> Unfortunately, in these cases, is uses the FileSystem separator as part of 
> the search or replacement string, but replaceAll treats those parameters as 
> part of a regular expression. In the case on Windows, the separator is \, 
> which is a partial escape for a regular expression. This causes an error 
> during the call to replaceAll (Linux and Mac are fine since their file 
> separators are not special characters in Regular Expressions).
> Since none of the uses of replaceAll() in the Profiles class are actually 
> attempting to do regular expressions, they can simply be replaced with a 
> replace().



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

Reply via email to