void (@NotNull PsiDeclarationStatement statement) { List<Evaluator> evaluators = new ArrayList<>(); PsiElement[] declaredElements = statement.getDeclaredElements(); for (PsiElement declaredElement : declaredElements) { if (declaredElement instanceof PsiLocalVariable) { if (myCurrentFragmentEvaluator != null) { final PsiLocalVariable localVariable = (PsiLocalVariable)declaredElement; final PsiType lType = localVariable.getType(); PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(localVariable.getProject()); try { PsiExpression initialValue = elementFactory.createExpressionFromText(PsiTypesUtil.getDefaultValueOfType(lType), null); Object value = JavaConstantExpressionEvaluator.computeConstantExpression(initialValue, true); myCurrentFragmentEvaluator.setInitialValue(localVariable.getName(), value); } catch (IncorrectOperationException e) { LOG.error(e); } PsiExpression initializer = localVariable.getInitializer(); if (initializer != null) { try { if (!TypeConversionUtil.areTypesAssignmentCompatible(lType, initializer)) { throw evaluateException( JavaDebuggerBundle.message("evaluation.error.incompatible.variable.initializer.type", localVariable.getName())); } final PsiType rType = initializer.getType(); initializer.accept(this); Evaluator rEvaluator = myResult; PsiExpression localVarReference = elementFactory.createExpressionFromText(localVariable.getName(), initializer); localVarReference.accept(this); Evaluator lEvaluator = myResult; rEvaluator = handleAssignmentBoxingAndPrimitiveTypeConversions(localVarReference.getType(), rType, rEvaluator, statement.getProject()); Evaluator assignment = new AssignmentEvaluator(lEvaluator, rEvaluator); evaluators.add(assignment); } catch (IncorrectOperationException e) { LOG.error(e); } } } else { throw new EvaluateRuntimeException(new EvaluateException( JavaDebuggerBundle.message("evaluation.error.local.variable.declarations.not.supported"), null)); } } else { throw new EvaluateRuntimeException(new EvaluateException( JavaDebuggerBundle.message("evaluation.error.unsupported.declaration", declaredElement.getText()), null)); } } if (!evaluators.isEmpty()) { CodeFragmentEvaluator codeFragmentEvaluator = new CodeFragmentEvaluator(myCurrentFragmentEvaluator); codeFragmentEvaluator.setStatements(evaluators.toArray(new Evaluator[0])); myResult = codeFragmentEvaluator; } else { myResult = null; } }