Commit Graph

206 Commits

Author SHA1 Message Date
Mikhail Pyltsin
d1a5734347 [java] IDEA-375980 There is still name 'implicit class' in inspect code results
(cherry picked from commit 3465d129105300a18b6c9116617cf756aa15d188)


(cherry picked from commit 10842aa79b01c067c959787333a212b170a6f8ce)

IJ-MR-169535

GitOrigin-RevId: 4aaa7e37cd2ddfdf14230c2a69a7346f4b0ed0d4
2025-08-04 12:58:50 +00:00
Bas Leijdekkers
6170d7d089 Java: language level 25 (IDEA-369743)
GitOrigin-RevId: b840dc633f13d96ac89efafcb823da0f09288990
2025-06-13 15:42:04 +00:00
Tagir Valeev
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 Valeev
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 Valeev
60f631689c [java-inspections] Internationalize inspection message for IDEA-370683
GitOrigin-RevId: 811c4c00965ea6efdc68204ae45f88be321ff689
2025-04-15 15:49:00 +00:00
Bas Leijdekkers
e90a4de2d9 Java: improve inspection messages
for "Java module name contradicts convention" inspection

GitOrigin-RevId: aee175101de907aea9c6ce65a12ad1ed02513dc6
2025-04-15 08:34:10 +00:00
Tagir Valeev
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 Valeev
2350d69472 [java-highlighting] JavaCompilationErrorBundle.properties proofreading (DOC-34381)
GitOrigin-RevId: 05bdca159a63027ea0d1e3d767d4adb9b258f47e
2025-02-14 12:45:24 +00:00
Tagir Valeev
66c585bdb0 [java-inspections] JavaAnalysisBundle.properties: unused properties removed
GitOrigin-RevId: 8d41fa6655d530381721170018edf25c9abd8e51
2025-02-11 15:54:30 +00:00
Tagir Valeev
c4549cf1a5 [java-inspections] Save varargs warning text fixed
GitOrigin-RevId: d934d8ef4c47848ad2edfda608a4cd29eadee35a
2025-02-11 15:54:30 +00:00
Leonid Shalupov
40795fe787 IJI-2422: community/java: move resources under resources root
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
2025-02-05 04:43:28 +00:00
Tagir Valeev
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 Valeev
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 Valeev
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 Valeev
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 Valeev
d49d42c5d5 [java] annotation.target.* messages moved to JavaPsiBundle.properties
GitOrigin-RevId: ae0914063db552bdbd24b10348ad6e92e9e83636
2025-01-03 19:17:43 +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
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
Tagir Valeev
59325634ab [java-inspections] IDEA-356832 Inspections ignore redundant Class::cast method call
GitOrigin-RevId: 390a19d69020bc91f1395e6c4d23f14992ca396b
2024-08-28 17:54:26 +00:00
Tagir Valeev
d52f6c789f [java-dfa] IDEA-355908 Add new mutation contract option: io
GitOrigin-RevId: 206fae268d8444d475a4feac6ebc5ef96ffc57bb
2024-07-04 21:05:23 +00:00
Tagir Valeev
b023c1d252 [java-highlighting] error.unnamed.variable.brackets: proof-reading
GitOrigin-RevId: b30031e9d76de357434f48e71b099cf27d4b90e4
2024-07-03 17:42:16 +00:00
Bas Leijdekkers
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 Valeev
522f2ab43e [i18n] Fix internationalization warnings
GitOrigin-RevId: 7b4a959cf215d79d86d6d9a7727f0fc054097517
2024-06-18 13:46:50 +00:00
Tagir Valeev
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 Valeev
8fad668268 [java-inspection] IDEA-345669 Report value compared to itself with == or !=
GitOrigin-RevId: 601c0bb6c5beddaace52d3b094506d2229195d37
2024-05-15 15:55:21 +00:00
Tagir Valeev
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 Valeev
a3e3ed8591 [java-highlighting] Remove extra space
GitOrigin-RevId: 98a9c2395ef5f9605d39029dfe5e695d76c4237e
2024-04-23 09:43:59 +00:00
Tagir Valeev
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 Leijdekkers
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 Leijdekkers
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 Valeev
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 Valeev
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 Valeev
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 Leijdekkers
176a8e0bec Java: statements before super() part I (IDEA-340403)
GitOrigin-RevId: 7307a469267746ed3432acd1e73c894ccc87a254
2023-12-28 17:39:19 +00:00
Tagir Valeev
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 Valeev
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 Pyltsin
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 Leijdekkers
a50138d2c8 Java: improve javac quirks inspection texts (IJPF-CR-15669)
GitOrigin-RevId: fa038ac62b8f9e0a4fd56a483578741a353e0886
2023-11-29 20:30:35 +00:00
Andrey Cherkasov
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 Valeev
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 Cherkasov
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 Valeev
17a223b66d [mod-command] NullableNotNullManagerImpl: OptionController; used in ChangeNullableDefaultsFix
GitOrigin-RevId: 66d6128248cd06e81cb3ec7826265ea4a23b7dbf
2023-11-14 11:01:16 +00:00
Alexey Kudravtsev
9b4cc7a05d new inspection: "missorted imports" with quick-fix-only severity, to fix IDEA-334084 No "Optimize imports" action is displayed
GitOrigin-RevId: 92028252fc0b4c8ab05b7236de15ff44090a7183
2023-11-08 14:55:31 +00:00
Bas Leijdekkers
8cbdbab21a Java: move old check to quirks inspection
GitOrigin-RevId: f1201462a504c09c1d4ca10e813c343d03be55ac
2023-11-06 11:16:53 +00:00
Tagir Valeev
943bacb4c0 [java-inspections] AnnotateMethodFix: mod-command
Now, works for in-code annotations only (but may work in batch). Was used for MissingOverrideAnnotationInspection and NullableStuffInspectionBase. The later uses old code now, as external annotations could be desired there.

Part of IDEA-322693 Migrate as much as possible Java intentions and quick-fixes to ModCommand API

GitOrigin-RevId: f580467c5e64782a629bbe7a48b7f95686f6b83c
2023-10-24 16:54:33 +00:00
Tagir Valeev
66d3646f6d [java-inspections] IDEA-331613 "Overridden parameter annotations" lint should be "Overriding"
GitOrigin-RevId: 7234832a572304695efe2fd21af60127679715df
2023-09-15 10:19:11 +00:00
Roman Ivanov
31928210fc [java] add move all members to class fix
GitOrigin-RevId: f5ad44f993f2f386c9847dc57ddac86cb4cf45d2
2023-09-07 08:48:06 +00:00
Roman Ivanov
4ef891cf5e add unnamed class feature and check for usage
GitOrigin-RevId: 51ab72778378fdf84d19cb801b10ef9fb1eb2929
2023-08-27 21:23:12 +00:00
Tagir Valeev
6495c1370c [java-dfa] IDEA-327154 String templates support in data flow inspection
GitOrigin-RevId: da9176e33611213fa6ab49ef1aba03d8550c2c12
2023-08-04 15:20:03 +00:00
Tagir Valeev
a828a34968 [java-highlighting] Fixes in unnamed variables highlighting (IDEA-323960)
1. Highlight C-style arrays
2. Do not highlight variables inside for initializer
3. Highlight variables without initializer
4. Better message for underscore references when unnamed variables are allowed

GitOrigin-RevId: 5bca18969cf8fb0ea6e052b0aef71323bbfa69b5
2023-08-02 21:04:54 +00:00