diff --git a/updater/src/com/intellij/updater/DiffCalculator.java b/updater/src/com/intellij/updater/DiffCalculator.java index 67ac93111262..a08a663c6025 100644 --- a/updater/src/com/intellij/updater/DiffCalculator.java +++ b/updater/src/com/intellij/updater/DiffCalculator.java @@ -49,13 +49,14 @@ public class DiffCalculator { for (Map.Entry create : toCreate.entrySet()) { if (Digester.isFile(create.getValue())) { - List sameName = byName.get(new File(create.getKey()).getName()); - String source = findBestCandidateForMove(sameName, create.getKey()); - boolean move = false; - List sameContent = byContent.get(create.getValue()); - if (source != null && source.equals(findBestCandidateForMove(sameContent, create.getKey()))) { - move = true; + String source = findBestCandidateForMove(sameContent, create.getKey()); + boolean move = true; + + if (source == null) { + List sameName = byName.get(new File(create.getKey()).getName()); + source = findBestCandidateForMove(sameName, create.getKey()); + move = false; } if (source != null && !critical.contains(source)) { @@ -99,8 +100,8 @@ public class DiffCalculator { if (i + 1 > common) { best = other; common = i + 1; + // check root folders of candidates with the same matches } - // check root folders of candidates with the same matches else if (i + 1 == common && compareRootFolders(dirs, best.split("/")) < compareRootFolders(dirs, other.split("/"))) { best = other; }