mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
style: use empty array constant
This commit is contained in:
@@ -24,6 +24,7 @@ import com.intellij.openapi.vcs.VcsException;
|
||||
import com.intellij.openapi.vcs.merge.MergeData;
|
||||
import com.intellij.openapi.vcs.merge.MergeProvider;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.vcsUtil.VcsRunnable;
|
||||
import com.intellij.vcsUtil.VcsUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -127,10 +128,10 @@ public class HgMergeProvider implements MergeProvider {
|
||||
if (baseRevisionNumber != null) {
|
||||
final HgContentRevision base = HgContentRevision.create(myProject, hgFile, baseRevisionNumber);
|
||||
//if file doesn't exist in ancestor revision the base revision should be empty
|
||||
mergeData.ORIGINAL = base.getContent() != null ? base.getContentAsBytes() : new byte[0];
|
||||
mergeData.ORIGINAL = base.getContent() != null ? base.getContentAsBytes() : ArrayUtil.EMPTY_BYTE_ARRAY;
|
||||
}
|
||||
else { // no base revision means that the file was added simultaneously with different content in both repositories
|
||||
mergeData.ORIGINAL = new byte[0];
|
||||
mergeData.ORIGINAL = ArrayUtil.EMPTY_BYTE_ARRAY;
|
||||
}
|
||||
final HgContentRevision server = HgContentRevision.create(myProject, hgFile, serverRevisionNumber);
|
||||
mergeData.LAST = server.getContentAsBytes();
|
||||
|
||||
@@ -36,6 +36,7 @@ import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.ui.GuiUtils;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.vcsUtil.VcsUtil;
|
||||
@@ -515,7 +516,7 @@ public abstract class HgUtil {
|
||||
@NotNull
|
||||
public static byte[] loadContent(@NotNull Project project, @Nullable HgRevisionNumber revisionNumber, @NotNull HgFile fileToCat) {
|
||||
HgCommandResult result = new HgCatCommand(project).execute(fileToCat, revisionNumber, fileToCat.toFilePath().getCharset());
|
||||
return result != null && result.getExitValue() == 0 ? result.getBytesOutput() : new byte[0];
|
||||
return result != null && result.getExitValue() == 0 ? result.getBytesOutput() : ArrayUtil.EMPTY_BYTE_ARRAY;
|
||||
}
|
||||
|
||||
public static String removePasswordIfNeeded(@NotNull String path) {
|
||||
|
||||
Reference in New Issue
Block a user