Commit Graph
214 Commits
Author SHA1 Message Date
Marcin Mikosikandintellij-monorepo-bot e14522817c [java] IDEA-377910 Add AnnotateAsNullMarkedFix
#IDEA-377910 Fixed

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

(cherry picked from commit fef51fbed5f227086d864dfc6483298585a78d8f)

IJ-CR-179837

GitOrigin-RevId: 8c43501fabba014db05c3a4930bcaeb69c865597
2025-10-27 10:10:00 +00:00
Georgii Ustinovandintellij-monorepo-bot 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 Valeevandintellij-monorepo-bot cce68d9b4d [java-inspections] IDEA-377761 Incorrect usages of annotations. Opposite container annotations together
GitOrigin-RevId: 2a9ceb46787ef8cdff3677cd1c1c72782951c9cc
2025-09-30 17:43:53 +00:00
Tagir Valeevandintellij-monorepo-bot 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
Tagir Valeevandintellij-monorepo-bot 009a6284e9 [java] IDEA-372145 follow-up: use SequencedMap; wording
GitOrigin-RevId: 8b2e9886481740602ddf3f6fecf92ca180bd7412
2025-09-11 18:13:46 +00:00
Bart van Helvertandintellij-monorepo-bot 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 Valeevandintellij-monorepo-bot 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 Valeevandintellij-monorepo-bot 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 Pyltsinandintellij-monorepo-bot 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 Valeevandintellij-monorepo-bot 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
Bas Leijdekkersandintellij-monorepo-bot 9744fab524 Java: better quick-fix name
GitOrigin-RevId: 459b5f435f389fc42b0b1b1ba2b08c458be8bafe
2025-06-24 17:51:53 +00:00
Tagir Valeevandintellij-monorepo-bot b56c24001e [java-inspections] Report incompatible instantiation
Fixes 'nice to have' parts of IDEA-372223 Nullability inference for generic parameters

GitOrigin-RevId: fe9490c352ee417b8a4146076632ef42790a4d25
2025-06-12 12:11:23 +00:00
Tagir Valeevandintellij-monorepo-bot 06ae5648d1 [java-inspections] IDEA-371907 Warn about redundant '@NotNull' annotation when the scope is already covered by '@NotNullByDefault'
GitOrigin-RevId: a703f9e76d11471607532063b4c6c55433579080
2025-05-02 13:00:08 +00:00
Tagir Valeevandintellij-monorepo-bot 60f631689c [java-inspections] Internationalize inspection message for IDEA-370683
GitOrigin-RevId: 811c4c00965ea6efdc68204ae45f88be321ff689
2025-04-15 15:49:00 +00:00
Bas Leijdekkersandintellij-monorepo-bot e90a4de2d9 Java: improve inspection messages
for "Java module name contradicts convention" inspection

GitOrigin-RevId: aee175101de907aea9c6ce65a12ad1ed02513dc6
2025-04-15 08:34:10 +00:00
Tagir Valeevandintellij-monorepo-bot a0f777069b [java-highlighting] move module-related warnings to JavaModuleDefinitionInspection
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: 66179a41da5e02b759f07f9d6638b87711181348
2025-02-17 12:04:21 +00:00
Tagir Valeevandintellij-monorepo-bot 2350d69472 [java-highlighting] JavaCompilationErrorBundle.properties proofreading (DOC-34381)
GitOrigin-RevId: 05bdca159a63027ea0d1e3d767d4adb9b258f47e
2025-02-14 12:45:24 +00:00
Tagir Valeevandintellij-monorepo-bot 66c585bdb0 [java-inspections] JavaAnalysisBundle.properties: unused properties removed
GitOrigin-RevId: 8d41fa6655d530381721170018edf25c9abd8e51
2025-02-11 15:54:30 +00:00
Tagir Valeevandintellij-monorepo-bot c4549cf1a5 [java-inspections] Save varargs warning text fixed
GitOrigin-RevId: d934d8ef4c47848ad2edfda608a4cd29eadee35a
2025-02-11 15:54:30 +00:00
Tagir Valeevandintellij-monorepo-bot 9dbf2ace73 [java-inspections] UnreachableCatchInspection extracted from highlighter
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: b2e389aa89d75c63969a3884a495b3771d2712b2
2025-01-27 18:53:10 +00:00
Tagir Valeevandintellij-monorepo-bot 07960b2159 [java-intentions] AddTypeArgumentsConditionalFix: report the branch
After changes in highlighting, it's not possible anymore to attach a fix to the range. In general, it's good, because the user may have no idea that the fix is available at a specific offset. So instead, we allow invoking the fix at the whole error range but indicate which branch will be updated.
Also: parentheses supported; fix all option added, minor touch-ups

GitOrigin-RevId: d756252cd1d3c061f52bdb70d62bed3bedcb69e3
2025-01-15 19:19:41 +00:00
Tagir Valeevandintellij-monorepo-bot aefc2b83e7 [java-highlighting] Literal and comment problems; findSingleError
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: 6e0c38d1caea9272cee420c35589dfb859950793
2025-01-14 12:42:34 +00:00
Tagir Valeevandintellij-monorepo-bot c7edfdbe4a [java-highlighting] SafeVarargs checks -> AnnotationChecker
Also, warnings are moved out to inspections
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: 2292723fde787454467307c213ea38e730aa0ff5
2025-01-08 16:42:47 +00:00
Tagir Valeevandintellij-monorepo-bot d49d42c5d5 [java] annotation.target.* messages moved to JavaPsiBundle.properties
GitOrigin-RevId: ae0914063db552bdbd24b10348ad6e92e9e83636
2025-01-03 19:17:43 +00:00
Tagir Valeevandintellij-monorepo-bot 676c19bc1f [java-inspections] Report TYPE_USE nullability annotation on classes
GitOrigin-RevId: f5c6113ccd1738d72b0f58fe13a8352a043431c9
2024-10-11 08:10:27 +00:00
Yuriy Artamonovandintellij-monorepo-bot 47f1c44a90 [java] IJPL-158521 Actions: fix ellipsis in messages for Java actions
GitOrigin-RevId: bfce0d6efa8747660c4b9af3d8defbfa47e4509a
2024-09-15 14:50:09 +00:00
Tagir Valeevandintellij-monorepo-bot 59325634ab [java-inspections] IDEA-356832 Inspections ignore redundant Class::cast method call
GitOrigin-RevId: 390a19d69020bc91f1395e6c4d23f14992ca396b
2024-08-28 17:54:26 +00:00
Tagir Valeevandintellij-monorepo-bot d52f6c789f [java-dfa] IDEA-355908 Add new mutation contract option: io
GitOrigin-RevId: 206fae268d8444d475a4feac6ebc5ef96ffc57bb
2024-07-04 21:05:23 +00:00
Tagir Valeevandintellij-monorepo-bot b023c1d252 [java-highlighting] error.unnamed.variable.brackets: proof-reading
GitOrigin-RevId: b30031e9d76de357434f48e71b099cf27d4b90e4
2024-07-03 17:42:16 +00:00
Bas Leijdekkersandintellij-monorepo-bot 6916b6b005 Java: better error message when there are more arguments than parameters (IDEA-336129)
GitOrigin-RevId: a17a5f0f3878b9baf211737a614d1aa1a5103d31
2024-06-28 17:14:56 +00:00
Tagir Valeevandintellij-monorepo-bot 522f2ab43e [i18n] Fix internationalization warnings
GitOrigin-RevId: 7b4a959cf215d79d86d6d9a7727f0fc054097517
2024-06-18 13:46:50 +00:00
Tagir Valeevandintellij-monorepo-bot 567e0b0d05 [java-intentions] IDEA-270206 Nullability annotation at type parameter/wildcard: add a quick-fix to move it to the bound
GitOrigin-RevId: e8e56c2d27a77414045064c784f48ff712ad0d2d
2024-06-14 16:05:02 +00:00
Tagir Valeevandintellij-monorepo-bot 8fad668268 [java-inspection] IDEA-345669 Report value compared to itself with == or !=
GitOrigin-RevId: 601c0bb6c5beddaace52d3b094506d2229195d37
2024-05-15 15:55:21 +00:00
Tagir Valeevandintellij-monorepo-bot ee495db972 [java-intentions] MoveMembersIntoClassFix: improve and revive property test
After implicit classes, out-of-class member is parsed. If it was mistakenly put out of the class, it may have many unrelated compilation errors. E.g. extra Override annotation, unresolved reference (to another member of the class), etc. These errors were masking the 'Move member to class' action, because its scope was larger (the whole method).
Now, we put 'feature not available' error specifically to the method/field name identifier, so it's almost always available. Also, action name is more friendly now, and JavaOutOfClassDefinitionPropertyTest is tuned: caret position and language level set correctly.

GitOrigin-RevId: 39917d11fb216be4db3f6fbc9e984ca7378f7302
2024-04-23 10:35:24 +00:00
Tagir Valeevandintellij-monorepo-bot a3e3ed8591 [java-highlighting] Remove extra space
GitOrigin-RevId: 98a9c2395ef5f9605d39029dfe5e695d76c4237e
2024-04-23 09:43:59 +00:00
Tagir Valeevandintellij-monorepo-bot f943967aec [java-inspections] Minor fixes for IDEA-346242 Add 'minimal java version' clause automatically to inspection descriptions
1. Add features to assertion inspections
2. Remove redundant feature message from HTML descriptions
3. Display Java 1.3 and Java 1.4 version properly
4. Display several features when necessary

GitOrigin-RevId: 133b46152ad8376a37aa4fd847bedf38d45f3135
2024-04-05 10:20:31 +00:00
Bas Leijdekkersandintellij-monorepo-bot 9e22b48c16 [java] show containing file name of implicit classes in batch inspection results (IJ-CR-130524)
GitOrigin-RevId: 280b18e1a50ed18db8dfcc79ce95dc2d9669f9df
2024-04-03 14:14:27 +00:00
Bas Leijdekkersandintellij-monorepo-bot ab2af3d314 [java] don't show implicit classes as "anonymous" in batch inspection results (IDEA-334425)
GitOrigin-RevId: 1c636b01743409c25ef084faca47f34b0127ff4d
2024-04-01 10:52:12 +00:00
Tagir Valeevandintellij-monorepo-bot d89c17fc59 [kotlin-dfa] Move inspection.data.flow.warn.when.reading.a.value.guaranteed.to.be.constant to JavaAnalysisBundle
Preparatory step for KTIJ-28908 Convert "Constant conditions" inspection to K2

GitOrigin-RevId: 68798782d260f8245947423efd936ae82bde841c
2024-02-24 12:22:09 +00:00
Tagir Valeevandintellij-monorepo-bot 64327f79d6 [java-inspections] IDEA-346242 Add 'minimal java version' clause automatically to inspection descriptions, based on the required feature(s)
GitOrigin-RevId: 50a25148d4d36c46e9552b3123d1ef966b40a2c2
2024-02-15 15:28:00 +00:00
Tagir Valeevandintellij-monorepo-bot a7674dca70 [java] IDEA-345355 Refactor HighlightingFeature (in progress)
Create JavaLanguageFeature; move HighlightingFeature functionality there; move preview highlighting related utilities to new PreviewFeatureUtil class

GitOrigin-RevId: 116bcc9feb6fb40a0bd6a25ba10c2f35b41ffea6
2024-02-08 10:07:12 +00:00
Bas Leijdekkersandintellij-monorepo-bot 176a8e0bec Java: statements before super() part I (IDEA-340403)
GitOrigin-RevId: 7307a469267746ed3432acd1e73c894ccc87a254
2023-12-28 17:39:19 +00:00
Tagir Valeevandintellij-monorepo-bot f7074186ea [java-inspections] PreviewFeatureInspection: add features from Java 20-22
Fixes IDEA-340983 Preview API (structured concurrency) usage in Java 21 is not highlighted

GitOrigin-RevId: cd02d5e1fe328104a47ac1fd684b2e2324b6558d
2023-12-14 15:51:27 +00:00
Tagir Valeevandintellij-monorepo-bot 6e1d684df0 [java-inspections] UseHashCodeMethodInspection: support double type
Also: fix comment processing
Improvement of IDEA-338114

GitOrigin-RevId: 87d057ccbea4262c40e2717c2ea3c004ac9865b0
2023-12-11 21:37:14 +00:00
Mikhail Pyltsinandintellij-monorepo-bot 3f86cf9292 [java-highlighting] IDEA-339935 JEP 463
- rename unnamed classes to implicitly declared classes

GitOrigin-RevId: 2c6d7f16a1dc6d2371b8f8b5f5675246c9bc99f9
2023-12-11 15:49:28 +00:00
Bas Leijdekkersandintellij-monorepo-bot a50138d2c8 Java: improve javac quirks inspection texts (IJPF-CR-15669)
GitOrigin-RevId: fa038ac62b8f9e0a4fd56a483578741a353e0886
2023-11-29 20:30:35 +00:00
Andrey Cherkasovandintellij-monorepo-bot f6af5745f7 [llm] Declare the text attribute for internal actions in plugin.xml
instead of using property files, as we do not intend to localize all internal actions.

IJ-CR-120022

GitOrigin-RevId: bdf91572dd59128131e54537f382851acf29a762
2023-11-20 11:11:06 +00:00
Tagir Valeevandintellij-monorepo-bot 2770254f2f [java-inspections] IDEA-338114 Suggest to replace (int)(v ^ (v >>> 32)) with a Long.hashCode(v)
GitOrigin-RevId: 2d9591f9d9a558c4a61ac226556ef9f551d6e0c2
2023-11-15 21:43:17 +00:00
Andrey Cherkasovandintellij-monorepo-bot b22e497d8c [llm] StatisticCollectorAction: cleanup
See description of the "Eager creation of action presentation" inspection

GitOrigin-RevId: 3e05c90a81afe8cd1a178ce243b503523dd7b0b5
2023-11-14 11:42:13 +00:00
Tagir Valeevandintellij-monorepo-bot 17a223b66d [mod-command] NullableNotNullManagerImpl: OptionController; used in ChangeNullableDefaultsFix
GitOrigin-RevId: 66d6128248cd06e81cb3ec7826265ea4a23b7dbf
2023-11-14 11:01:16 +00:00