diff --git a/platform/vcs-api/vcs-api-core/src/com/intellij/openapi/diff/impl/patch/PatchEP.java b/platform/vcs-api/vcs-api-core/src/com/intellij/openapi/diff/impl/patch/PatchEP.java index b36df05e7e5a..04a39f37065c 100644 --- a/platform/vcs-api/vcs-api-core/src/com/intellij/openapi/diff/impl/patch/PatchEP.java +++ b/platform/vcs-api/vcs-api-core/src/com/intellij/openapi/diff/impl/patch/PatchEP.java @@ -39,12 +39,12 @@ public interface PatchEP { * @param path - before path, if exist, otherwise after path * @param commitContext */ - void consumeContent(@NotNull final String path, @NotNull final CharSequence content, CommitContext commitContext); + void consumeContent(@NotNull final String path, @NotNull final CharSequence content, @Nullable CommitContext commitContext); /** * @param path - before path, if exist, otherwise after path * @param commitContext */ void consumeContentBeforePatchApplied(@NotNull final String path, @NotNull final CharSequence content, - CommitContext commitContext); + @Nullable CommitContext commitContext); } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchDefaultExecutor.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchDefaultExecutor.java index 49bf54bff745..f36eb85dfe9d 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchDefaultExecutor.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchDefaultExecutor.java @@ -87,7 +87,7 @@ public class ApplyPatchDefaultExecutor implements ApplyPatchExecutor>, PatchSyntaxException> additionalInfo, - CommitContext commitContext) { + @Nullable CommitContext commitContext) { applyAdditionalInfoImpl(project, additionalInfo, commitContext, infoGroup -> infoGroup.myPatchEP.consumeContentBeforePatchApplied(infoGroup.myPath, infoGroup.myContent, infoGroup.myCommitContext)); } @@ -101,7 +101,7 @@ public class ApplyPatchDefaultExecutor implements ApplyPatchExecutor>, PatchSyntaxException> additionalInfo, - CommitContext commitContext, final Consumer worker) { + @Nullable CommitContext commitContext, final Consumer worker) { final PatchEP[] extensions = Extensions.getExtensions(PatchEP.EP_NAME, project); if (extensions.length == 0) return; if (additionalInfo != null) { @@ -129,9 +129,9 @@ public class ApplyPatchDefaultExecutor implements ApplyPatchExecutor loadPatches(Project project, final String patchPath, - CommitContext commitContext) throws IOException, PatchSyntaxException { + @Nullable CommitContext commitContext) throws IOException, PatchSyntaxException { return loadPatches(project, patchPath, commitContext, true); } @NotNull static List loadPatchesWithoutContent(Project project, final String patchPath, - CommitContext commitContext) throws IOException, PatchSyntaxException { + @Nullable CommitContext commitContext) throws IOException, PatchSyntaxException { return loadPatches(project, patchPath, commitContext, false); } private static List loadPatches(Project project, final String patchPath, - CommitContext commitContext, + @Nullable CommitContext commitContext, boolean loadContent) throws IOException, PatchSyntaxException { char[] text = FileUtil.loadFileText(new File(patchPath), CharsetToolkit.UTF8); PatchReader reader = new PatchReader(new CharArrayCharSequence(text), loadContent);