[shelf]: annotate as Nullable

This commit is contained in:
Nadya Zabrodina
2017-05-17 17:22:43 +03:00
parent d06642558c
commit 140109f1eb
2 changed files with 4 additions and 3 deletions
@@ -38,7 +38,7 @@ public class ApplyTextFilePatch extends ApplyFilePatchBase<TextFilePatch> {
}
@Nullable
protected Result applyChange(final Project project, final VirtualFile fileToPatch, final FilePath pathBeforeRename, final Getter<CharSequence> baseContents) throws IOException {
protected Result applyChange(final Project project, final VirtualFile fileToPatch, final FilePath pathBeforeRename, @Nullable final Getter<CharSequence> baseContents) throws IOException {
byte[] fileContents = fileToPatch.contentsToByteArray();
CharSequence text = LoadTextUtil.getTextByBinaryPresentation(fileContents, fileToPatch);
final GenericPatchApplier applier = new GenericPatchApplier(text, myPatch.getHunks());
@@ -28,6 +28,7 @@ import com.intellij.openapi.vcs.FilePath;
import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.List;
@@ -40,7 +41,7 @@ public class ApplyPatchForBaseRevisionTexts {
@NotNull
public static ApplyPatchForBaseRevisionTexts create(final Project project, final VirtualFile file, final FilePath pathBeforeRename,
final TextFilePatch patch, final Getter<CharSequence> baseContents) {
final TextFilePatch patch, @Nullable final Getter<CharSequence> baseContents) {
assert ! patch.isNewFile();
final String beforeVersionId = patch.getBeforeVersionId();
DefaultPatchBaseVersionProvider provider = null;
@@ -58,7 +59,7 @@ public class ApplyPatchForBaseRevisionTexts {
final FilePath pathBeforeRename,
final TextFilePatch patch,
final VirtualFile file,
Getter<CharSequence> baseContents) {
@Nullable Getter<CharSequence> baseContents) {
myWarnings = new ArrayList<>();
final FileDocumentManager fileDocumentManager = FileDocumentManager.getInstance();
Document document = fileDocumentManager.getDocument(file);