Commit Graph

83 Commits

Author SHA1 Message Date
Nikolay Chashnikov
d039e59e88 [java] report access to package-private members declared in production code from tests (IDEA-372858)
GitOrigin-RevId: 6f046186e0f0a587e1aaab31dd55b9f76a28db96
2025-05-19 10:03:24 +00:00
Marat Dinmukhametov
f3df8ba421 [http-client, microservices-jvm] IJPL-179625 The URL part of MicroservicesJvm was moved to Java
Because HttpClient will be in Android Studio. It needs access to this API to have implementations of HTTP clients (Ktor, Retrofit, OkHttp) in Android Studio.

GitOrigin-RevId: 30771b08ec0a1642ca010cde8513703abc0f7b0f
2025-05-15 09:59:55 +00:00
Bas Leijdekkers
26d26d0caa Java: update inspection name and description (IDEA-271214)
GitOrigin-RevId: 6c3b065c026b0de4e3b9cdf881ac2427c912390f
2025-05-13 17:43:07 +00:00
Mikhail Pyltsin
037958feaf [java-inspections] IDEA-360079 unused for main method modifiers
GitOrigin-RevId: 698a021a1c86d8365a113d2d1b47c085beec9489
2025-05-09 11:55:52 +00:00
Nikolay Chashnikov
aaa77e18b7 [java] remove UI for configuring groups of modules loaded together in 'Suspicious package-private access' inspection (IDEA-200047, IJPL-149126)
We got rid of such exceptions in intellij monorepo (see IJPL-149126), and it's better to remove the ability to add them back. Given that the inspection is currently visible in internal mode only, it shouldn't affect users. Moreover, since the usability of UI was questionable, after removing it we can make the inspection non-internal.

The option itself and code which reads its configuration are kept to avoid red code in older branches of the monorepo where the problems in code aren't fixed.

GitOrigin-RevId: 2bf42ade9ec35de6571a1d42889569790d0655b5
2025-05-02 08:05:38 +00:00
Tagir Valeev
5fd8eb4a09 [java-inspections] IDEA-371838 Convert SideEffectsMethodRefToLambdaFix to ModCommand
GitOrigin-RevId: 8e1fff8b05604adf5fe3e6dc853d8ac952b5a242
2025-04-29 13:01:39 +00:00
Bas Leijdekkers
e24bcbd00c Java: improve inspection messages and fix replacement with tab character
in "Unnecessary Unicode escape sequence" inspection

GitOrigin-RevId: 53cd08d56aba3aa23ab4580ebbaf0c3807a7047b
2025-04-12 16:28:13 +00:00
Bartek Pacia
bb7efcadba [java-inspections] SequencedCollectionMethodCanBeUsedInspection should ignore named constants
#IDEA-367961 fixed


Merge-request: IJ-MR-155974
Merged-by: Bartek Pacia <bartek.pacia@jetbrains.com>

GitOrigin-RevId: aa16bf0758ef523f21c0eeaf73e27e418fc0cd89
2025-02-25 12:59:44 +00:00
Aleksey Dobrynin
d41422ac8f [java, import-module] Replace 'import module' with class imports in module-info.java (IDEA-367505)
GitOrigin-RevId: 8a0ba58ca14698f553fdd6baf132d00d7ba0e504
2025-02-14 01:09:59 +00:00
Bas Leijdekkers
2d7e9aec9c Java: report implicit assignment or return of record components with mutable type (IDEA-325828)
GitOrigin-RevId: f7b7091c291db33468bb60b22cab01dc11aca586
2024-12-29 13:41:59 +00:00
Mikhail Pyltsin
1fa30df2e4 [java-inspection] IDEA-364384 'Non-constant string as argument to ...' logging call has no quick fix if logger is returned from another method
GitOrigin-RevId: f33aa6b47a420fe610a440fd4321826a7a43452f
2024-12-27 16:44:32 +00:00
Mikhail Pyltsin
94efe9cb4d [java-completion] IDEA-359174 command completion
- add new actions: getter/setter/find usages, introduce variable
- fix set of actions

GitOrigin-RevId: 9f733d5b38cb8333c3c83e1a0f3d8ea43d7bcbb1
2024-12-03 21:33:19 +00:00
Tagir Valeev
da09d6373a [java-intentions] Remove redundant properties
GitOrigin-RevId: 934b84c1f3ee9e14e665fdaf267000cc0e946c07
2024-12-03 14:25:33 +00:00
Bas Leijdekkers
a016f884d3 Java: add error for class extending sealed class from another package (IDEA-358672)
GitOrigin-RevId: d7b0c68100ddc60f42bfedc1f3b88e54cbd3ce74
2024-10-29 01:52:20 +00:00
Tagir Valeev
dd15592444 [java-inspections] Refactor and improve MismatchedCollectionQueryUpdate
1. Track separately updates that have no effect on empty collection
2. Extract MismatchedQueryUpdateRunner to avoid lots of arguments
3. Make QueryUpdateInfo immutable record
4. Track variables containing derived collections
5. Track iterators as derived collections

Fixes IDEA-356315 Incorrect suggestion of Stream.toList() when followed by Iterator.remove()

GitOrigin-RevId: 3b7fd99b2310f123e924034f7c623bd01e4e4c40
2024-10-21 17:40:32 +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
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
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
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
ac0c57748b [java-inspections] IDEA-346005 Add new inspection: Unnecessary keySet() call
GitOrigin-RevId: d1f1db0ae939017a8550b91cd8742dc222a8db99
2024-09-17 07:28:39 +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
Bas Leijdekkers
028d526405 Java: fix false positive when using java 21 pattern matching (IDEA-357175)
in "'equals()' should check the class of its parameter" inspection

GitOrigin-RevId: f84071ea339bf690eadcba60d491eebe4cb21a7e
2024-09-05 15:02:58 +00:00
Mikhail Pyltsin
dd822c1bc7 IJ-CR-142710 [java-inspections] IDEA-357725 LoggerInitializedWithForeignClassInspection should skip when the logger is not the final field
- fix texts

GitOrigin-RevId: 85d86f362ce860118d2a047321bf4916e01757da
2024-09-02 18:36:41 +00:00
Bas Leijdekkers
7db980cfcf Java: remove unneeded ':' from inspection problem report
GitOrigin-RevId: 9b0c070c8ca2a883d0d07f0064b67f22594cbced
2024-08-21 09:12:08 +00:00
Bas Leijdekkers
bd7f1f4270 Java: proper order of 'true' and 'false' in quick-fix name (IDEA-357973)
also fixes internationalization and the incorrect comma in the name
for "Create missing switch branches" quick-fix

GitOrigin-RevId: 16285e054447d8d15318df8889499bbbf91243a7
2024-08-21 09:12:08 +00:00
Mikhail Pyltsin
c56e5e7313 [java-inspections] IDEA-357725 LoggerInitializedWithForeignClassInspection should skip when the logger is the final field
GitOrigin-RevId: e910d9bb094f058c363148a3d08b695276bcc2c6
2024-08-15 18:02:00 +00:00
Mathias Boulay
abd7b1dded fix(JDoc): Formatting and inspections issues
GitOrigin-RevId: 910e9b3335fa7c3967fb79893ecba7c69595a201
2024-08-14 18:24:38 +00:00
Bas Leijdekkers
f40ed914fb Java: fix "Missorted modifiers" options and messages
GitOrigin-RevId: ab41b6c1d135c9b788feeec4a273a6f483b9bfa5
2024-08-12 13:37:26 +00:00
Mikhail Pyltsin
cb37003541 [java-inspections] IDEA-357323 Propose case null during adding all cases
GitOrigin-RevId: 6d7ffccc28d64ed0f52db0235c41796d1d81284e
2024-08-09 11:00:42 +00:00
Bas Leijdekkers
91cff4a4f1 Java: inspection for migration to Markdown documentation comments (IDEA-357191)
GitOrigin-RevId: 94d6c21d713073df58e2f6fb2bbd348a7039b9ce
2024-08-08 20:19:46 +00:00
Bas Leijdekkers
488e4a01bf Java: grammar
GitOrigin-RevId: 2fa00e04420bd0fb6a4826ccf35570c5ae017126
2024-08-08 20:19:46 +00:00
Tagir Valeev
3521c7ac6c [java-inspections] EqualsWithItselfInspection: fix description (IDEA-355789)
GitOrigin-RevId: ce48c8a535717b2b433078f43909b2f28084d360
2024-07-26 11:03:19 +00:00
Mikhail Pyltsin
0b30038602 [java-highlighting] IDEA-356470 Support jep 455. Generate true and false cases for boolean selector
GitOrigin-RevId: fbd879f172639f3db1b0d9c12f98fcb3868fa1a9
2024-07-18 20:11:33 +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
a90638139a [java-inspections] IDEA-355789 'equals()' called on itself: disable for comparator contract test
GitOrigin-RevId: e378fb4b0a2e76698f09c911bc2cce75abead793
2024-07-02 16:37:40 +00:00
Mikhail Pyltsin
09c7c9e6e8 IJPF-CR-23473 [java-generation] IDEA-344399 generate annotation based on type_use option
-fix wording

GitOrigin-RevId: d29bb07acb1c739a3fc5d7563b89b6c52d5bfec2
2024-06-21 18:07:32 +00:00
Mikhail Pyltsin
2023228d8c [java-generation] IDEA-344399 generate annotation based on type_use option
- extracted new option
- reuse this option in MissortedModifiersInspection
- override uses this option too

GitOrigin-RevId: 39f3f72991240753c86c7f80df865728aa9743ad
2024-06-17 21:14:57 +00:00
Mikhail Pyltsin
7e047434f3 IJ-CR-130369 [java-inspections] IDEA-197280 Non-constant string concatenation as argument" could also be triggered for String.format
- change description

GitOrigin-RevId: 0924d1165a47e2d40f3b245adfdc8252f2768f25
2024-05-24 21:18:23 +00:00
Tagir Valeev
5cc297d7ea [java-inspections] IDEA-353938 Report ignored object allocations inside method references
GitOrigin-RevId: 1261b9bdb64bec0269fe7d0ffb2ac634e1494e81
2024-05-23 11:08:49 +00:00
Tagir Valeev
f6abeeb22f [java-inspections] Rename 'if' statement with identical branches inspection to avoid confusion
GitOrigin-RevId: 9bb40bf9b593744130c17c5b0cc14d7c67740729
2024-05-13 13:49:05 +00:00
Bas Leijdekkers
cfbb00fa01 java: improve some inspection texts
GitOrigin-RevId: 5a0670e84850599d8107f206b76eee1f8f84de17
2024-04-25 13:49:54 +00:00
Mikhail Pyltsin
0e4caec126 [java-inspections] IDEA-337706 Support conversion System.out to log calls
- fix quick-fix message

GitOrigin-RevId: 0e81b3efffaa4af7fb739b72ee232ea68665a40e
2024-04-14 18:41:14 +00:00
Mikhail Pyltsin
d8f8800d93 IJ-CR-131028 [java-inspection] IDEA-310469 Java inspection for "Pattern variable can be used" does not find all cases
- rename option

GitOrigin-RevId: 26dc0cfa17c438aa8e41fcc9d52d764573814021
2024-04-14 18:28:41 +00:00
Bas Leijdekkers
0b1872f794 java: report string.toCharArray().length -> string.length() (IDEA-351174)
for "Redundant 'String' operation" inspection

GitOrigin-RevId: 96c3b5d310b9639c74241f48348257bbb83dbe93
2024-04-11 09:52:00 +00:00
Mikhail Pyltsin
00351758c5 [java-inspection] IDEA-310469 Java inspection for "Pattern variable can be used" does not find all cases
- support more cases

GitOrigin-RevId: 28301b79d4c4acd343a35474d1ab44096dcea8cd
2024-04-09 15:49:16 +00:00
Bas Leijdekkers
bcbd01ca20 [java] ignore non-serializable fields in enums (IDEA-274137)
GitOrigin-RevId: 2268d012377931be155463a846f7a257208d7e1d
2024-04-08 09:55:33 +00:00
Mikhail Pyltsin
77cac2bb83 [java-inspections] IDEA-337706 Support conversion System.out to log calls
- quickfix for SystemOutErrInspection and ThrowablePrintedToSystemOutInspection
- StringConcatenationArgumentToLogCallInspection now uses String.valueOf for one argument (exception type)
- SystemOutErrInspection has info level
- ConvertSystemOutToLogCallFix doesn't highlight ThrowablePrintedToSystemOutInspection's problems

GitOrigin-RevId: f611e6ccb0e15e5b806ed776b88b12b097d3bb5d
2024-04-03 11:41:32 +00:00
Mikhail Pyltsin
a750ec4eb0 [java-inspections] IDEA-197280 Non-constant string concatenation as argument" could also be triggered for String.format
- Support simple cases for String.format
- Support simple cases for MessageFormat.format

GitOrigin-RevId: 50f52f526923950e30746691414bb89ce5fca5ab
2024-03-29 18:34:16 +00:00
Bas Leijdekkers
4352c5247a [java] add option to ignore single argument substring() calls (IDEA-345335)
GitOrigin-RevId: 967ada74b5354561b8a32f00484f21bae2d05d51
2024-03-21 11:05:13 +00:00