Commit Graph

17 Commits

Author SHA1 Message Date
Tagir Valeev
acb3387b1c IDEA-223192 Non-initialized variable error is not displayed in nested switch statement
GitOrigin-RevId: 850afa74fb22dd858bdc8ff7903946678e53d82c
2019-09-24 08:02:50 +00:00
Tagir Valeev
62792959f0 More tests for this handling in javac 2018-06-08 13:27:58 +07:00
Tagir Valeev
51af524343 LocalsOrMyInstanceFieldsControlFlowPolicy: allow parentheses
See also IDEA-156926, JDK-8156180
2018-06-07 17:55:13 +07:00
Tagir Valeev
d90e0b79e5 LocalsOrMyInstanceFieldsControlFlowPolicy#isLocalOrMyInstanceReference extracted
Fixes parentheses handling like (this).x. Review ID: IDEA-CR-33345
2018-06-07 16:11:00 +07:00
Tagir Valeev
698afa3b24 LocalsOrMyInstanceFieldsControlFlowPolicy: disallow qualified this
According to JLS Chapter 16 qualified "this" is not considered as reference to field in definite assignment analysis
Fixes IDEA-193386 Good code is red: Variable may not have been initialized
2018-06-07 11:28:07 +07:00
Tagir Valeev
0418d57ade Error is reported when qualified this is used to initialize a final variable
Fixes IDEA-191686 Bad code is green (cannot assign a value to final variable)
2018-05-10 13:03:40 +07:00
Tagir Valeev
f48446e00b ControlFlowAnalyzer: do not exclude polyadic operands after always true/false operand
Fixes IDEA-190766 Final field reassignment problems in always true/always false polyadic chains
Review ID: IDEA-CR-29499
2018-04-23 17:54:41 +07:00
Tagir Valeev
f5975ad8a2 Variable finality highlighting fixes
Unreachable branches are analyzed for twice assignment, but constants are evaluated.
Fixes IDEA-186321 Bad code green: non-iterating for-loop update
Fixes IDEA-186304 good code red: field might not have been initialized in unreachable branch
Fixes (mostly) IDEA-186305 good code red: variable might already have been assigned to
2018-02-17 12:35:03 +07:00
Tagir Valeev
63231c630d IDEA-186381 bad code green: variable might already have been assigned
Fixed parentheses handling on the left-side of assignment and in unary operations
Fixed error message priority
2018-02-09 12:45:18 +07:00
Tagir Valeev
c8f3d1e20c ControlFlowUtil#isVariableAssignedInLoop: evaluate constant conditions
Fixes IDEA-186306 good code red: variable might be assigned in loop
2018-02-08 13:29:49 +07:00
Tagir Valeev
bf640e78a9 ControlFlowAnalyzer: fix control flow for assert (IDEA-186305) 2018-02-08 11:57:02 +07:00
Alexey Kudravtsev
db48c64473 use mockJdk18 by default in LightCodeInsightTestCase; remove dependency on swing/net classes in some tests 2016-07-20 15:47:18 +03:00
Bas Leijdekkers
e65ecdae08 EA-59392 (NPE: ControlFlowAnalyzer.visitPostfixExpression) 2014-08-14 22:38:57 +02:00
Bas Leijdekkers
8d7f95a137 IDEA-26350 (Bad Java code is green: variable might not have been initialized) 2013-09-11 16:18:45 +02:00
Bas Leijdekkers
ba3c923024 IDEA-93530 (bad code green: cannot assign a value to final variable) 2013-09-10 23:09:52 +02:00
anna
ae8ab9589e IDEA-103758 2013-04-05 17:02:57 +02:00
Alexey Kudravtsev
735a9d17a8 java highlighting tests moved to community 2010-06-25 12:46:38 +04:00