diff --git a/java/java-psi-impl/src/com/intellij/psi/controlFlow/ControlFlowAnalyzer.java b/java/java-psi-impl/src/com/intellij/psi/controlFlow/ControlFlowAnalyzer.java index a7b7e290b42c..da32b64ea092 100644 --- a/java/java-psi-impl/src/com/intellij/psi/controlFlow/ControlFlowAnalyzer.java +++ b/java/java-psi-impl/src/com/intellij/psi/controlFlow/ControlFlowAnalyzer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -1505,12 +1505,14 @@ class ControlFlowAnalyzer extends JavaElementVisitor { IElementType op = expression.getOperationTokenType(); PsiExpression operand = PsiUtil.skipParenthesizedExprDown(expression.getOperand()); - operand.accept(this); - if (op == JavaTokenType.PLUSPLUS || op == JavaTokenType.MINUSMINUS) { - if (operand instanceof PsiReferenceExpression) { - PsiVariable variable = getUsedVariable((PsiReferenceExpression)operand); - if (variable != null) { - generateWriteInstruction(variable); + if (operand != null) { + operand.accept(this); + if (op == JavaTokenType.PLUSPLUS || op == JavaTokenType.MINUSMINUS) { + if (operand instanceof PsiReferenceExpression) { + PsiVariable variable = getUsedVariable((PsiReferenceExpression)operand); + if (variable != null) { + generateWriteInstruction(variable); + } } } } diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting/AssignToFinal.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting/AssignToFinal.java index 171b63a8f06f..de5212a4bf87 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting/AssignToFinal.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting/AssignToFinal.java @@ -90,5 +90,6 @@ class T1 { ++(i2); i3 += 1; (i4) = 1; + ()++; } } \ No newline at end of file