mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
vcs: remove unnecessary throws
This commit is contained in:
+4
-5
@@ -21,7 +21,6 @@ import com.intellij.history.core.Content;
|
||||
import com.intellij.history.core.revisions.Revision;
|
||||
import com.intellij.history.core.tree.Entry;
|
||||
import com.intellij.history.integration.IdeaGateway;
|
||||
import com.intellij.util.diff.FilesTooBigForDiffException;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -44,7 +43,7 @@ public class SelectionCalculator {
|
||||
myToLine = toLine;
|
||||
}
|
||||
|
||||
public boolean canCalculateFor(Revision r, Progress p) throws FilesTooBigForDiffException {
|
||||
public boolean canCalculateFor(Revision r, Progress p) {
|
||||
try {
|
||||
doGetSelectionFor(r, p);
|
||||
}
|
||||
@@ -54,16 +53,16 @@ public class SelectionCalculator {
|
||||
return true;
|
||||
}
|
||||
|
||||
public Block getSelectionFor(Revision r, Progress p) throws FilesTooBigForDiffException {
|
||||
public Block getSelectionFor(Revision r, Progress p) {
|
||||
return doGetSelectionFor(r, p);
|
||||
}
|
||||
|
||||
private Block doGetSelectionFor(Revision r, Progress p) throws FilesTooBigForDiffException {
|
||||
private Block doGetSelectionFor(Revision r, Progress p) {
|
||||
int target = myRevisions.indexOf(r);
|
||||
return getSelectionFor(target, target + 1, p);
|
||||
}
|
||||
|
||||
private Block getSelectionFor(int revisionIndex, int totalRevisions, Progress p) throws FilesTooBigForDiffException {
|
||||
private Block getSelectionFor(int revisionIndex, int totalRevisions, Progress p) {
|
||||
Block cached = myCache.get(revisionIndex);
|
||||
if (cached != null) return cached;
|
||||
|
||||
|
||||
+3
-19
@@ -25,7 +25,6 @@ import com.intellij.history.integration.IdeaGateway;
|
||||
import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.util.diff.FilesTooBigForDiffException;
|
||||
|
||||
public class SelectionDifferenceModel extends FileDifferenceModel {
|
||||
private final SelectionCalculator myCalculator;
|
||||
@@ -62,22 +61,12 @@ public class SelectionDifferenceModel extends FileDifferenceModel {
|
||||
|
||||
@Override
|
||||
protected boolean isLeftContentAvailable(RevisionProcessingProgress p) {
|
||||
try {
|
||||
return myCalculator.canCalculateFor(myLeftRevision, p);
|
||||
}
|
||||
catch (FilesTooBigForDiffException e) {
|
||||
return false;
|
||||
}
|
||||
return myCalculator.canCalculateFor(myLeftRevision, p);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isRightContentAvailable(RevisionProcessingProgress p) {
|
||||
try {
|
||||
return myCalculator.canCalculateFor(myRightRevision, p);
|
||||
}
|
||||
catch (FilesTooBigForDiffException e) {
|
||||
return false;
|
||||
}
|
||||
return myCalculator.canCalculateFor(myRightRevision, p);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -105,11 +94,6 @@ public class SelectionDifferenceModel extends FileDifferenceModel {
|
||||
}
|
||||
|
||||
private String getContentOf(Revision r, RevisionProcessingProgress p) {
|
||||
try {
|
||||
return myCalculator.getSelectionFor(r, p).getBlockContent();
|
||||
}
|
||||
catch (FilesTooBigForDiffException e) {
|
||||
return "";
|
||||
}
|
||||
return myCalculator.getSelectionFor(r, p).getBlockContent();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user