|
@@ -285,11 +285,12 @@ public class LeaseManager {
|
|
|
", replaceBy=" + replaceBy);
|
|
|
}
|
|
|
|
|
|
+ final int len = overwrite.length();
|
|
|
for(Map.Entry<String, Lease> entry : findLeaseWithPrefixPath(src, sortedLeasesByPath)) {
|
|
|
final String oldpath = entry.getKey();
|
|
|
final Lease lease = entry.getValue();
|
|
|
- final String newpath = oldpath.replaceFirst(
|
|
|
- java.util.regex.Pattern.quote(overwrite), replaceBy);
|
|
|
+ //overwrite must be a prefix of oldpath
|
|
|
+ final String newpath = replaceBy + oldpath.substring(len);
|
|
|
if (LOG.isDebugEnabled()) {
|
|
|
LOG.debug("changeLease: replacing " + oldpath + " with " + newpath);
|
|
|
}
|