Commit Graph

5859 Commits

Author SHA1 Message Date
Alexey Kudravtsev
a2233e727f move test for fix in IJ-CR-4970 away from SuppressLIIJspTest because it has nothing to do with jsp
GitOrigin-RevId: 84111526ca761cc9b4cb468371e4455ef5b0fead
2021-01-07 13:57:00 +00:00
Anna Kozlova
8a5f77461f java completion: skip non-available sealed keyword for 16 language level
GitOrigin-RevId: b67cb8d87ece7a1c05b799bafebc7fd1b05d489c
2021-01-04 10:09:03 +00:00
Anna Kozlova
888b1151d6 java: report error if repeatable annotation has Documented/Inherited annotation and its container doesn't (IDEA-256253)
GitOrigin-RevId: d6dab9a587b2e4d7663a5b0c44ecf65bba9113bd
2020-12-30 19:38:19 +00:00
Anna Kozlova
42bb6297bc java create field from usage: don't go polyadic too deep for reference expressions (IDEA-235781)
GitOrigin-RevId: e3b48d82a489fd91917ffb0027f383aa236c425f
2020-12-30 13:08:33 +00:00
Anna Kozlova
3984afc37f javadoc completion: support inline @return tag starting from java 16 (IDEA-258058)
GitOrigin-RevId: 57feaf3e157cd19e9d706f5ee37642febd51c09d
2020-12-30 13:08:31 +00:00
Tagir Valeev
b6c02d3fd2 [java-highlighting] StaticInInnerJava16: remove redundant comments
GitOrigin-RevId: 5ac0bb4da8e0d8e62b2143180b719f20a76bc17d
2020-12-30 06:23:52 +00:00
Nikita Eshkeev
0f5a1abe0f [inspection] IDEA-257415 Warnings for value-based classes (Java 16)
This renames ValueBasedWarningsInspection to SynchronizeOnValueBasedClassInspection and alters the logic, it checks first the original type of the monitor and if it's not a value-based class then it employs DFA to infer the type more precisely and checks the inferred type if it differs from the type of the monitor. This solution is more robust, because DFA might fail sometimes.

This patch also adds the suppressId to SynchronizeOnValueBasedClassInspection in order to support the new javac warning category.

Signed-off-by: Nikita Eshkeev <nikita.eshkeev@jetbrains.com>

GitOrigin-RevId: f7c3520b84bf6f9080280dc2689ff4f63ac4be09
2020-12-29 22:41:46 +00:00
Anna Kozlova
101ad553b7 java invert if: ignore redundant return stmts (IDEA-258495)
GitOrigin-RevId: 4a1fc182d5e8e053dd60288b85764a511e72c08a
2020-12-29 14:14:16 +00:00
Anna Kozlova
454edfca70 java: move javac bug workaround to the suppressable inspection (IDEA-258347)
GitOrigin-RevId: 131d9adc783927a143393a59f98efe2afb414c68
2020-12-28 16:36:13 +00:00
Tagir Valeev
ef19f7f050 [java-completion] Test for keyword completion inside inner class
GitOrigin-RevId: 8167db8be74c5860996149021722bcde1fa6bcd8
2020-12-25 12:06:31 +00:00
Tagir Valeev
5d20b5dbb9 [java-highlighting] Allow statics inside inner since Java 16 (IDEA-257410)
Also remove redundant record tests

GitOrigin-RevId: ce57189891b3df3ba4659e8e3a2ded125234911a
2020-12-25 11:59:29 +00:00
Nikita Eshkeev
7760811391 [inspection] IDEA-257415 Warnings for value-based classes (Java 16)
This patch adds the inspection to detect usages of value-based classes' instances as monitors in the synchronize statement.

Signed-off-by: Nikita Eshkeev <nikita.eshkeev@jetbrains.com>

GitOrigin-RevId: 178533c1415b2a8f11d48db17c19baa7e6ff4d1a
2020-12-24 02:00:16 +00:00
Artemiy Sartakov
7de400f55b Sealed classes: report permits classes that miss final/sealed/non-sealed modifier at permits list (IDEA-255805)
GitOrigin-RevId: 7d1c2c6d8f40302177b369838238858e44427c51
2020-12-22 10:40:52 +00:00
Andrey.Cherkasov
d01484e002 IDEA-220039: Disable the "Unwrap 'else' branch" intention action if the 'else' is not redundant
GitOrigin-RevId: 9ff561b38bce316cbcbd1e24c738b77cf6495460
2020-12-21 10:51:36 +00:00
Anna Kozlova
1c6857ec2d java create class from new: don't create non-static inner if new expression can't be used afterwards (IDEA-97433)
GitOrigin-RevId: 89616c077ca5141db53b624ae08bc54b04d53cae
2020-12-18 19:01:32 +00:00
Anna Kozlova
f535bd830e java create class from usage: setup super ref for created nested class (IDEA-257288)
GitOrigin-RevId: c5a37a119f50aa3468c74ce621108e00e1168852
2020-12-18 19:01:29 +00:00
Anna Kozlova
c2bb183152 java jigsaw: ensure accessibility checked against type available at call site(IDEA-257587)
GitOrigin-RevId: 8f422afcf376370b331c17602feb927451ce0f69
2020-12-17 15:41:19 +00:00
Anna Kozlova
e9fb32668e overload resolution: don't reject first inapplicable vararg method
GitOrigin-RevId: 3e8246e5cbdab35327da0587aa62111b04f7dbed
2020-12-16 15:32:31 +00:00
Tagir Valeev
dbac726dc7 [platform-analysis] TemplateImpl.resetFrom: copy variable including expression fields
Sometimes the variable expression string is not initialized, only variable expression itself. See, for example, StringBasedPostfixTemplate.expandForChooseExpression. As a result, when template is copied (e.g. in JavaTemplateSubstitutor.substituteTemplate) the expressions become lost.
Fixes IDEA-257833 Arrays.stream expansion in lambda

GitOrigin-RevId: 083b90c5f8ddcc0b5874633f891ab0a77048b9bc
2020-12-16 06:02:16 +00:00
Anna Kozlova
7d0ce7b928 overload resolution: N parameters of varargs target should be less than N parameters of corresponding interface (IDEA-257526)
GitOrigin-RevId: 811135c478f3f98fa1923f4b58c27d6ca0144939
2020-12-15 20:45:46 +00:00
Anna Kozlova
fd17a8bb75 language level 16, remove language level 14_preview (IDEA-257409)
GitOrigin-RevId: 1f9626ba04ffd9588b0cf9b8a9f699faa613359b
2020-12-14 20:59:58 +00:00
Roman Ivanov
bbcb50af87 JavaParser: parse yield() as call
GitOrigin-RevId: 31b4b0f9687bbaa6d1df65e459dcbe05e5c2c6b4
2020-12-14 17:25:01 +00:00
Andrey.Cherkasov
99e697f12b IDEA-253512: Fix SlowAbstractSetRemoveAllInspection
GitOrigin-RevId: 4629a9d2c9b72a7e4b9974bf7c4d93dea98fe7fe
2020-12-07 20:34:07 +00:00
Anna Kozlova
6a0c39b3ee java: missed type cast suggestion on annotated types (IDEA-256942)
GitOrigin-RevId: 86dd16b919e602d375267b868c84384eb4e097cd
2020-12-04 21:20:39 +00:00
Tagir Valeev
58a638bab9 [java-tests] Record rename tests moved to RenameFieldTest
GitOrigin-RevId: d6b5c15752a7e821829caf55db968bc67ebffa8d
2020-12-04 08:06:39 +00:00
Tagir Valeev
7c62cd67fe [java-highlighting] IDEA-256804 Highlighting bug when using JDK 15 Records
GitOrigin-RevId: fd7fe3f1bcfe89e65f754038b4021ac003abb9f7
2020-12-04 08:06:37 +00:00
Tagir Valeev
2a18b3e8f9 [java] IDEA-255890 'Complete Current Statement' for vararg method like String.format works incorrectly
GitOrigin-RevId: 814641fd0562890897eec6e0a7f29c187f36c54c
2020-12-04 08:06:35 +00:00
Andrey.Cherkasov
95a12db895 IDEA-253512: Fixes after review
GitOrigin-RevId: 0c9d42259d6a5169c449b536aa4e7b982446b10a
2020-11-30 15:12:44 +00:00
Anna Kozlova
3a646d1f0c java create local from usage: do not duplicate comments inside variable initializer (IDEA-256107)
GitOrigin-RevId: 3f9298e0d38ca0840a57922a7b9eb23c27277668
2020-11-26 12:11:11 +00:00
Andrey.Cherkasov
d4dbc49dab IDEA-253512: Warn about possible O(N^2) in AbstractSet#removeAll calls
GitOrigin-RevId: 76f59d4f019482420142cdf760be3f9e4c7f4d1e
2020-11-25 15:18:45 +00:00
Andrey.Cherkasov
54ac372e2d Add tests for IDEA-173818
GitOrigin-RevId: 6646ccbf3c0ce543fba799d1a1f8ef5786ddc112
2020-11-24 18:20:43 +00:00
Tagir Valeev
d35974faf8 [java-inspections] IDEA-255926 Support streams generated by StreamSupport StreamToLoopInspection
Only for non-parallel streams

GitOrigin-RevId: 08b517f557f0c376cc504ac654a9353a66ae9014
2020-11-24 04:36:33 +00:00
Bas Leijdekkers
4b18db9bfb Add quick fix to remove duplicate annotation without parameters (IDEA-249508)
GitOrigin-RevId: fea7daeb0bb40724325182d6041a20aa141fbbf2
2020-11-23 21:56:24 +00:00
Anna Kozlova
73742cfcaa java records: rename component through implicit reference to the generated getter (IDEA-249683)
GitOrigin-RevId: 61907b128fb812c2b7df3769f2a80cc81ef43e54
2020-11-23 16:35:13 +00:00
Anna Kozlova
b93c815fbf java records: component used in outer class: search/rename fixes (IDEA-248803)
GitOrigin-RevId: 658be1b62e613484e82b1e7f24f1157813021179
2020-11-23 16:35:10 +00:00
Andrey.Cherkasov
1a75f19cff Don't warn about missing tag description on void methods
GitOrigin-RevId: 7125c41e5adfb4a45f96b6f5c9b6db12a9a0da6d
2020-11-23 13:25:11 +00:00
Tagir Valeev
a64960d971 [java-completion] IDEA-63639 Completion after new offers in list classes with private constructors
GitOrigin-RevId: 141336a239f027b0eb5cc9f2f783f1415eeb5f76
2020-11-19 05:49:13 +00:00
Anna Kozlova
cbff44d84f java diamonds: avoid recursion prevention (IDEA-255486)
GitOrigin-RevId: bb6e3e45899ede6c36278bfd3c74813b1fc64b38
2020-11-16 14:52:30 +00:00
Daniil Ovchinnikov
932ea20745 IDEA-252714 [java] use anchor if request is coming from tree child of target class
GitOrigin-RevId: 8248fb4f61867773b41c5274b52f2e73b3867972
2020-11-12 14:55:22 +00:00
Anna Kozlova
c9c3a31e74 redundant suppression: search for text with suppressId in narrow element if applicable (IDEA-221643)
GitOrigin-RevId: 1b13bcda0f78e882ddd51a0d6eccb4a662a441c4
2020-11-09 17:12:46 +00:00
Bas Leijdekkers
0954a97685 IPP: make intention texts more distinguishable from each other
GitOrigin-RevId: 47d0fe080875ef6f68bac5fa3b2e836c2f5430c0
2020-11-06 13:43:59 +00:00
Anna Kozlova
f8a53347cf java: split declaration & assignment: fix for very broken code (IDEA-254385)
forcePsiPostprocessAndRestoreElement may invalidate variable initializer

GitOrigin-RevId: 31b99804e5603cff36494ecbf9f98c1716b13d22
2020-11-02 20:18:09 +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
9970306c8f java method reference inference: keep additional inference variables when second search is not possible (IDEA-252839)
GitOrigin-RevId: 358b0408221aaf6e51dbf87867ae8f33ba0d0fde
2020-10-28 13:47:13 +00:00
Anna Kozlova
af05d31c48 java lvti: check for multiple declarations first to avoid registering error on a foreign element (IDEA-252806)
GitOrigin-RevId: a4640e8049680512a54909f6d82180f1421428ee
2020-10-28 13:47:10 +00:00
Anna Kozlova
48a0c3c03c java create class from usage: disable for expected array type or expected super class while enum/record can't have any
GitOrigin-RevId: 042aed924d9fc35e1ca86ae8660a7a75fe45bd25
2020-10-27 13:27:22 +00:00
Anna Kozlova
dc51016e34 java: create class from usage: fix for patterns expression (IDEA-253733)
GitOrigin-RevId: e135c45026fc852ace913a57689380c5175f766e
2020-10-26 14:53:29 +00:00
Andrey.Cherkasov
3af0d4d509 IDEA-251250 fix texts for JavaDocLocalInspection
GitOrigin-RevId: 8897fd1a878deea3a724b8632fadd2e3b9095f06
2020-10-23 14:57:53 +00:00
Anna Kozlova
61231a0223 inspections: don't check redundant suppressions from inspections with global part (IDEA-208688)
local checks may be more pessimistic and it could lead to false positives

GitOrigin-RevId: 131000dee73567951cba939949e7abc267019eaf
2020-10-23 06:54:02 +00:00
Andrey.Cherkasov
ce5ed84489 IDEA-251250 fixes after code review
GitOrigin-RevId: 383931c2a4caf3b4856ebbe9869f83c180f81879
2020-10-22 22:50:10 +00:00