IDEA-163825 Smart step variants from another line

This commit is contained in:
Egor.Ushakov
2016-11-10 19:38:01 +03:00
parent e2f2614648
commit 8c4e0bb450
@@ -215,14 +215,14 @@ public class JavaSmartStepIntoHandler extends JvmSmartStepIntoHandler {
private void visitConditional(@Nullable PsiElement condition,
@Nullable PsiElement thenBranch,
@Nullable PsiElement elseBranch) {
if (condition != null) {
if (condition != null && checkTextRange(condition, true)) {
condition.accept(this);
}
ThreeState conditionRes = evaluateCondition(condition);
if (conditionRes != ThreeState.NO && thenBranch != null) {
if (conditionRes != ThreeState.NO && thenBranch != null && checkTextRange(thenBranch, true)) {
thenBranch.accept(this);
}
if (conditionRes != ThreeState.YES && elseBranch != null) {
if (conditionRes != ThreeState.YES && elseBranch != null && checkTextRange(elseBranch, true)) {
elseBranch.accept(this);
}
}
@@ -246,7 +246,7 @@ public class JavaSmartStepIntoHandler extends JvmSmartStepIntoHandler {
super.visitExpression(expression);
}
boolean checkTextRange(PsiElement expression, boolean expand) {
boolean checkTextRange(@NotNull PsiElement expression, boolean expand) {
TextRange range = expression.getTextRange();
if (lineRange.intersects(range)) {
if (expand) {