diff --git a/java/java-impl/src/com/intellij/slicer/DfaBasedFilter.java b/java/java-impl/src/com/intellij/slicer/DfaBasedFilter.java index 1bd4a38a84d7..e8ecd1a78f14 100644 --- a/java/java-impl/src/com/intellij/slicer/DfaBasedFilter.java +++ b/java/java-impl/src/com/intellij/slicer/DfaBasedFilter.java @@ -56,7 +56,8 @@ final class DfaBasedFilter { DfConstantType dfConstantType = (DfConstantType)myDfType; Object constValue = dfConstantType.getValue(); if (!(constValue instanceof PsiElement)) { - Object value = TypeConversionUtil.computeCastTo(((PsiLiteralValue)element).getValue(), dfConstantType.getPsiType()); + Object literalValue = ((PsiLiteralValue)element).getValue(); + Object value = constValue == null ? literalValue : TypeConversionUtil.computeCastTo(literalValue, dfConstantType.getPsiType()); return Objects.equals(value, constValue); } }