void (@NotNull PsiAssertStatement statement) { startElement(statement); myStartStatementStack.pushStatement(statement, false); myEndStatementStack.pushStatement(statement, false); Instruction passByWhenAssertionsDisabled = new ConditionalGoToInstruction(0, BranchingInstruction.Role.END, null); myCurrentFlow.addInstruction(passByWhenAssertionsDisabled); addElementOffsetLater(statement, false); final PsiExpression condition = statement.getAssertCondition(); boolean generateCondition = true; boolean throwReachable = true; if (myOptions.shouldEvaluateConstantIfCondition()) { Object conditionValue = myConstantEvaluationHelper.computeConstantExpression(condition); if (conditionValue instanceof Boolean) { throwReachable = !((Boolean)conditionValue); generateCondition = false; emitEmptyInstruction(); } } if (generateCondition) { if (condition != null) { myStartStatementStack.pushStatement(statement, false); myEndStatementStack.pushStatement(statement, false); myEndJumpRoles.push(BranchingInstruction.Role.END); myStartJumpRoles.push(BranchingInstruction.Role.END); condition.accept(this); myStartJumpRoles.pop(); myEndJumpRoles.pop(); myStartStatementStack.popStatement(); myEndStatementStack.popStatement(); } Instruction ifTrue = new ConditionalGoToInstruction(0, BranchingInstruction.Role.END, statement.getAssertCondition()); myCurrentFlow.addInstruction(ifTrue); addElementOffsetLater(statement, false); } else { if (!throwReachable) { myCurrentFlow.addInstruction(new GoToInstruction(0, BranchingInstruction.Role.END)); addElementOffsetLater(statement, false); } } PsiExpression description = statement.getAssertDescription(); if (description != null) { description.accept(this); } // if description is evaluated, the 'assert' statement cannot complete normally // though non-necessarily AssertionError will be thrown (description may throw something, or AssertionError ctor, etc.) PsiClassType exceptionClass = JavaPsiFacade.getElementFactory(statement.getProject()).createTypeByFQClassName( CommonClassNames.JAVA_LANG_THROWABLE, statement.getResolveScope()); addThrowInstructions(findThrowToBlocks(exceptionClass)); myStartStatementStack.popStatement(); myEndStatementStack.popStatement(); finishElement(statement); }