Commit Graph

810 Commits

Author SHA1 Message Date
Mikhail Pyltsin
c6ca035622 [java-inspections] IDEA-349198 IJ-CR-190983 Catch deconstruction on null value
- use dfa

GitOrigin-RevId: 19cdc3be30263c4b3dbbfff173c557c62c376d67
2026-02-11 14:51:17 +00:00
Leonid Shalupov
188b7ef96f IJI-3282 Optimize imports
GitOrigin-RevId: 3b5c00d8ff20b8d0bb6005bc450921085d2da9b2
2026-01-31 17:03:42 +00:00
Mikhail Pyltsin
438c4e4b5b [java-frontend] IDEA-366600 Get rid of additional "Java for JetBrains Client" plugin
- java dependencies

Space-RevId: 7d4700ee0761048bb85d3b0a9471b74511f62fc0

GitOrigin-RevId: 9f080945a3c7b361b89c6743ec07ef9163f3e017
2026-01-29 11:31:00 +00:00
Nikolay Chashnikov
f2425bec74 IDEA-268316 Java: provide API in JvmBytecodeAnalysis to collect implicit superclass references
Before, JvmBytecodeAnalysis processed only references explicitly mentioned in *.class files. However, javac requires having all superclasses of the classes being compiled and the classes methods from which are called in the classpath. In such cases, 'Extract Module' action and a quick-fix for extracting module in DevKit (IJPL-227635) didn't add required dependencies to the extracted module, so code fails to compile.

Here a new API JvmBytecodeAnalysis.createReferenceAnalyzerWithImplicitSuperclassReferences is introduced which can be used to take into account such implicit references as well.

GitOrigin-RevId: e4dec4e63d3a5ed70012747d386a48628275b6cb
2026-01-20 00:00:24 +00:00
Nikolay Chashnikov
e43677aa86 refactor [java]: move code which processes class-files from ExtractModuleService to ClassFileAnalyzer interface
This is needed to reuse it to improve quick-fix for DevKit inspection (IJPL-227635).

GitOrigin-RevId: a2f46e87c16d4111160ec3d9eafa09303fb7d46e
2026-01-19 15:40:48 +00:00
Nikolay Chashnikov
63cd89510f refactor [java]: rename ClassFileAnalyzer.processData to processFileContent for clarity
GitOrigin-RevId: e7a6c8fe98f626948ebd7e54c0b42f94907dbf2f
2026-01-19 15:40:48 +00:00
Mikhail Pyltsin
76d276b20d [java-inspections] IDEA-377682 JSpecify. Nullable incompatibilities. Calls with generics
GitOrigin-RevId: 5b501cf6f6e99a675ad2e78283000a0be86fb3ff
2026-01-16 17:07:48 +00:00
Mikhail Pyltsin
0780f14038 [java-frontend] IDEA-366600 Get rid of additional "Java for JetBrains Client" plugin
- move extension points where they are defined

GitOrigin-RevId: ab4db1b7557d6ce5b0a10fcde96be3f01f15b539
2026-01-16 10:52:27 +00:00
Mikhail Pyltsin
a43daddb89 [java-frontend] IDEA-366600 Get rid of additional "Java for JetBrains Client" plugin
- add comments and check structure, disable dependencies, disable remote servers

GitOrigin-RevId: 02ce5ef35d4ea84eb376f773fce1910583a3e3fa
2026-01-15 16:28:43 +00:00
Mikhail Pyltsin
6c3ad84680 [java-frontend] IDEA-366600 Get rid of additional "Java for JetBrains Client" plugin
- java backend

GitOrigin-RevId: fce68683d12e29cf35b179f848704dbe074f4d76
2026-01-15 16:28:43 +00:00
Mikhail Pyltsin
fd36687a77 IJ-CR-187719 [java-inspection] IDEA-382441 jspecify inspection doesn't highlight assignments
- fix using labels

GitOrigin-RevId: 59f30bc05372fec687d713dbb7c6d596fd324ee5
2026-01-15 10:34:07 +00:00
Mikhail Filippov
ea41f7932a [build] IJI-2993 enable progressive mode for Kotlin
GitOrigin-RevId: f506021c20fc3b3e5ef692c9092592e3bf247036
2026-01-14 11:00:39 +00:00
Mikhail Pyltsin
453ca78ef1 [java-inspection] IDEA-382441 jspecify inspection doesn't highlight assignments
GitOrigin-RevId: 29497c955c64040544a3bf4af0af0edd08763201
2026-01-13 12:40:21 +00:00
Bas Leijdekkers
6a2c7c78d2 IDEA-382921 [java]: introduce language level 26
GitOrigin-RevId: 52ce519b4445569dad4f3673ae1a7979784d5567
2025-12-29 18:24:17 +00:00
Mikhail Filippov
7744eca84a [build] IJPL-220367 bump Kotlin language and API versions
GitOrigin-RevId: c58c2f2ca3e4fbbe5116bd19119345174b7db32f
2025-12-20 13:35:48 +00:00
Ilya Korennoy
0b538dca29 IJPL-930 Remove usage of getOrderEntriesForFile from JdkUtils
GitOrigin-RevId: dd0ed191c98cafe869657dbbe503e19a80ef2822
2025-12-12 14:21:14 +00:00
Tagir Valeev
67d404a6f3 IDEA-372145 [java-intentions] follow-up: use different nullity annotations in AnnotateOverriddenMethodParameterFix
Also: simplify via delegation to ModCommand

GitOrigin-RevId: 59f6cbdbfbee2995036b802b0a3add9f2360122f
2025-12-01 19:48:04 +00:00
Georgii Ustinov
61c9277c17 [Java. Inspections] IDEA-381448 better type presentation when nullability conflict occurs
GitOrigin-RevId: 353527faa14b194d45ee50a2a637ceba11b4e175
2025-12-01 15:33:45 +00:00
Bartek Pacia
2ab73da394 [java-inspections] IDEA-382389 cleanup: remove '#loc' references
GitOrigin-RevId: 53e796b031742bb49dae4080c47ceab815fb0747
2025-11-26 13:57:42 +00:00
Georgii Ustinov
6a33175cfe [Java. Inspections] IDEA-381448 Show exact place for nullability conflict in return statements
GitOrigin-RevId: fe03e0582080b4717f7ee85f68b581780518cec4
2025-11-25 18:12:48 +00:00
Georgii Ustinov
1485a25d5a [Java] IDEA-375132 Canonize tooltip and option text for nullability conflicts in return statements
GitOrigin-RevId: 436a4cc574266f21cdc83a6ef8e50b6991d749ea
2025-11-05 10:04:00 +00:00
Tagir Valeev
63f8fd27cc [java-analysis] IDEA-381010 follow-up: better javadoc for getIntroducedApiLevel
GitOrigin-RevId: a1dd0923187b0853d9eaddd4894b64a976503cdf
2025-10-31 02:31:40 +00:00
Marcin Mikosik
7881c922dc [java] IDEA-377335 Add configuration for "Redundant nullability annotation in the scope of annotated container"
#IDEA-377335 Fixed

Merge-request: IJ-MR-179742
Merged-by: Marcin Mikosik <marcin.mikosik@jetbrains.com>

GitOrigin-RevId: 8ea1a93c936c5fe2e84bcee578ac9d21f921535f
2025-10-29 15:44:01 +00:00
Tagir Valeev
3a2becf03d [java-inspections] IDEA-381010 Incorrect highlighting of API which is graduated from preview but used with older JDK
GitOrigin-RevId: 9130a26ccf3592fcf227a4b2176fee36729274d0
2025-10-22 09:25:20 +00:00
Marcin Mikosik
879add0d45 [java] IDEA-377910 Add AnnotateAsNullMarkedFix
#IDEA-377910 Fixed

Merge-request: IJ-MR-177841
Merged-by: Marcin Mikosik <marcin.mikosik@jetbrains.com>

GitOrigin-RevId: 14af00bf03e62781182559847f35b7d18e1c2a91
2025-10-21 17:59:51 +00:00
Tagir Valeev
1837f3b465 [java-inspections] IDEA-378513 Inspection 'Usages of API which isn't available at the configured language level' suggests preview level even when stable is there
GitOrigin-RevId: 0affa8b0f615d4e89b8076491093baa5cc1ea6c6
2025-10-08 16:21:30 +00:00
Georgii Ustinov
5480b565a5 [Java. Inspections] IDEA-375132 Nullable return incompatibilities Basic implementation.
MR brings detection of nullable inconsistencies inside return expressions for generic types. Now it supports
- Support of arbitrary generic type (previously only collections was supported)
- Recursive detection of inconsistencies
- Detection of assigning not-null to nullable (via option)

GitOrigin-RevId: ed37ea02ca44db58698f36f2ca82c67171733e69
2025-10-02 14:36:35 +00:00
Tagir Valeev
cce68d9b4d [java-inspections] IDEA-377761 Incorrect usages of annotations. Opposite container annotations together
GitOrigin-RevId: 2a9ceb46787ef8cdff3677cd1c1c72782951c9cc
2025-09-30 17:43:53 +00:00
Alexey Kudravtsev
164a90ccda cleanup: threading annotate (part of IJPL-210489 rework auto-imports hints to show in more places)
GitOrigin-RevId: 6ba2983dad5dea331608ea02b26b8a5a867643a2
2025-09-30 16:10:52 +00:00
valentin.dorofeev
9c5f5b4cbf IDEA-365975 Spring MVC: suggest to remove explicit path variable name if there's matching parameter
GitOrigin-RevId: 1ce9da79e81a8db1914dd9a2ccb00ca2bea48f84
2025-09-30 15:03:34 +00:00
Tagir Valeev
d5653fd75b [java-inspections] IDEA-377764 Incorrect usages of annotations. Annotations can be used for 'throws' lists
GitOrigin-RevId: e2d03f73bd84865de29e48d21c492620497e13f3
2025-09-29 09:18:43 +00:00
Ilia Kirianovskii
f43aa95086 [bazel] Update build files (IJI-3062)
GitOrigin-RevId: 98a67396a48bddc3d084cc93c50ae2f2017bfe8c
2025-09-29 00:11:15 +00:00
Mikhail Pyltsin
eebb6c4bb2 [java-highlighting] IDEA-378781 Quick fixes for typos in keywords
GitOrigin-RevId: 3984441825712d7f566461eaea10748d5b78f024
2025-09-22 14:16:34 +00:00
Tagir Valeev
d4de41f38e [java] IDEA-375037 follow-up: void method, javadoc
GitOrigin-RevId: b468180a9f9574db66a805b40db3c8ded74e5f19
2025-09-15 12:01:04 +00:00
Tagir Valeev
009a6284e9 [java] IDEA-372145 follow-up: use SequencedMap; wording
GitOrigin-RevId: 8b2e9886481740602ddf3f6fecf92ca180bd7412
2025-09-11 18:13:46 +00:00
Mikhail Pyltsin
cad4af911f IJ-CR-175223 [java-highlighting] IDEA-252433 Suggest the correct import when the wrong one was chosen from ambiguous
- move fix creation to its error
- more tests

GitOrigin-RevId: 367725f7d3cf6a47d07dc91a84a83898c7e72e59
2025-09-11 17:31:17 +00:00
Marcin Mikosik
c4272dc602 [java] IDEA-216276 Add ShowDuplicateElementsFix that shows popup with a list of element duplicates and use it for duplicate-method error
#IDEA-216276 Fixed
Merge-request: IJ-MR-171237
Merged-by: Marcin Mikosik <marcin.mikosik@jetbrains.com>

GitOrigin-RevId: 5aab229888a361d3d4f653708b7f42d832c44645
2025-09-11 08:47:24 +00:00
Nikolay Chashnikov
4f63150cff [intellij project configuration] change JVM target level from 17 to 21 in Kotlin facets (IJPL-176259)
GitOrigin-RevId: d518be3562a359b9d4034c2972d7c8444741b7f0
2025-08-30 07:50:09 +00:00
Aleksei.Cherepanov
c7515bfd3a KTIJ-35250 [Bazel] Promote "Missing dependency superclass" warning to error (part 2)
This commit enables check only for modules WITH a Kotlin facet
Bazel generator was updated as well

GitOrigin-RevId: 90a3427d4b5a3ebc29e257693cb3748ac09bfc6a
2025-08-24 18:49:00 +00:00
Marcin Mikosik
9fd6ada970 [java] IDEA-283208 Add quickfix: Lift 'throw' out of 'switch' expression
Adds a quick-fix: "Lift 'throw' out of 'switch' expression" that that is provided for error "'switch' expression does not have any result expressions".
Some rare cases are not handled (fix is not provided for mentioned error).
For example when switch is used inside:
 - initialization/condition/update part of for loop
 - initializer of class field
 - condition of do-while loop
 - lock expression in synchronized statement
 - any part of assert statement
 - resource initializer of 'try' statement

#IDEA-283208 Fixed
Merge-request: IJ-MR-172146
Merged-by: Marcin Mikosik <marcin.mikosik@jetbrains.com>

GitOrigin-RevId: a2710c49e16b7f495974fb167bcae01b3d850f7b
2025-08-21 09:10:24 +00:00
Ilia Kirianovskii
dc268560b6 [bazel] Update build files (IJI-2835)
GitOrigin-RevId: 275260ab73f59d3c08f0b4cb9f4c89b74054094a
2025-08-20 08:49:22 +00:00
Mikhail Pyltsin
22b7af6762 [java-highlighting] IDEA-267379 "Non-canonical record constructor must delegate to another constructor" fix could be provided
GitOrigin-RevId: f27d1c6ae299debfaab0504921cf96487c9b62ab
2025-07-30 11:08:29 +00:00
Tagir Valeev
3bcffa8c6f [java-intentions] Add OrderEntryFix to 'Cannot access class' error
Fixes IDEA-375037 Cannot access class error should suggest to add dependency on a module to the current

GitOrigin-RevId: 2cc6748f663131eb119b974d6c3699b5f9fcf854
2025-07-30 09:58:00 +00:00
Mikhail Filippov
0e1e215c2c update bazel files
GitOrigin-RevId: 00c5dbade7ac3b8416f30d5527e4c83b35902ce5
2025-07-26 22:51:48 +00:00
Bart van Helvert
94d5fdf882 [java] Replace not-null with non-null
To make error messages consistent #IDEA-374747 Fixed


(cherry picked from commit 328c5b355fcf56a7d1c165aab32220d37bdfcbc1)

IJ-MR-170004

GitOrigin-RevId: f00fb74ddbff84b18839c60648d664774d566966
2025-07-22 21:25:49 +00:00
Tagir Valeev
2ce7f33204 [java-inspections] IDEA-376188 Report redundant non-null annotation on a type parameter instance when its upper bound is already non-null
GitOrigin-RevId: 04d62987d77f30d0a558cd06450c925e13c102d7
2025-07-21 16:23:11 +00:00
Tagir Valeev
ac013e30b2 [java] Make default annotations context-dependent
Default annotation is now defined from PSI context using an ordered list of nullable or notnull annotations. The first available annotation is selected.
For Spring Boot 3, default annotation is org.springframework.lang.NonNull/Nullable
For Spring Boot 4, default annotation is org.jspecify.annotations.NonNull/Nullable
Legacy settings with an unordered annotation list are converted to make them ordered
Non-context-specific default annotations are still used as a default for external and inferred annotation; also it's a fallback option in contexts where no annotation is available at all
ChangeNullableDefaultsFix is removed, as now it's unlikely to produce the desired result (and probably was not useful before as well)
Fixes IDEA-372145 Support for third-party nullability providers

GitOrigin-RevId: 31794eb024ba310ca35d4b3df33420d0bb344898
2025-07-17 15:56:29 +00:00
Mikhail Pyltsin
90e47a82ba [java] IDEA-375980 There is still name 'implicit class' in inspect code results
GitOrigin-RevId: 3465d129105300a18b6c9116617cf756aa15d188
2025-07-16 13:26:44 +00:00
Tagir Valeev
f2c1dc3a24 [java-dfa] Use 'non-null variable' instead of 'variable annotated as @NotNull'
The annotation may differ, depending on library used. Also, it could be a container annotation like @NullMarked or @NotNullByDefault, so let's use more neutral wording

GitOrigin-RevId: cb4923f5ec3974f56ec1b6763c2405c1471bf601
2025-07-11 17:16:17 +00:00
Bartek Pacia
5f82fd263f [java-analysis-api] IDEA-375621 Enable Kotlin "explicit API mode"
GitOrigin-RevId: 1277b49d5f2e89cc411ca14711c843285e6ab787
2025-07-09 15:25:05 +00:00