diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/changes/IgnoredFileBean.java b/platform/vcs-api/src/com/intellij/openapi/vcs/changes/IgnoredFileBean.java index 2245b5eae90b..ad302067592f 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/changes/IgnoredFileBean.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/changes/IgnoredFileBean.java @@ -30,10 +30,10 @@ import com.intellij.openapi.vfs.LocalFileSystem; import com.intellij.openapi.vfs.VfsUtilCore; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.vfs.newvfs.impl.NullVirtualFile; +import com.intellij.util.PathUtilRt; import com.intellij.util.PatternUtil; import org.jetbrains.annotations.Nullable; -import java.io.File; import java.util.regex.Matcher; public class IgnoredFileBean { @@ -48,12 +48,7 @@ public class IgnoredFileBean { IgnoredFileBean(String path, IgnoreSettingsType type, Project project) { myPath = path; myType = type; - if (IgnoreSettingsType.FILE.equals(type)) { - myFilenameIfFile = new File(path).getName(); - } - else { - myFilenameIfFile = null; - } + myFilenameIfFile = IgnoreSettingsType.FILE.equals(type) ? PathUtilRt.getFileName(path) : null; myProject = project; myMask = null; myMatcher = null; diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListManagerSerialization.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListManagerSerialization.java index 7fe34d648596..cc659cd7e4a5 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListManagerSerialization.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListManagerSerialization.java @@ -17,7 +17,6 @@ package com.intellij.openapi.vcs.changes; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Comparing; -import com.intellij.openapi.util.InvalidDataException; import com.intellij.openapi.util.WriteExternalException; import com.intellij.openapi.util.text.StringUtil; import org.jdom.Element; @@ -54,7 +53,7 @@ class ChangeListManagerSerialization { } @SuppressWarnings({"unchecked"}) - public void readExternal(final Element element) throws InvalidDataException { + public void readExternal(final Element element) { final List listNodes = element.getChildren(NODE_LIST); for (Element listNode : listNodes) { readChangeList(listNode); @@ -135,7 +134,7 @@ class ChangeListManagerSerialization { listNode.setAttribute(ATT_COMMENT, comment); } List changes = new ArrayList<>(list.getChanges()); - Collections.sort(changes, new ChangeComparator()); + changes.sort(new ChangeComparator()); for (Change change : changes) { writeChange(listNode, change); }