Commit Graph

11829 Commits

Author SHA1 Message Date
Tagir Valeev
a41ef84fea [java] Unnamed variables
IDEA-323910 Implement parser for "JEP 443: Unnamed Patterns and Variables (Preview)"
IDEA-323960 Support error highlighting for unnamed variables (JEP 443)

GitOrigin-RevId: 1b9ee424063dfd4d32c2215fc8b0a9838dbdcd95
2023-07-31 13:41:28 +00:00
Tagir Valeev
7933354967 [java-highlighting] UnnamedPatterns exhaustiveness tests fixed (IDEA-326473)
GitOrigin-RevId: 046110c4a35093a859b02b17b0c6277d5d48e02b
2023-07-31 10:52:41 +00:00
Tagir Valeev
29b6822774 [java-inspections] IDEA-325283 "Deprecated API usage" inspection should honor "since" value in annotation
GitOrigin-RevId: 81745fc9ea86715e914f7d7202d556690c45c443
2023-07-28 14:18:31 +00:00
Tagir Valeev
da373298a5 [java] Minor fix in unnamed pattern
GitOrigin-RevId: a5dca3625c665c0ad745c4788c8ee0a2b9bf1788
2023-07-28 14:18:22 +00:00
Tagir Valeev
76aa489d1d [java-dfa] Support failure handling in constant evaluator
Part of IDEA-326613 Support constant evaluation of Integer.parseInt and friends
Required for IDEA-324389 Inspection: Integer.parseInt() with a numeric String literal could be simplified
Also: added more Math methods

GitOrigin-RevId: 199a4bc5eaea9e8c2f26b6d4dfa5292ca8dd7795
2023-07-28 14:18:15 +00:00
Anna Kozlova
ee5d687203 [uast] [unused declaration] false positive on implicit invoke call on properties (IDEA-295430)
GitOrigin-RevId: 3075f11d592ddbe6e076410ae4982a1f30c67eac
2023-07-28 12:59:08 +00:00
Tagir Valeev
7a7e094d2d [java-dfa] IDEA-326613 Support constant evaluation of Integer.parseInt and friends
GitOrigin-RevId: 178e0b4309a84b07a1f01c5fc782a49f03feeb79
2023-07-28 09:45:33 +00:00
Tagir Valeev
dbf25ab12b [java-inspections] IDEA-326604 Constant expression can be evaluated using dataflow analysis
GitOrigin-RevId: 5e663ac98c323faf36afcaf18115b6e4036d980d
2023-07-28 09:45:29 +00:00
Tagir Valeev
159dbaaaa8 [java-dfa] IDEA-326612 Perform double/float math on constants in data flow analysis
GitOrigin-RevId: 81580363852afff9f54c1a04c51d7116d71dfd1b
2023-07-28 09:45:26 +00:00
Tagir Valeev
ab550ac4c0 [java] IDEA-326473 Implement unnamed patterns
GitOrigin-RevId: 1b5db700434306be23d07e38905537025e2cc892
2023-07-27 10:03:54 +00:00
Tagir Valeev
013651b75d [java-refactoring] Minor fixes in AnonymousToInnerHandler
1. Adapt messages to speak about local class when applicable
2. Fix when name is not changed, but we have type parameters

GitOrigin-RevId: bd3dbda21922473c9c4e52bccf840a35c55c9d59
2023-07-26 12:45:58 +00:00
Tagir Valeev
fb1eeff810 [java-inspections] IDEA-326289 Raw type when converting generic constructor method ref to lambda
GitOrigin-RevId: cd8f8d36f5ded99b168e8db0a00a06a82df4044f
2023-07-26 11:38:28 +00:00
Tagir Valeev
8cbd00ec99 [java-dfa] Experimental support of JMH param annotation
Questionable, as it could be overridden in command line, but may save from some bugs

GitOrigin-RevId: 849ebddeb458a3fbe12e5c4352bf4ba570be796b
2023-07-26 10:00:17 +00:00
Tagir Valeev
5f3ce51f8a [java-inspections] NullableStuffInspectionBase: do not report "non-annotated overrides annotated" in the presense of container annotation
Fixes IDEA-323362 IntelliJ gives "Not annotated method overrides method annotated with @Nonnull" despite @NonNullApi

GitOrigin-RevId: 1b4298ffc3a1fc9ce4f4e5b9412e3af5a3b116d9
2023-07-26 10:00:14 +00:00
Alexey Kudravtsev
8396a4fd29 rename to avoid confusion with CHM
GitOrigin-RevId: bca10a36d09aedcab524dcc498fe6fa66a286f92
2023-07-25 17:17:16 +00:00
Bas Leijdekkers
3534648803 Java: types, exceptions and more error highlighting for string templates (IDEA-321503)
GitOrigin-RevId: c6571bf0011dea625063da40b435ac7d8000c3aa
2023-07-24 20:08:35 +00:00
Bas Leijdekkers
eacb27523f Java: PsiTemplate is not an expression (IDEA-321503)
GitOrigin-RevId: b04dc2a6ed051dfd20c26dc4479356cb7702513b
2023-07-24 20:08:30 +00:00
Tagir Valeev
c718b21cc1 [java-refactoring] Convert local classes to inner ones
Fixes IDEA-218207 Move refactoring doesn't work for local classes
Also: Convert anonymous to inner -> do not create fields used in other field initializers only
Also: Convert anonymous to inner -> capture implicitly referred type parameters (mentioned in types of captured variables)

GitOrigin-RevId: 5d326e0b6fdff4de850ce48582cc3ca0fe003b43
2023-07-24 19:35:31 +00:00
Mikhail Pyltsin
dcd9e3d954 [java-completion] IJ-CR-111599 IDEA-324653 Completion for objects with enums. Add test that it doesn't work for old Java
GitOrigin-RevId: 32b02cb0092b53093cf63dbea95df0c2e2e74724
2023-07-21 15:54:19 +00:00
Tagir Valeev
1a157d9e68 [java-intention] New ModCommands
ChangeExtendsToImplementsFix, ClassMayBeInterfaceInspection, MethodRefCanBeReplacedWithLambdaInspection

GitOrigin-RevId: 1ef6864503e633a37c1f1dda1f5604cc9ae978de
2023-07-21 11:17:38 +00:00
Tagir Valeev
2c12f7c579 [java-intentions] ExtendSealedClassFix: ModCommand
IntentionActionWithChoice UI replaced with multi-step ModCommand, as we don't have IntentionActionWithChoice in ModCommand API, and it's unclear whether it's a good idea, and how to implement it better

GitOrigin-RevId: a702bc672b56f4c51dd7e7b01cf5ee0ded457805
2023-07-21 11:17:34 +00:00
Tagir Valeev
9ab2a2cd01 [mod-commands] Testing: declarative testing of multi-step actions
GitOrigin-RevId: d8c195494ae7973a44c1daf707fc38e6f76a7191
2023-07-21 11:17:31 +00:00
Mikhail Pyltsin
3e995dc765 [java-inspections] --IDEA-320618 Invert if generates incorrect code inside loops with label (java)
GitOrigin-RevId: 8670f5b5414dba816a6254f4b0fc03acf79194d6
2023-07-21 08:38:38 +00:00
Mikhail Pyltsin
f4ebb69281 [java-inspections] IDEA-322460 Convert to enhanced switch: put comment into braces
GitOrigin-RevId: fe4e2187916c721211c6ed9d7c1f1456fcf2d817
2023-07-21 08:38:34 +00:00
Mikhail Pyltsin
b65d25e4eb [java-highlighting] IDEA-308514 Incorrect Java error highlighting when accessing private method of var local variable
GitOrigin-RevId: 29c869bc79161b6adf24f0090ee591cb9abc1c6b
2023-07-20 16:42:57 +00:00
Mikhail Pyltsin
70937fa53d [java-inspections] IDEA-305545 Inspection is not reported if a statement is split into declaration and assignment
GitOrigin-RevId: 3cb1707e14e833a455f1881bd26949891cc1b359
2023-07-20 16:42:47 +00:00
Mikhail Pyltsin
b5a82c4c70 [java-highlighting] IDEA-325916 Get rid of deconstruction patterns with pattern variables.
Clean tests

GitOrigin-RevId: ca1094fd7060754a17d1a18c68c66fed4bc0bbb4
2023-07-20 16:42:43 +00:00
Mikhail Pyltsin
f61c8612f9 [java-highlighting] IDEA-325916 Get rid of deconstruction patterns with pattern variables.
Clean tests

GitOrigin-RevId: cb3ca829cabc9ab6e96f3ccb77d213896606c93e
2023-07-20 16:42:40 +00:00
Mikhail Pyltsin
dbb4b11cbe [java-completion] IDEA-324653 Completion for objects with enums. Fix tests
GitOrigin-RevId: ff1ca41e8ef385d6abae9c64eaf9177e549a73e6
2023-07-20 16:42:37 +00:00
Mikhail Pyltsin
0473bd13cb [java-inspections] --IDEA-313900 "Variable can be replaced with pattern variable" sometimes doesn't appear
GitOrigin-RevId: a762f0de65b481f51490f86b31147fe84f50d8dc
2023-07-20 16:42:33 +00:00
Mikhail Pyltsin
0f30f2df13 [java-highlighting] IDEA-325916 Get rid of deconstruction patterns with pattern variables
GitOrigin-RevId: 10db5aec839b046de87ac01db919cbe6905728d1
2023-07-20 16:42:30 +00:00
Mikhail Pyltsin
4453543010 [java-completion] IDEA-324653 Completion for objects with enums
GitOrigin-RevId: e0d5b5dba3535ec70a2aa4eebf3094b45474ef11
2023-07-20 16:42:24 +00:00
Bas Leijdekkers
6abbbdd360 Java: error highlighting for string templates (IDEA-321503)
GitOrigin-RevId: d17a540698ecf5330326a7757475756ea2f85f86
2023-07-19 16:08:43 +00:00
Bas Leijdekkers
0431049876 Java: report \s in char literals (IDEA-325541)
GitOrigin-RevId: c933d7e21c35b263f62ee3cab43b3fca9a0696ff
2023-07-19 16:08:33 +00:00
Bas Leijdekkers
4923f8195b Java: introduce separate PsiFragment instead of reusing PsiLiteral (IJ-CR-110406)
GitOrigin-RevId: d1afe86a28022d13776f98fa2a4f89a051497f80
2023-07-19 16:08:20 +00:00
Bas Leijdekkers
69cae6f056 Java: add negative test case (IJ-CR-110898)
GitOrigin-RevId: 92159e1a64c8b3533d76c5134b4e0216a26b6aee
2023-07-19 16:08:18 +00:00
Tagir Valeev
07d22ea643 [java-inspections] Do not fuse PriorityQueue and PriorityBlockingQueue into the stream operation
It's more efficient to construct these containers from the collection directly
Fixes IDEA-324751 Inefficient code suggested by the "Stream may be extended replacing PriorityQueue" inspection

GitOrigin-RevId: 4a1ee4882e4c0d5b303f14f5d3a643df5ecd9933
2023-07-19 08:54:40 +00:00
Tagir Valeev
7ba5b8972a [java-inspections] AddMethodQualifierFix: preserve existing arguments
GitOrigin-RevId: 4631d490d89ef9f3c65789d0eb8e0a9840a88ec7
2023-07-19 08:54:39 +00:00
Mikhail Pyltsin
c44bd90939 [java-highlighting] IJ-CR-110955 IDEA-324714 Add quick-fix to produce missed deconstruction patterns.
Added more tests, change to reduce in loop

GitOrigin-RevId: 609da394429c3cc3fad72147d9856fd0b7afcee2
2023-07-18 18:34:57 +00:00
Mikhail Pyltsin
da7fe16e4e [java-highlighting] IJ-CR-110955 IDEA-324714 Add quick-fix to produce missed deconstruction patterns.
Added more tests, added shortenClassReferences

GitOrigin-RevId: e74d9b61a09fb314a8d9dbdceee8c30c0c5a3def
2023-07-18 13:16:41 +00:00
Tagir Valeev
64f21d1640 [java-inspections] IDEA-177904 Enhance warning of usage deprecated API with 'since' value
GitOrigin-RevId: c5ba116123378e5b65fa5e2f4c51d74752561e93
2023-07-17 19:38:33 +00:00
Tagir Valeev
5d5dfb997a [java-intentions] AddMethodQualifierFix: ModCommand
GitOrigin-RevId: efe77eed876481149c7b58356ffd6dcada649a16
2023-07-17 19:20:35 +00:00
Tagir Valeev
e4ace19a73 [mod-command] Global rename support; rename in ReplaceConstructorWithFactoryAction
GitOrigin-RevId: bbedae34c33cef997b6a984078de79ec6121e51d
2023-07-17 19:20:26 +00:00
Mikhail Pyltsin
7a5936e749 [java-inspections] IDEA-301709 Replace with enhanced switch doesn't work if default branch is outside
GitOrigin-RevId: f445a9bd4e2abcf4c0e1e923d27823e8965e21f6
2023-07-17 17:06:00 +00:00
Mikhail Pyltsin
3f18cddb20 [java-highlighting] IDEA-325375 Exhaustive switch expressions can produce definitely assigned variables. Fix type ranks
GitOrigin-RevId: 1a36f38c08e51d4cafb897a2b8ace796a74ec298
2023-07-17 17:05:57 +00:00
Mikhail Pyltsin
15c524d521 [java-inspections] IDEA-316332 Duplicate branch in switch false positive with type-inferred parameterized type result
GitOrigin-RevId: 4c8a77840142cbcd7a0a2d59124de3eb89cc4c44
2023-07-17 17:05:54 +00:00
Mikhail Pyltsin
82b6cf4e7d [java-highlighting] IDEA-325375 Exhaustive switch expressions can produce definitely assigned variables
GitOrigin-RevId: 013d2367e1fa08189272343af83c5af9c2ad0582
2023-07-17 11:27:45 +00:00
Mikhail Pyltsin
af78d087f5 [java-completion] IDEA-324653 IJ-CR-111070 No completion for qualified Enum in switch
GitOrigin-RevId: f633fb8552cf65e718954c98325c1445ca433461
2023-07-17 11:27:38 +00:00
Mikhail Pyltsin
830275db3c [java-highlighting] IDEA-324652 Unreachable branch quickfix produces incorrect code
GitOrigin-RevId: 3c00dae40f890c0a5bfda425f9c30d479f4d40b3
2023-07-17 11:27:28 +00:00
Tagir Valeev
ee20b97285 [java-intentions] Do not suggest to insert 'return' in the void method
GitOrigin-RevId: e73ca4a07b093b819858fb165d4b6207e9fcd360
2023-07-14 22:49:34 +00:00