From 37b8d07b15f23675fe8eb32ac079cb18c4ba8e8f Mon Sep 17 00:00:00 2001 From: Alexander Koshevoy Date: Tue, 10 May 2016 19:21:06 +0300 Subject: [PATCH] Regression introduced by the fix of PY-19192 fixed The root remote path of a path mapping should be replaceable itself. Regression caught by PyRemotePathMapperTest.testReplicatedFolderInsideSysPath(). --- platform/util/src/com/intellij/util/PathMappingSettings.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/util/src/com/intellij/util/PathMappingSettings.java b/platform/util/src/com/intellij/util/PathMappingSettings.java index eef0d59abd3b..348dcbfe37ae 100644 --- a/platform/util/src/com/intellij/util/PathMappingSettings.java +++ b/platform/util/src/com/intellij/util/PathMappingSettings.java @@ -345,6 +345,7 @@ public class PathMappingSettings extends AbstractPathMapper implements Cloneable private static boolean canReplaceRemote(@NotNull String path, @NotNull String remotePrefix) { path = norm(path); remotePrefix = norm(remotePrefix); - return path.startsWith(remotePrefix) && (remotePrefix.endsWith("/") || path.substring(remotePrefix.length()).startsWith("/")); + return path.startsWith(remotePrefix) && + (path.length() == remotePrefix.length() || remotePrefix.endsWith("/") || path.substring(remotePrefix.length()).startsWith("/")); } }