Commit Graph

38 Commits

Author SHA1 Message Date
Mikhail Pyltsin
b43535b550 [java-highlighting] IDEA-324439 Check duplication in switch with taking into account enum class
GitOrigin-RevId: 5d01e0d205c8db48f46fb6301664324f67373c65
2023-07-05 20:46:06 +00:00
Mikhail Pyltsin
0254c50753 [java-highlighting] IDEA-324327 Constant associated with switch block must be used with primitives or String
GitOrigin-RevId: 864329b3d6cbefdf9c72358064b1e14f2fc4a1e3
2023-07-05 12:09:28 +00:00
Mikhail Pyltsin
014b89199b [java-highlighting] IDEA-324307 Allow to use qualified name for enum in switch. Check duplicates
GitOrigin-RevId: 7bfce5172e1e6f398f01063449eaaeeb2d77f1c9
2023-07-05 12:09:26 +00:00
Mikhail Pyltsin
0537252af9 [java-highlighting] IDEA-324307 Allow to use qualified name for enum in switch
GitOrigin-RevId: e07468e0ce50883fadfc3d57a6666fa5a90d348d
2023-07-05 12:09:25 +00:00
Andrey Cherkasov
5e839de419 [java-highlighting] IDEA-313993 unreachable statement: false negative
GitOrigin-RevId: 396da7635b4bee1c921444c2b23f89f8c67e5895
2023-02-24 13:26:51 +00:00
Andrey Cherkasov
3f34cfe3ea [java-highlighting] 'switch' expression does not cover all possible input values: false positive on reference types
IDEA-309593

GitOrigin-RevId: f869a8a1a98fd7789f5d07290797205205733899
2023-01-18 12:12:10 +00:00
Bas Leijdekkers
b9a6e40f0c Java: render array initializer expressions, switch expressions and instanceof expression correctly
GitOrigin-RevId: aad22125d6c8cbea4c398282a0eabb429c65e735
2022-11-16 19:42:12 +00:00
Anna Kozlova
2fd039b5eb [java] redundant cast: don't suggest to remove cast in switch branches without expected type (IDEA-296622)
GitOrigin-RevId: 24bebef33ad6d01861a68df1470f2ed2f454c4c8
2022-06-24 20:48:12 +00:00
Tagir Valeev
59d575280b [java-analysis] One more test for IDEA-292666
GitOrigin-RevId: 7e414c417d92f34e4a207fe5d0b97dbbde144275
2022-05-02 16:23:21 +00:00
Tagir Valeev
325edf9af2 [java-highlighting] IDEA-202570 Unreachable statement inspection should highlight whole switch expression
Also, fixed unreachable statement highlighting in different cases

GitOrigin-RevId: 20b28272b51c77e3413e1ca143222d35199728bd
2021-12-08 02:48:47 +00:00
Anna Kozlova
49edf8a29d [java] [switch expressions] avoid dbl work when checking types of switch return expressions
IJ-CR-14340

GitOrigin-RevId: 40e79767d794f7b7fcc9bc4d3930051a1698ea86
2021-09-28 21:10:49 +00:00
Tagir Valeev
c2f73e212e [java-highlighting] Remove accidental comment
GitOrigin-RevId: 1e7870b6e1792f308d9aa42087489e14b8066d3d
2021-09-22 08:47:13 +00:00
Tagir Valeev
a89c1afdf4 [java-highlighting] Report non-initialized variables inside switch expressions
GitOrigin-RevId: b643ba3bb2594267a9377ecd7526c4c996ae1781
2021-09-21 12:33:12 +00:00
Anna Kozlova
0b768770f7 [java] raise error for void type expressions in switch (IDEA-278454)
GitOrigin-RevId: e44afc9d82e2e8211171fa5eb1b5dff90acab375
2021-09-20 10:35:15 +00:00
Anna Kozlova
c4d12028ea [java highlighting] check switch expressions assignability (IDEA-271947)
GitOrigin-RevId: 88f8323cf191138ca94420271be65539a94cfc7c
2021-06-22 09:39:13 +00:00
Roman Ivanov
b12c4d4231 [java] fix test data
GitOrigin-RevId: 61472708704a021e22e06a5c46a9f37509d045ea
2021-06-15 17:46:11 +00:00
Anna Kozlova
1705f01347 [java] lambda context: allow conditional with lambda branches in switch cases (IDEA-269928)
extract cast processing to the upper level as it's not allowed in conditions (^Tagir)

GitOrigin-RevId: 3e608c133d2b44d67f9b57721fbf62c04c2c4147
2021-05-26 19:26:22 +00:00
Anna Kozlova
890efeaded [java]: redundant cast: treat switch expression branches separately (IDEA-269929)
GitOrigin-RevId: 4eecfab7aff32bc69164b740d1bd36f9a29b6cda
2021-05-25 06:42:14 +00:00
Anna Kozlova
5ab478e48e [java] lambda context: allow conditional with lambda branches in switch cases (IDEA-269928)
GitOrigin-RevId: 5bdcade69a621a83cc88074dd566e401852d0fd0
2021-05-25 06:42:11 +00:00
Roman Ivanov
69b3bdfef9 JavaParser: remove outdated special casing for yield, prefer stmt
GitOrigin-RevId: fb804d972a8a2280146bfad740d92c93fd20861a
2021-04-29 05:45:30 +00:00
Artemiy Sartakov
79f7d4dd58 Revert "Sealed classes: restricted keyword/identifier -> contextual keyword (IDEA-257414)"
This reverts commit a3b7cb3c

GitOrigin-RevId: bc91ae528d6f836e9cf43c19e9923286c8de0a9c
2021-02-04 09:33:52 +00:00
Artemiy Sartakov
45d71a0820 Sealed classes: restricted keyword/identifier -> contextual keyword (IDEA-257414)
GitOrigin-RevId: a3b7cb3c6eb3a65f78cf473fb93ddfa9946dea38
2021-01-19 09:22:09 +00:00
Roman Ivanov
bbcb50af87 JavaParser: parse yield() as call
GitOrigin-RevId: 31b4b0f9687bbaa6d1df65e459dcbe05e5c2c6b4
2020-12-14 17:25:01 +00:00
Anna Kozlova
ff667732f6 java: make error message more clear (IDEA-254372)
GitOrigin-RevId: 5c5bf42e6b375c2611ce996ca13a8404477e1eae
2020-11-02 17:28:44 +00:00
Anna Kozlova
ee301e1ee9 java switch expressions: reverted previous commit on inferring type with null result expressions (IDEA-251801)
appeared to be a javac bug, filed https://mail.openjdk.java.net/pipermail/compiler-dev/2020-September/015075.html

GitOrigin-RevId: 74bb18f3b3d82cdfbbad77a883d826b52549b9ab
2020-10-02 07:56:51 +00:00
Anna Kozlova
8aafb282f3 java switch expressions: infer Object if one of branches has null type (IDEA-241470)
GitOrigin-RevId: 489d3413091cbd1a85348fae0a428e29b287f7e0
2020-05-25 22:47:41 +03:00
Anna Kozlova
1bc4cda08e java redundant cast: cleanup: visitor finally inverted
GitOrigin-RevId: 8b4449e6d9163c24b046aad9065e5ec055d6d62c
2020-05-11 08:33:17 +00:00
Tagir Valeev
c7cfd81bc2 Positive test added (IDEA-CR-62158)
GitOrigin-RevId: bafc04a87dd7b52f54938dc6dcb3a76cc32ee732
2020-05-05 05:11:19 +00:00
Tagir Valeev
b3ba7b6783 IDEA-239116 Switch expression without any results is not highlighted as erroneous
GitOrigin-RevId: 66580d3aa4a95e1fdb32b1a3131544560c9c432a
2020-04-29 10:51:14 +00:00
Tagir Valeev
34243206dc Report new restricted identifiers: 'yield' and 'record'.
Fixes IDEA-230808 Disallow usage of 'record' as type name
Fixes IDEA-226604 Disallow using the 'yield' as the class name since Java 14

GitOrigin-RevId: a97753893fd8d0dac98a1a76f499b8c9474c3a7f
2020-01-17 11:12:57 +00:00
Anna Kozlova
f45758ac79 redundant cast: support switch labels syntax (IDEA-226175)
GitOrigin-RevId: afdf87f8692f610ee87b9892c61f9ab97986bab8
2019-11-08 09:06:35 +00:00
Anna.Kozlova
87deef960c incompatible types: highlight parent call instead of lambda when the error isn't related to lambda (IDEA-218801)
GitOrigin-RevId: 17a2f1f62f7703930aa25a8cfd6dfd4a918e1fe7
2019-10-10 07:01:11 +00:00
Anna Kozlova
afa0706bfc java highlighting: provide better incompatible types message on failed inference
GitOrigin-RevId: 5f97ec808f753d9ca40c417704ec93a802512745
2019-07-08 12:04:21 +03:00
Roman Shevchenko
83258b1714 [java] fixes and unifies 'break'/'continue' highlighting
GitOrigin-RevId: 4472c012bbc690ce96bdc43baa4075c4c14c1c62
2019-07-03 01:13:10 +03:00
Roman Shevchenko
90ef6314da [java] drops value break support
GitOrigin-RevId: dd17b9f4cc4dde37c0e3f8db6eae17251fe9681f
2019-07-03 01:13:10 +03:00
Anna Kozlova
8475ba3e51 switch expressions 2.0: update CFG & inference
GitOrigin-RevId: 8f83e7c2c57819e34c4cb8fa5d44a863b0b58532
2019-07-02 06:52:16 +03:00
Roman Shevchenko
06d3d41999 [java] 'yield' statement: basic highlighting (IDEA-216410)
GitOrigin-RevId: 4edae910f16a27c2a46068c2d8b6fce4674e0571
2019-07-02 06:52:16 +03:00
Anna Kozlova
89fa4186d6 java: dedicated switch expressions test
make tests on preview features disconnected from language level to make them evolve easily

GitOrigin-RevId: f87bbf684355bce7ae97711a0fc9b5861d58f775
2019-07-02 06:52:16 +03:00