Commit Graph

7873 Commits

Author SHA1 Message Date
Tagir Valeev
0a7dce9cba [java-refactoring] Avoid local ref cache during inline refactoring
Useless anyway, as the files are constantly updated; does many unrelated computations
IDEA-364541 Inline method spends a lot of time inside getVariableReferences


(cherry picked from commit 1814ada8815641cb9159bbe10bc28c719d2bbf44)

IJ-CR-151330

GitOrigin-RevId: 406d056a261e17cf8d34d5b4edfa4a7a9e592d1a
2024-12-11 18:52:24 +00:00
Tagir Valeev
3eea2c8961 [java-analysis] Parameter nullability: prefer nullability known from type over nullability known from parameter declaration
Type nullability could be more precise if parameter is generic
Fixes IDEA-364343 False-positive NPE at unboxing inside lambda with JSpecify annotations


(cherry picked from commit 9a49f5687eccaa013e639cdf15950be911e100bc)

IJ-CR-151033

GitOrigin-RevId: be6c25b7e63a9d231077351fd0bf813515e7f9bf
2024-12-09 17:46:27 +00:00
Tagir Valeev
d2d87a71f3 [java-intentions] IDEA-363734 "Make Xxx impelent Yyy" quick fix inserts @NotNull
(cherry picked from commit 4e9a3f94cf1aedadd0b2c4699e168ccb3be0e405)

IJ-CR-150708

GitOrigin-RevId: ced9d4595e513387ebf996bf8dd0894877ef0f3e
2024-12-05 01:08:15 +00:00
Tagir Valeev
d2b1f518c8 [java-refactoring] IDEA-360614 Replace with single implementation: no downcast when 'this' is used
(cherry picked from commit f2ea406a5cf229cf9e63b6c2b53b9d86f245a6d9)

IJ-CR-150207

GitOrigin-RevId: 0eec797e7e9d105bf594aabd85533bd5c5395dd1
2024-11-26 19:12:59 +00:00
Tagir Valeev
300adf91fc [java-inspections] IDEA-363792 Incorrect inspection suggestion to replace 0.0/0.0 with 1.0
(cherry picked from commit 72ea479f6b2c3a331685175b11459556ae0a29bf)

IJ-CR-150124

GitOrigin-RevId: 842566d57921ebcbe355cab6c17a6a09f08d486a
2024-11-26 12:30:58 +00:00
Tagir Valeev
b6f684ed23 [java-dfa] IDEA-363270 Misleading warning for switch case when expression on Boolean values
(cherry picked from commit 449fdf6cb9137b7dcd038adca7b26ffc15f7d59a)

IJ-CR-150040

GitOrigin-RevId: 957b8f5555a16e1e4912bc19bfe9ff133715709b
2024-11-25 14:43:15 +00:00
Tagir Valeev
44ee539dbd [java-dfa] AssertJInliner: support WithAssertions (IDEA-361718)
(cherry picked from commit e785553c79409934f7097b5956db12705d5a623b)

IJ-CR-149830

GitOrigin-RevId: a1d882d0662761bde872ba3ab2b7c79a4c7746af
2024-11-21 14:48:10 +00:00
Tagir Valeev
93592a4c9e [java-refactoring] CodeBlockSurrounder: avoid collapsing with unrelated if-statement
Fixes IDEA-360579 Inline Method creates uncompilable code


(cherry picked from commit cd73e3e730b8cef37f4a26235a2ab3db812f02ff)

IJ-CR-147183

GitOrigin-RevId: 0258e753bfb5f7e66bc4a0526769fe8ba07aa02c
2024-10-21 12:11:50 +00:00
Tagir Valeev
c49291c780 [java-analysis] CodeBlockSurrounder: workaround google-java-format problem (IDEA-340109)
(cherry picked from commit ff8a2a9d628140942ccb11d84c4aa4c2ced2df47)

IJ-CR-147066

GitOrigin-RevId: 404efbcd84a9c45c34ed0039559de2c8d111a19e
2024-10-18 11:14:01 +00:00
Tagir Valeev
88e99a58b4 [java-dfa] Fix hardcoded contract for three-arg Arrays.binarySearch method (IDEA-359546)
(cherry picked from commit a4ff22126f7d6fc1b4a7d99ee47c3caf1b144c4c)

GitOrigin-RevId: 74f0bae69219b650eb170bc517e5c1bc0b1d9ad2
2024-10-17 13:15:40 +00:00
Mikhail Pyltsin
1512d52efd IJPF-CR-24873 IJ-CR-145218 [java-inspections] IDEA-201932 Provide inspection to highlight redundant creation operations in java date time api
GitOrigin-RevId: 5af6c994aca832256f73eaa301cc21f6bb738316
2024-10-11 20:45:20 +00:00
Bart van Helvert
51c1afc502 [jvm] Support @Extensions in JUnit malformed declaration inspection
#IDEA-360210 Fixed

GitOrigin-RevId: 90317c39c05c55757bcd2cae30e41d6b398c6926
2024-10-11 12:23:22 +00:00
Tagir Valeev
feb2ee9625 Warnings fixed (mostly redundant cast)
GitOrigin-RevId: 63bdb7f359a1a2cd37cb6a691b3d94db8ba3ce02
2024-10-11 08:10:27 +00:00
Tagir Valeev
676c19bc1f [java-inspections] Report TYPE_USE nullability annotation on classes
GitOrigin-RevId: f5c6113ccd1738d72b0f58fe13a8352a043431c9
2024-10-11 08:10:27 +00:00
Mikhail Pyltsin
7e9f1978a2 [java-highlighting] IDEA-357214 'Module' is highlighted as an error when module name is expected
GitOrigin-RevId: c7ca9de1821e79b96a05ab74a3cbad7052ceb827
2024-10-10 15:17:07 +00:00
Tagir Valeev
f5463b7662 [java-inspection] NullableStuffInspectionBase: better determine annotation name
GitOrigin-RevId: 1c00dc9d26ce2e8ebf78379fefbd6b3a9e764007
2024-10-08 20:08:05 +00:00
Georgii Ustinov
c02d32ef74 [Java] Make JavaSpellcheckingStrategy dumb aware
IDEA-357681

GitOrigin-RevId: 1fead4d1fdb98c99d8b68d48813f483deaa6b35c
2024-10-05 10:25:23 +00:00
Nikolay Chashnikov
0e4dd0cedc [java] API cleanup: remove unused deprecated API (IJPL-156972)
GitOrigin-RevId: c8cfa9d13c20cd712f9ab3ab1b8e5fcfd9a2ecaf
2024-10-04 17:44:13 +00:00
Tagir Valeev
b223a53bc3 [java-dfa] NotNullByDefault: implicit Object bound is affected by annotation; more tests (IDEA-359811)
GitOrigin-RevId: a3576ee5f2b100b7e68536881a55d0c9a2f9771b
2024-10-02 14:26:44 +00:00
Tagir Valeev
3ec30c1c1b [java-highlighting] IDEA-359187 LVTI: 'lambda expression requires an explicit target type' not highlighted as error when in parenthesis
GitOrigin-RevId: 248072c38aeaf7f05b088c04bc435ecd0e940dd8
2024-10-02 14:26:44 +00:00
Vladimir Krivosheev
bfb4e40f3c convert intellij.jvm.analysis.impl to V2 module
GitOrigin-RevId: aac0cb7c6c3d40f424d468a4eedd34507dc2f2ef
2024-10-01 09:52:32 +00:00
Bas Leijdekkers
4a233dcb96 Java: cleanup redundant cast util
GitOrigin-RevId: 848cba730948a86edc6e9caf8d55f3d82814f058
2024-10-01 09:31:57 +00:00
Bas Leijdekkers
af458693d5 Java: don't insert unnecessary casts on inlining method (IDEA-203962)
GitOrigin-RevId: c3f441b42d164438b1035112083a8114735a0a05
2024-10-01 09:31:57 +00:00
Tagir Valeev
4f112c52a7 [java-dfa] ClassDef: remove isInheritor(superName); replace with other methods
GitOrigin-RevId: 0033d430c30b804d8afbac3ea80938ed1130d17d
2024-10-01 08:57:46 +00:00
Tagir Valeev
394ba7023a [kotlin-dfa] KTIJ-30856 Constant conditions: track implicit 'this' in extension methods properly
GitOrigin-RevId: 6c93d799b48b736757c5c1386b36f845fe63289d
2024-10-01 08:57:46 +00:00
Mikhail Pyltsin
f474d8047b IJ-CR-145218 [java-inspections] IDEA-201932 Provide inspection to highlight redundant creation operations in java date time api
- combine into one inspection
- fix messages

GitOrigin-RevId: d4e064948f8c730c4d68c58e6c9b1277c6b66b4d
2024-09-27 17:12:29 +00:00
Mikhail Pyltsin
9eb0e15e2c IJ-CR-145121 [java-inspections] IDEA-357009 new option to configure custom classes for IncorrectMessageFormatInspection
- fix table for `IncorrectMessageFormatInspection`

GitOrigin-RevId: 272d89fafaac63517e990b1d2808ec54d4c58e69
2024-09-27 09:33:50 +00:00
Tagir Valeev
ca9649997b [java-inspections] Properly report 'not applicable on locals' warnings
IDEA-355699 Warning when annotating array elements as nullable with JSpecify

GitOrigin-RevId: ca9a3e0ea2ef3aa01d31afcaff2f92193af14dbe
2024-09-25 11:10:24 +00:00
Bas Leijdekkers
5b375ff7a2 Java: "'equals()' called on 'BigDecimal'" is no longer a cleanup tool (IDEA-354348)
sind replacing BigDecimal.equals() calls with BigDecimal.compareTo() calls slightly changes the semantics which can cause bugs

GitOrigin-RevId: 2a2d147b0953e1616e028ada8d7de369fe3da0b1
2024-09-24 20:21:56 +00:00
Aleksey Dobrynin
df7529c232 [java, highlighting, jigsaw] find module descriptor: support exclusions IDEA-354700
GitOrigin-RevId: ee96fec82905611a18aec82fd8554f7fb7d1dbb2
2024-09-24 14:48:18 +00:00
Aleksey Dobrynin
99c228c466 [java, highlighting, jigsaw] standardize an error message for conflicting packages
GitOrigin-RevId: 47d26dd0242ad7c5c533c232897d2c7486fb1dca
2024-09-24 10:23:55 +00:00
Bas Leijdekkers
c3189981f6 Java: accept more patterns (IJ-CR-144289)
GitOrigin-RevId: c0692f8c924b32988ec98aae86c1ad9b466cb45a
2024-09-24 10:04:30 +00:00
Mikhail Pyltsin
f73a4d96be [java-inspections] IDEA-201932 Provide inspection to highlight redundant creation operations in java date time api
GitOrigin-RevId: 6b246167dda52272122d356c3f6a787eab5a2542
2024-09-20 14:10:17 +00:00
Tagir Valeev
c3ecaaa190 [java-dfa] More annotations; annotations for comparators; warn on nullity violation from methodref return
GitOrigin-RevId: d0b1a4967d361f409d4d25562c595e2812fc8044
2024-09-19 19:06:26 +00:00
Mikhail Pyltsin
abb1899900 [java-inspections] IDEA-357009 new option to configure custom classes for IncorrectMessageFormatInspection
GitOrigin-RevId: ab026ee405f78ff29519afb0db62449a682b5bd3
2024-09-19 12:20:53 +00:00
Tagir Valeev
35c9c6ca5a [java-dfa] Basic support for Unmodifiable type annotation
GitOrigin-RevId: 4bc07e2533efa45356ba26b89c065b453a40d253
2024-09-18 20:27:35 +00:00
Tagir Valeev
ffd5d01482 [java-dfa] Type annotations for stream collectors; now, special processing of non-null collections is unnecessary
Part of IDEA-231901 Support TYPE_USE in external annotations

GitOrigin-RevId: 34e116eddf5dbc90468311e5fd2d0c30e600fc1a
2024-09-18 20:27:35 +00:00
Tagir Valeev
b50767f679 [java] Basic support for external type annotations
Only in XML directly; no editing UI for now; no inlays for now; only for libraries (Cls), currently no intent to extend to sources (Psi)
Part of IDEA-231901 Support TYPE_USE in external annotations

GitOrigin-RevId: 672ed09f57ffc40b61e8fe4dd33d0f9acdac92dc
2024-09-18 20:06:30 +00:00
Tagir Valeev
528b777e4a [java-dfa] ControlFlowAnalyzer: do not compare PsiType by ==
GitOrigin-RevId: c24b6038b522eddefc8defbbddb59015bd90ae2e
2024-09-18 12:08:09 +00:00
Tagir Valeev
0ddb0d84b3 [java-analysis] JavaSourceInference.isUnusedInAnonymousClass: avoid using heavy search
GitOrigin-RevId: 2fd2f4c0a0109db9cc91e5c49c5fa832b9ec90ed
2024-09-18 12:07:43 +00:00
Tagir Valeev
ac0c57748b [java-inspections] IDEA-346005 Add new inspection: Unnecessary keySet() call
GitOrigin-RevId: d1f1db0ae939017a8550b91cd8742dc222a8db99
2024-09-17 07:28:39 +00:00
Tagir Valeev
05de6a6bdb Less raw types
GitOrigin-RevId: 2a6e712b4017cf1ead7870543e562acb654fbeaf
2024-09-16 11:23:15 +00:00
Yuriy Artamonov
47f1c44a90 [java] IJPL-158521 Actions: fix ellipsis in messages for Java actions
GitOrigin-RevId: bfce0d6efa8747660c4b9af3d8defbfa47e4509a
2024-09-15 14:50:09 +00:00
Alexey Kudravtsev
401bcbb8ef optimization: do not allocate empty maps
GitOrigin-RevId: 77883bfa5f82626a8b116ee9ce72752e70a1f313
2024-09-13 22:48:02 +00:00
Bas Leijdekkers
5c06f74975 Java: don't report non-private field as assigned not accessed when it is implicitly read and written (IDEA-357404)
GitOrigin-RevId: 943ef6961c19510e5d4291367293424a87499487
2024-09-13 16:40:26 +00:00
Aleksey Dobrynin
f590114d83 [java, highlighting] Fix module conflict highlighting for exported packages IDEA-352819
GitOrigin-RevId: d4479fb863280674ae8960c930e6e8b1628b7321
2024-09-13 06:24:34 +00:00
Alexey Kudravtsev
a7c08af12a optimization: do not recalculate hashCode of 10K+-sized lists on each typing, do not store them in the map keys (part of KTIJ-27513 K2 IDE: Slow reference search for specific symbols in unused symbol inspection)
GitOrigin-RevId: 62930faef52b3b5039e7f20720de5970a22d943e
2024-09-12 14:15:42 +00:00
Tagir Valeev
41c0081fd8 [java-dfa] Work-around K2 problem KT-71407 K2: Do not report @JvmField default value as PsiField initializer in K2
GitOrigin-RevId: 1cdf4ac181c63cf9e0d348c7e4b48d449cc031c2
2024-09-11 20:52:54 +00:00
Michail Plushnikov
6ebc72d816 [lombok] IDEA-345991 Fix Error Highlighting: Lombok Builder.Default on Final Fields
GitOrigin-RevId: 839bffdf12b4c5046ed8ec0732bfce9f09801516
2024-09-10 23:11:10 +00:00
Bas Leijdekkers
9eb3b6bb58 Java: introduce another visitSwitchBlock() method
GitOrigin-RevId: 97f3edcab34837c124e1426d97a6d6590e67a053
2024-09-06 13:43:06 +00:00