@Nullable

This commit is contained in:
Dmitry Avdeev
2014-12-05 19:14:37 +03:00
parent 8d05813abc
commit 423b5bb3f6
@@ -15,6 +15,7 @@
*/
package com.intellij.psi;
import com.intellij.psi.util.ConstantEvaluationOverflowException;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.Nullable;
@@ -24,7 +25,7 @@ import java.util.concurrent.ConcurrentMap;
* Service for evaluating values of constant expressions.
*
* @author ven
* @see com.intellij.psi.JavaPsiFacade#getConstantEvaluationHelper()
* @see JavaPsiFacade#getConstantEvaluationHelper()
*/
public abstract class PsiConstantEvaluationHelper {
/**
@@ -35,22 +36,22 @@ public abstract class PsiConstantEvaluationHelper {
*/
@Nullable
@Contract("null -> null")
public Object computeConstantExpression(PsiElement expression) {
public Object computeConstantExpression(@Nullable PsiElement expression) {
return computeConstantExpression(expression, false);
}
/**
* Evaluates the value of the specified expression and optionally throws
* {@link com.intellij.psi.util.ConstantEvaluationOverflowException} if an overflow is detected
* {@link ConstantEvaluationOverflowException} if an overflow is detected
* during the evaluation.
*
* @param expression the expression to evaluate.
* @param throwExceptionOnOverflow if true, an exception is thrown if an overflow is detected during the evaluation.
* @return the result of the evaluation, or null if the expression is not a constant expression.
*/
public abstract Object computeConstantExpression(PsiElement expression, boolean throwExceptionOnOverflow);
public abstract Object computeConstantExpression(@Nullable PsiElement expression, boolean throwExceptionOnOverflow);
public abstract Object computeExpression(PsiExpression expression, boolean throwExceptionOnOverflow,
public abstract Object computeExpression(@Nullable PsiExpression expression, boolean throwExceptionOnOverflow,
@Nullable final AuxEvaluator auxEvaluator);
public interface AuxEvaluator {