diff --git a/platform/platform-tests/testSrc/com/intellij/history/integration/PatchingTestCase.java b/platform/platform-tests/testSrc/com/intellij/history/integration/PatchingTestCase.java index 439735b8ed2a..963024311ad7 100644 --- a/platform/platform-tests/testSrc/com/intellij/history/integration/PatchingTestCase.java +++ b/platform/platform-tests/testSrc/com/intellij/history/integration/PatchingTestCase.java @@ -49,7 +49,7 @@ public abstract class PatchingTestCase extends IntegrationTestCase { protected void applyPatch() throws Exception { PatchReader reader = PatchVirtualFileReader.create(LocalFileSystem.getInstance().refreshAndFindFileByPath(patchFilePath)); - List patches = new ArrayList<>(reader.readAllPatches()); + List patches = new ArrayList<>(reader.readTextPatches()); new PatchApplier(myProject, myRoot, patches, null, null, null).execute(); } diff --git a/platform/vcs-api/src/com/intellij/openapi/diff/impl/patch/PatchReader.java b/platform/vcs-api/src/com/intellij/openapi/diff/impl/patch/PatchReader.java index 3662790ec286..9879162a1c31 100644 --- a/platform/vcs-api/src/com/intellij/openapi/diff/impl/patch/PatchReader.java +++ b/platform/vcs-api/src/com/intellij/openapi/diff/impl/patch/PatchReader.java @@ -72,6 +72,11 @@ public class PatchReader { myPatchContentParser = new PatchContentParser(saveHunks); } + /** + * @deprecated use {@link PatchReader#readTextPatches()} instead + */ + @Deprecated + @NotNull public List readAllPatches() throws PatchSyntaxException { return readTextPatches(); } @@ -79,7 +84,7 @@ public class PatchReader { @NotNull public List readTextPatches() throws PatchSyntaxException { parseAllPatches(); - return getPatches(); + return getTextPatches(); } @Nullable @@ -118,7 +123,17 @@ public class PatchReader { } }*/ + /** + * @deprecated use {@link PatchReader#getTextPatches()} or {@link PatchReader#getAllPatches()} instead + */ + @Deprecated + @NotNull public List getPatches() { + return getTextPatches(); + } + + @NotNull + public List getTextPatches() { return ContainerUtil.findAll(myPatches, TextFilePatch.class); } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelveChangesManager.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelveChangesManager.java index 3efbe22ea226..b570dfd415dd 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelveChangesManager.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelveChangesManager.java @@ -910,7 +910,7 @@ public class ShelveChangesManager extends AbstractProjectComponent implements JD boolean loadContent) throws IOException, PatchSyntaxException { char[] text = FileUtil.loadFileText(new File(patchPath), CharsetToolkit.UTF8); PatchReader reader = new PatchReader(new CharArrayCharSequence(text), loadContent); - final List textFilePatches = reader.readAllPatches(); + final List textFilePatches = reader.readTextPatches(); final TransparentlyFailedValueI>, PatchSyntaxException> additionalInfo = reader.getAdditionalInfo( null); ApplyPatchDefaultExecutor.applyAdditionalInfoBefore(project, additionalInfo, commitContext); diff --git a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/ConflictCreator.java b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/ConflictCreator.java index 9c26238cc634..e26c2c9fca7a 100644 --- a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/ConflictCreator.java +++ b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/ConflictCreator.java @@ -68,7 +68,7 @@ public class ConflictCreator { } final PatchReader reader = new PatchReader(myData.getTheirsPatch()); - final List patches = reader.readAllPatches(); + final List patches = reader.readTextPatches(); final List filePatchList = new ArrayList<>(patches); for (Iterator iterator = filePatchList.iterator(); iterator.hasNext(); ) { final FilePatch patch = iterator.next();