Commit Graph

7223 Commits

Author SHA1 Message Date
Roman Ivanov
f7563d24a1 ensure that main method has proper signature IDEA-333318
GitOrigin-RevId: f324e646e922af24a2382073770ca195af52dc70
2023-10-04 22:33:30 +00:00
Roman Ivanov
7770d195fc check that main method has name "main"
GitOrigin-RevId: 3c49ec2ed2bbbc0cfce37cb3e399ab83cab93f7e
2023-10-04 22:33:29 +00:00
Roman Ivanov
eba6e0d551 [java, inspection] make global unused symbol inspection not report main methods for unnamed classes IDEA-333152
GitOrigin-RevId: 597ef591bebf0ee6968e08a05dd989aadc8bdd53
2023-10-04 22:33:23 +00:00
Tagir Valeev
f7ce6d8f5a [java-inspections] IDEA-333847 'Add constructor parameter' suggests to add one more initialisation event if it's already exists
GitOrigin-RevId: 70a6d88a89f9ead29a46f61dae3a2de6302fba17
2023-10-04 10:48:19 +00:00
Tagir Valeev
0d63633751 [java-inspections] CodeBlockSurrounder and StatementExtractor: support templates
GitOrigin-RevId: 3a998d7117ef6e94a7727a3f37d110905cc0c1bf
2023-09-29 17:40:46 +00:00
Bas Leijdekkers
e336feedca Java: PsiFragment now extends PsiJavaToken
GitOrigin-RevId: 68857d1d90efd7546413bb45d932e3a5c864b0fc
2023-09-28 13:52:53 +00:00
Tagir Valeev
d7160411f2 [java-dfa] IDEA-333294 Support Unit 5.8 assertInstanceOf in dataflow
GitOrigin-RevId: 5a772af8968128e8a95465d2ab5a42cb09006d3a
2023-09-28 10:30:00 +00:00
Mikhail Pyltsin
0f76470f19 [java-inspections] IDEA-333452 Duplicate branch on switch. Improve work with comments
- now it can be suppressed properly
- show info level if the branches have different comments

GitOrigin-RevId: 5f1c5c0a67165b949b894d2d81c53800ad3b4b22
2023-09-27 19:37:38 +00:00
Tagir Valeev
d79850455f [java-dfa] IDEA-332978 Nullability warning is not displayed in instanceof with pattern operand
GitOrigin-RevId: e0ea0bb2fae6eb9119310c8f7be56a05298733f8
2023-09-27 16:12:24 +00:00
Georgii Ustinov
751962686d [Java. Tests. JUnit] IDEA-318937 False positive 'Java | Test frameworks | Misordered 'assertEquals()' arguments'.
GitOrigin-RevId: e50be17593b3dffec389a314b3c9e4849ccedd6e
2023-09-27 15:45:55 +00:00
Mikhail Pyltsin
64f85584d7 [java-inspections] IDEA-333228 "Mismatched query and update of 'StringBuilder'" false positive for j21 repeat
- added support for `repeat`

GitOrigin-RevId: 8ef3d63147f13a5688f1ff15b725f4096f1f3c82
2023-09-27 14:14:25 +00:00
Tagir Valeev
eb85741b25 [java-inspections] CreateConstructorParameterFromFieldFix: rewrite to ModCommand, using trackDeclaration()
Also fixes IDEA-329769 'Add constructor parameter' hint and action discrepancy

GitOrigin-RevId: f897347600bfdfd2ebf7a4de0209e5887323f091
2023-09-27 11:27:13 +00:00
Aleksey Dobrynin
3fee19a680 [java, inspections, fix] IDEA-322244 IJ-CR-114846
- remove unnecessary "findClass"
- change JavaMethod to PsiMethod
- extract code about "usInstanceOf" exists into a separate method

GitOrigin-RevId: 47bd538a141bd715d32b3d534c5f7d761133db34
2023-09-27 10:09:59 +00:00
Bas Leijdekkers
080e330081 Java: don't report qualifiers that can't correctly be removed (IJ-CR-115426)
GitOrigin-RevId: 1808481bb3026980189dc467d24efe3a716e0177
2023-09-26 17:04:16 +00:00
Alexey Kudravtsev
5cff4c69cf make visitor thread-safe to fix occasional CME
GitOrigin-RevId: 907bbf8b211ac146527dc329c23816f9b8ae2828
2023-09-26 17:03:42 +00:00
Aleksey Dobrynin
bd9d8a17de [java, inspections, fix] IDEA-322244 IJ-CR-114846
fix searching scope of the JUnit library

GitOrigin-RevId: 2be822937602bc7d866dc0f733321dd3e5b371b6
2023-09-25 16:53:00 +00:00
SirYwell
53ec26e0de Java: fix considering all methods as public in interfaces (IDEA-332954)
for "'public' method with 'boolean' parameter" inspection
close #2574

GitOrigin-RevId: 9dcccb3279e924058a1d0cba5413b8dea31c3aad
2023-09-22 18:20:33 +00:00
Georgii Ustinov
883f800574 [Code Analysis. Inspection] IDEA-234302 System.getProperty(str) inspection implementation. Review Refactor
GitOrigin-RevId: e793b2306586a3ea6e12691b5d887fe1cf0b2913
2023-09-22 13:59:38 +00:00
Georgii Ustinov
0382910261 [Code Analysis. Inspection] IDEA-234302 System.getProperty(str) inspection implementation.
Call to System.getProperty(str) could be simplified for certain predefined constants. Implementation includes inspection and quickfix.

GitOrigin-RevId: 8b7edf6c4a6849062535ded1c49e733b8fed05a8
2023-09-21 19:51:28 +00:00
Alexey Kudravtsev
d6ec424292 cleanup, notnull
GitOrigin-RevId: 3425c365fef32c002ebdbda4e48751c0c771eed9
2023-09-21 11:44:06 +00:00
Mikhail Pyltsin
5c632ee060 [uast-inspections] Non-safe string: configuration for method with context awareness
GitOrigin-RevId: 108a4e8f5beaa951dbe1be64c578d39b7a82163b
2023-09-20 18:30:13 +00:00
Bas Leijdekkers
ded0f61cb2 Java: correctly detect if import is needed for records (IDEA-332634)
GitOrigin-RevId: 483a3c532f1150ed3384c7235cccef485d4f5806
2023-09-20 18:00:33 +00:00
Bas Leijdekkers
295ce7b01b Java: add fix to remove extra semicolon between import statements
GitOrigin-RevId: 3d390b9bbca1432e1a320201870e2c61edd07b23
2023-09-19 17:05:44 +00:00
Tagir Valeev
bcf3ea8f3f [java-dfa] Unrollable counting loops: keep start limit if unroll fails due to a nested loop (IDEA-330121)
Also: avoid warning for RHO of shift-assignment

GitOrigin-RevId: 1caac88e1ab9b07c747b9d4c20d1531cc79db566
2023-09-19 16:30:43 +00:00
Mikhail Pyltsin
2f8933be42 [java-inspections] IDEA-332629 Support Optional.stream() in DFA
- push temporary var before qualifier expression

GitOrigin-RevId: 932826b55918dd5f16e30084ecb71d45f5ae3a0b
2023-09-19 11:22:58 +00:00
Mikhail Pyltsin
dced7d86d0 [java-inspections] IDEA-332629 Support Optional.stream() in DFA
- added inlining for Optional.stream, based n SpecialField.OPTIONAL_VALUE

GitOrigin-RevId: 50287ae63b11083c133f9af54373310bf1b818f8
2023-09-18 23:01:32 +00:00
Alexey Kudravtsev
724d6ba079 avoid too wide fix range for "safe delete class" fix
GitOrigin-RevId: 85efa87afb9859390b7c79ad71628c9285947b5d
2023-09-18 19:38:57 +00:00
Yuriy Artamonov
c53774e2fc [inspections] IDEA-321711 Use optimized PsiElementVisitor implementations
GitOrigin-RevId: 18ebc32aec877f71cd185ee7072dd139c076e9a3
2023-09-16 15:18:22 +00:00
Tagir Valeev
4699c4fdb8 [java-analysis] solvePartially: avoid key calculation until equation to replace is found
GitOrigin-RevId: ac2c074d6e9d5366b5bf6d126725b1abab7c03dc
2023-09-15 14:16:51 +00:00
Tagir Valeev
b400fb648a [java-analysis] solvePartially: avoid partiallySolvedPurity Map
GitOrigin-RevId: d56c63ba1dfc77e3505615419526933a4e103482
2023-09-15 14:16:49 +00:00
Tagir Valeev
15ec06aa47 [java-analysis] solvePartially: avoid find()
GitOrigin-RevId: 0ece5d0d81e2ed73dc88f5aa303b3eab97d9f942
2023-09-15 14:16:46 +00:00
Tagir Valeev
a22426298d [java-analysis] ClassDataIndexerStatistics: get rid of deprecated Consumer
GitOrigin-RevId: 864e22a7c24cd17654638001c008f3127b29fe56
2023-09-15 14:16:43 +00:00
Tagir Valeev
18713234ca [java-analysis] ClassDataIndexerStatistics: use UnsyncByteArrayOutputStream to improve test performance
GitOrigin-RevId: c96271227410d4f1c94e25ec634c9f93fd430147
2023-09-15 14:16:41 +00:00
Tagir Valeev
6ab628e252 [java-analysis] ClassDataIndexer#isFileExcluded: avoid computing the path twice
GitOrigin-RevId: d3f495a4ca9b7e4840d1dd9d74e74ab127840301
2023-09-15 14:16:38 +00:00
Mikhail Pyltsin
0aa4d2f4f2 [java-highlighting] IDEA-332057 Not show cannot override instance error in case static methods is inherited
GitOrigin-RevId: c16f27e9799cba34bf15ec27c40430161bb7c9b3
2023-09-15 11:10:03 +00:00
Tagir Valeev
954deb915a [java-analysis] Less use of Stream API
GitOrigin-RevId: 3983671b37a5a018ac2de40208ef7af3111a0117
2023-09-15 10:19:20 +00:00
Tagir Valeev
f8bc9541ab [java-analysis] Less use of HashSet
GitOrigin-RevId: ba28f12b567132fb4d86734517b1d7e9fb1fe676
2023-09-15 10:19:18 +00:00
Tagir Valeev
6827e917a4 [java-analysis] solvePartially: remove streams, reduce collection copying
GitOrigin-RevId: e728e8f4810acebddc53ba1592bdcb9a919c274f
2023-09-15 10:19:16 +00:00
Tagir Valeev
921b1ba3a9 [java-analysis] Avoid InThrowAnalysis on big methods
GitOrigin-RevId: f52805e39e726dc29ef4f23d4f5de1ce3379f0d1
2023-09-15 10:19:15 +00:00
Tagir Valeev
4c076a5e4b [java-analysis] DFSTree: use LongOpenHashSet instead of HashSet to improve performance
Test shows: time for DFSTree.build goes down from 5892ms to 3292ms.

GitOrigin-RevId: 392f4154f315b609c16e2b93c201f006e7829199
2023-09-15 10:19:13 +00:00
Alexey Kudravtsev
b4485021de highlighting visitors: consolidate creation of HighlightInfo in one place to be able to tweak its group for IDEA-321013 Outdated HighlightInfo's should be removed as soon as the relevant annotator or inspection finishes
GitOrigin-RevId: 1ddf67a9db6e46707811ce604e4d39e6d6e5d6d3
2023-09-14 16:54:18 +00:00
Aleksey Dobrynin
ef437cfdab [java, inspections, fix] IDEA-323920 IJ-CR-114719
- added check to prevent red code highlighting
- fixed memory leak
- renamed fix a message to be more descriptive
- changed LocalQuickFix to PsiUpdateModCommandQuickFix for consistency

GitOrigin-RevId: 2e96e40fa9e9ddd8596bcf34332d95af785a2ce0
2023-09-13 11:49:01 +00:00
Aleksey Dobrynin
992f81a880 [java, refactorings] reduce number of options in "Type may be weakened" inspection (doNotWeakenToJavaLangObject) IDEA-266696
GitOrigin-RevId: 6b10989645bad435b9fb5bdfc30b5e814a19165d
2023-09-13 11:32:04 +00:00
Mikhail Pyltsin
d2af2f9736 [java-rd] IDEA-322563 Improve editing experience in Remote Dev for Java
- editor actions

GitOrigin-RevId: e774f42e72be12b613a9c300dd988589048bd483
2023-09-13 09:09:01 +00:00
Mikhail Pyltsin
e23e60a0eb [java-rd] IDEA-322563 Improve editing experience in Remote Dev for Java
- lexer, parser, IElementType for frontend

GitOrigin-RevId: 8842d018eab3ca17749660520820174d4f792437
2023-09-13 09:09:01 +00:00
Aleksey Dobrynin
2742ed5bf0 [java, inspections] add JUnit 5.8 'assertInstanceOf' inspection support IDEA-322244
GitOrigin-RevId: be6737b537475a879b8504b11eb143712a4bceae
2023-09-12 16:09:37 +00:00
Alexey Kudravtsev
ac59312c7a Suggest "remove this import" fix instead of "run optimize imports" to fix confusion in IDEA-331117 Optimize import quick fix which called on import line with unresolved package does nothing
GitOrigin-RevId: 7c543e8327e5e08c62029b503e63119732209586
2023-09-12 15:40:51 +00:00
Alexey Kudravtsev
6ad7e46a8a cleanup
GitOrigin-RevId: 2293b8ed24be6e12625f09f67594f22feebad7ed
2023-09-12 15:40:47 +00:00
Bas Leijdekkers
ff8a6d7449 Java: don't warn about incompatible instance on assertions/preconditions (IJ-CR-114769)
GitOrigin-RevId: 7553e8a982920b9e1798c3551df2179462b90a9e
2023-09-12 15:26:35 +00:00
Bas Leijdekkers
22428ccfed Java: clarify inspection messages (IJ-CR-114769)
GitOrigin-RevId: cfb54330013d7d891d97737625612c1bf89c0ab5
2023-09-12 15:26:32 +00:00