Commit Graph

7370 Commits

Author SHA1 Message Date
Bas Leijdekkers
f8add5638f Java: avoid expensive inheritor search in during on-the-fly inspecting (reported in IDEA-329817 comments)
GitOrigin-RevId: 0f97e106671162bebca228a9b412f3f4ade49aa4
2023-09-12 00:41:44 +00:00
Aleksey Dobrynin
39aedbd24b [java, refactorings] reduce number of options in "Type may be weakened" inspection (useRighthandTypeAsWeakestTypeInAssignments) IDEA-266696
GitOrigin-RevId: 6b265f8d1def3689b079b37cca3fa7aa3c46ea56
2023-09-11 20:56:14 +00:00
Aleksey Dobrynin
f9736ee901 [java, refactorings] reduce number of options in "Type may be weakened" inspection (doNotWeakenReturnType) IDEA-266696
GitOrigin-RevId: 25006e09863ef69dc9d68e52b614a1b7b4ce1ceb
2023-09-11 20:56:11 +00:00
Aleksey Dobrynin
f2e781aae5 [java, refactorings] reduce number of options in "Type may be weakened" inspection (useParameterizedTypeForCollectionMethods) IDEA-266696
GitOrigin-RevId: f6b2c5a1d38f0f80326e08899c3482f1123a9804
2023-09-11 20:56:07 +00:00
Aleksey Dobrynin
7cfbb8bae0 [java, inspections] remove redundant 'STR' processor IDEA-323920
GitOrigin-RevId: e3020a69a359f8dee282bb5933a6c3766214e165
2023-09-11 13:38:21 +00:00
Bas Leijdekkers
3e34ffd98e Java: update inspection texts (IDEA-329817)
GitOrigin-RevId: 3b834eb1677496a5a67fb904c1c64cb2be2302cf
2023-09-11 11:10:10 +00:00
Bart van Helvert
cc61bc25c7 [jvm] Convert TestCaseWithNoTestMethods inspection to JVM
#IDEA-331938 Fixed

GitOrigin-RevId: 9ecdc3d6e03d52cb54865067483b4c97e29d3236
2023-09-10 16:39:57 +00:00
Alexey Kudravtsev
28669e48e1 optimization: visit only the relevant elements
GitOrigin-RevId: 1aa56500a0da1a3fce72a7efbb73057cf464c3f4
2023-09-07 19:14:23 +00:00
Tagir Valeev
0e37e37009 [java-dfa] Having no unreachable branches doesn't mean that the current branch is the only reachable.
GitOrigin-RevId: 6cd26f5f00467775378d6d52b33f3916dc1eba62
2023-09-07 09:00:43 +00:00
Roman Ivanov
31928210fc [java] add move all members to class fix
GitOrigin-RevId: f5ad44f993f2f386c9847dc57ddac86cb4cf45d2
2023-09-07 08:48:06 +00:00
Alexey Kudravtsev
56ebddcc41 cleanup, notnull
GitOrigin-RevId: a66c9d2c162e016544602e12891669b6b64a050b
2023-09-06 18:55:37 +00:00
Tagir Valeev
c3c0d7c172 [java-inspections] Report empty and trivial components of STR template (IDEA-323919)
GitOrigin-RevId: b7b184cc957846d3122d11e7266df44cb1c9102e
2023-09-06 18:13:55 +00:00
Tagir Valeev
00eb284508 [java-dfa] Support empty component in STR template (IDEA-327154)
GitOrigin-RevId: b7ef312b3b35b8aa7aa55ecb1f6bdc7a99c3aac6
2023-09-06 18:13:49 +00:00
Tagir Valeev
106ed5bd3e [java-analysis] ClassDataIndexer: cache bytecode analysis gist data for virtual files
It appears that ourGist.getFileData() reads the whole class data from the disk every time we ask equations for a method/field. If the class is huge, it's deserialized completely, then equations for a wanted method are returned, and the result is discarded. So, if we need to know contracts for N methods of a single class, we will deserialize the class data N times, which is really bad for huge classes.

Tried to read contracts for all methods of ThriftHiveMetastore$Client.class in a loop (from Apache Hive). Before this change it took ~50 seconds, after this change it takes only ~5 seconds.

Possible solution for IDEA-327595 Do not build `BytecodeAnalysisIndex` for huge class files

GitOrigin-RevId: 1639432890699fc67ce30696fcb8a7d3cca3537d
2023-09-06 18:13:39 +00:00
Tagir Valeev
775abb0f50 [java-analysis] ClassDataIndexer: use single visitor to read field information
GitOrigin-RevId: c0f407841bb5ce835e481249c7f6ae2505780e02
2023-09-06 18:13:36 +00:00
Bas Leijdekkers
e8506d4d00 Java: warn on cast to incompatible class (IDEA-329817)
GitOrigin-RevId: 0ff0e88f40673f196d78877fe7aeb99a2721b67e
2023-09-06 17:58:46 +00:00
Bas Leijdekkers
f0cf50c395 Java: don't warn on code that is not compilable (IDEA-329817)
GitOrigin-RevId: 844e18f6948be72c079b72a49c2deeb1ac656a9b
2023-09-06 17:58:43 +00:00
Bas Leijdekkers
87a857ddb5 Java: warn about 'instanceof' with incompatible class (IDEA-329817)
GitOrigin-RevId: 1dda5c6523509b79dec70fd036431541bce223d3
2023-09-05 20:47:13 +00:00
Mikhail Pyltsin
ef53b88b28 IJ-CR-113042 [java-inspections] IDEA-327488 skip switch expressions with throw statements if it returns constant value
- extracted useful method

GitOrigin-RevId: 9260dd539388d84b406f93ea5a23088a0252548d
2023-09-04 15:58:01 +00:00
Tagir Valeev
b2d2131b16 [java-dfa] Do not fail when template processor is absent (IDEA-327154)
GitOrigin-RevId: 52e2d52125e65a26b694d6184d37627b423be9aa
2023-09-04 15:47:17 +00:00
Bas Leijdekkers
049e116d27 Java: report void not allowed as embedded string template expression (IJ-CR-113878)
GitOrigin-RevId: 74934fab80465cf05acf28108c38d4c4c119fffa
2023-08-31 15:17:17 +00:00
Bas Leijdekkers
0aebe230e8 Java: add missing newline error on text block fragment (IJ-CR-113878)
GitOrigin-RevId: a62cddecc6b6974ffedbcfcd179fe675aa74112e
2023-08-31 15:17:13 +00:00
Mikhail Pyltsin
a9d5694c12 IJ-CR-111602 [java-inspections] --IDEA-313900 "Variable can be replaced with pattern variable" sometimes doesn't appear
- firstly, to run light check

GitOrigin-RevId: 2d48489f80b3f710d38bb165db76b1ac68f9798b
2023-08-31 14:31:27 +00:00
Alexey Kudravtsev
303a9b3bf9 notnull
GitOrigin-RevId: 14c079597f5e076f2ae7d333b4abd7fd12619289
2023-08-31 14:13:00 +00:00
Aleksander Movsesov
a6eb2f5500 QD-6555: make derived references reachable for not initializing entry methods IJ-CR-112227
GitOrigin-RevId: cca88dd3552e5ca7a217474d82c17f89c28a7cba
2023-08-31 10:16:08 +00:00
Mikhail Pyltsin
7f2a619077 [java-inspections] IDEA-328239 Casting with conjunction
- Check if SAM is implemented in conjunction

GitOrigin-RevId: e524fea9562a59238efb8a5b91e4db08973cc780
2023-08-30 11:31:49 +00:00
Bas Leijdekkers
afe912df66 Java: don't add new method to StringLiteralLexer (IJ-CR-110406)
GitOrigin-RevId: 92e5b34b746e48a5a9490863891c86f6f1b63b8d
2023-08-29 23:28:36 +00:00
Bas Leijdekkers
0fbb531c2f Java: remove a piece of dead code (IJ-CR-113878)
GitOrigin-RevId: 9caacd0f9c41555557683adb45f6e22cba5856cd
2023-08-29 23:28:27 +00:00
Bas Leijdekkers
e45e235900 Java: add feature check for when string template is trivial (IJ-CR-113878)
GitOrigin-RevId: a9b68f0345d7702cbdcb2121cdd38a4b2be01c57
2023-08-29 23:28:24 +00:00
Mikhail Pyltsin
bdf1d8226d [java-inspections] IDEA-328239 Casting with conjunction
- Check if SAM is implemented in conjunction
- check lambda Methods signature with generic from types

GitOrigin-RevId: 981b75d4417e08bb6e392a2ab78d6104de19b84f
2023-08-29 22:10:43 +00:00
Mikhail Pyltsin
320f621750 Revert "[java-inspections] IDEA-328239 Casting with conjunction"
This reverts commit 97e21dbacccd9382e48387295a911b127882e625.

GitOrigin-RevId: 572b3b40ac196132e233d044631ee27b565f0edc
2023-08-29 22:10:40 +00:00
Mikhail Pyltsin
06509345d6 Revert "[java-inspections] IDEA-328239 Casting with conjunction"
This reverts commit 9d1ef27588619a66656de0010470242c8ce49f7b.

GitOrigin-RevId: a661ee524d6710d71d7d8c9ec905cb4397718b65
2023-08-29 22:10:37 +00:00
Vladimir Krivosheev
43852fbed9 cleanup
GitOrigin-RevId: bc97967823e42df6f3ba4133ae6980d65d106ec0
2023-08-29 19:32:50 +00:00
Mikhail Pyltsin
fbacd0043b [java-inspections] IDEA-328239 Casting with conjunction
- Fixed for non-hierarchy

GitOrigin-RevId: 9d1ef27588619a66656de0010470242c8ce49f7b
2023-08-29 18:57:58 +00:00
Mikhail Pyltsin
3072396ff6 [java-inspections] IDEA-328239 Casting with conjunction
- Check if SAM is implemented in conjunction
- Created lambda Methods signature with generic from types

GitOrigin-RevId: 97e21dbacccd9382e48387295a911b127882e625
2023-08-29 18:57:55 +00:00
Alexey Kudravtsev
6fac98058f cleanup
GitOrigin-RevId: 3a8ececcbd67c980657a9be105c1df9ccaa04dbb
2023-08-28 18:53:03 +00:00
Roman Ivanov
bdc5475282 [java] adapt conversion from record to class for old class in presence of unnamed classes
GitOrigin-RevId: 17887007325fda8f9128274bf0d28ce70b5d8c0b
2023-08-27 21:24:26 +00:00
Roman Ivanov
bfe4be2085 [java] add quick fix provider for sealed classes
GitOrigin-RevId: 8fb5df2195f016b4b56d48c5607ae169736044ae
2023-08-27 21:24:23 +00:00
Roman Ivanov
71e10c185b [java] fix failing tests
GitOrigin-RevId: d69a9585d6e3bd93cdcb8f69e94d38c71b67e2f7
2023-08-27 21:24:18 +00:00
Roman Ivanov
3a64f036e9 [java] edit message bundle names
GitOrigin-RevId: 0251603f0b6cac9e186b7a1fcccdaf43efd4a531
2023-08-27 21:24:15 +00:00
Roman Ivanov
739e54a28e [java] delete "move member into class" as error elements are not created for such members
GitOrigin-RevId: c50d6e0c6de204c5f290047f1ff99bf11ef14a4d
2023-08-27 21:24:06 +00:00
Roman Ivanov
1695d981f6 fixes after rebase
GitOrigin-RevId: 23f15adc8fc823566177fc814685651b18055ea1
2023-08-27 21:23:49 +00:00
Roman Ivanov
dc95192361 [java] move all the unnamed class highlighting logic into separate class
GitOrigin-RevId: fa0a12ce22ad36156d554b9a9472b7c1c7f75d10
2023-08-27 21:23:44 +00:00
Roman Ivanov
461d751bc5 [java] highlight the static initializers in unnamed classes
GitOrigin-RevId: 4552b7d57db98a2f9ddea85a89497fb3fdeac275
2023-08-27 21:23:42 +00:00
Roman Ivanov
c40178aaec [java] add highlighting when package is present in unnamed class
GitOrigin-RevId: 64e5c38ba1c56741857d2f3331562bbe7f2f65cb
2023-08-27 21:23:40 +00:00
Roman Ivanov
5067549319 [java] add fix for adding main method to unnamed class IDEA-326263
GitOrigin-RevId: b37c5261785815c8768535d3bd7934d86652777e
2023-08-27 21:23:25 +00:00
Roman Ivanov
a91e0f24a3 [java] check the feature before suggesting to create main method
GitOrigin-RevId: 271bb15495f3b6d0443e435e73d43e64f6591c18
2023-08-27 21:23:23 +00:00
Roman Ivanov
edcd783759 IDEA-323905 [java, highlighting] highlight when the main method is absent in unnamed class
GitOrigin-RevId: 9de08632427e06dec912d2760f90e0fed76686b5
2023-08-27 21:23:19 +00:00
Roman Ivanov
4ef891cf5e add unnamed class feature and check for usage
GitOrigin-RevId: 51ab72778378fdf84d19cb801b10ef9fb1eb2929
2023-08-27 21:23:12 +00:00
Bas Leijdekkers
152f8b838c Java: don't skip marking superclasses when class is an entry point (IDEA-329870)
in "Declaration can have 'final' modifier" inspection

GitOrigin-RevId: 4f2504fc50e2190b8e71b0d1a6f91a3e0e96f9eb
2023-08-25 14:52:13 +00:00