Commit Graph

239 Commits

Author SHA1 Message Date
Andrey Cherkasov
866636446f [java-inspections] DuplicateBranchesInSwitch: rename methods
IJ-CR-101312

GitOrigin-RevId: 6257fb98a9e9c5263925ad3b218458a4ec3d2abd
2023-01-23 10:51:01 +00:00
Vladimir Krivosheev
22ed029896 add explicit dependency on intellij.platform.util.text.matching
GitOrigin-RevId: c2586851a21d0d33af2ed00f1bc3d3c07aff56a3
2023-01-20 12:43:44 +00:00
Nikolay Chashnikov
c17297cce7 cleanup: remove redundant '@author' tags from javadoc comments - 23
Now we have Code Vision hints which determine the author via Git history and show it in the editor automatically, and this information is more accurate than the tags which were automatically added when files were created.

GitOrigin-RevId: 4623bf3b267b86b3190f505ac249aa2f461c54dd
2023-01-18 17:02:40 +00:00
Nikolay Chashnikov
c1f2c8a692 cleanup: remove redundant '@author' tags from javadoc comments - 9
Now we have Code Vision hints which determine the author via Git history and show it in the editor automatically, and this information is more accurate than the tags which were automatically added when files were created.

GitOrigin-RevId: fcf3f973d7c945698016443c015023e73ac71572
2023-01-18 17:01:54 +00:00
Nikolay Chashnikov
1487a324c4 cleanup: remove redundant '@author' tags from javadoc comments - 7
Now we have Code Vision hints which determine the author via Git history and show it in the editor automatically, and this information is more accurate than the tags which were automatically added when files were created.

GitOrigin-RevId: f2a6ec37a89b7497556ced0b92be3fa7679ba304
2023-01-18 17:01:47 +00:00
Nikolay Chashnikov
98b622aa27 cleanup: remove redundant '@author' tags from javadoc comments - 5
Now we have Code Vision hints which determine the author via Git history and show it in the editor automatically, and this information is more accurate than the tags which were automatically added when files were created.

GitOrigin-RevId: e1f798814ca7f22747768b99cbcd962d820bbfb9
2023-01-18 17:01:41 +00:00
Tagir Valeev
56013717c5 [inspections] Rename OptSet -> OptStringList; stringSet -> stringList
This reflects that we usually preserve ordering and in fact map to the List<String>

GitOrigin-RevId: f44eb3efae5db372dfb1747d86b728a23ec5745b
2023-01-17 15:37:26 +00:00
Tagir Valeev
5cef9a17e6 [java-psi] IDEA-310203 Support type inference changes in Java 20
GitOrigin-RevId: 6a2699b68b1babf14683df9939033cd394f87a8d
2023-01-17 09:26:59 +00:00
Andrey Cherkasov
e008c6522f [java-inspections] DuplicateBranchesInSwitch: adapt the inspection to Java 20
IDEA-310260

GitOrigin-RevId: ce07977550e3a5c15d63f0a6eeed1d7341c74164
2023-01-15 05:39:32 +00:00
Mikhail Pyltsin
77169c0637 [java-inspections] PatternVariableCanBeUsedInspection.java. fix conflicting declared names. Fix review
GitOrigin-RevId: 596be91dc3088186c0725abc43ae0a924f2410c1
2023-01-13 23:23:50 +00:00
Mikhail Pyltsin
1cfeee043f [java-inspections] PatternVariableCanBeUsedInspection.java. fix conflicting declared names. Fix review
GitOrigin-RevId: a6a52b7a12b93a09c0bcae23876ac2cb4ef03c70
2023-01-13 18:24:50 +00:00
Mikhail Pyltsin
4f0e73e4ff [java-inspections] PatternVariableCanBeUsedInspection.java. fix conflicting declared names
GitOrigin-RevId: 8761a1dafe52a7fcf0ab8b2fbc55c60896447acf
2023-01-13 09:57:28 +00:00
Roman Ivanov
e358fee5c7 handle new nullability for parameter in PsiForeachStatement
GitOrigin-RevId: c05b8dbf03aff191ba4922a93d5efd9169facc37
2023-01-12 14:45:19 +00:00
Mikhail Pyltsin
5d52119cc6 [java-inspections] IDEA-274033: Inspection to convert instanceof pattern to old school instanceof. add tests
GitOrigin-RevId: 393b56ff099abd3a02ffceb425309d1bbad51bdc
2023-01-11 15:34:29 +00:00
Mikhail Pyltsin
57d63e9c7a [java-inspections] IDEA-274033: Inspection to convert instanceof pattern to old school instanceof. changes fo PR
GitOrigin-RevId: e167e494301aed607ca1fb03997a55a749f94373
2023-01-10 10:17:52 +00:00
Bas Leijdekkers
1a3fa9f4f8 Java: clarify quick-fix text when collapsing to noneMatch() (IDEA-309845)
GitOrigin-RevId: 0890d9367b880820af1125b0cb292916b29c238c
2023-01-09 20:19:46 +00:00
Mikhail Pyltsin
06eeef3504 [java-inspections] IDEA-274033: Inspection to convert instanceof pattern to old school instanceof. Reformat code
GitOrigin-RevId: 7e294db373099dfc77a14abfb9cba45c2250ceac
2023-01-09 15:58:29 +00:00
Mikhail Pyltsin
5e6dcfa9da [java-inspections] IDEA-274033: Inspection to convert instanceof pattern to old school instanceof. changes fo PR
GitOrigin-RevId: fbde4d5b613dc057882427988266ba3c201ac4e7
2023-01-09 15:58:26 +00:00
Mikhail Pyltsin
13d1e8f0f7 [java-inspections] IDEA-274033: Inspection to convert instanceof pattern to old school instanceof
GitOrigin-RevId: 34ab7eece46fa98ef883581fa117eaa2f8e3a6d1
2023-01-06 13:15:40 +00:00
Bas Leijdekkers
464f0a4cfe Java: make quick fix respect "Make generated local variables final" setting
for "Pattern variable can be used" inspection

GitOrigin-RevId: 7ca41a5435635f951b10f513def9fa605e8274a3
2022-12-29 11:11:30 +00:00
Alexey Kudravtsev
0bd5ed5449 fix "immutable collection modified" warnings
GitOrigin-RevId: ec49a122b92288db0588ca66f6c535337f65360f
2022-12-28 13:57:23 +00:00
Tagir Valeev
6b12fe657e [java-inspections] Use OptPane instead of class selector list
GitOrigin-RevId: da749fbf570b6ad4ca66adcee56d9ab58f3994ce
2022-12-28 12:35:53 +00:00
Tagir Valeev
ce032b58f0 [java-inspections] UnusedDeclarationInspection: OptPane used; refactoring
All extra buttons -> JavaInspectionButtons
Controls -> JavaInspectionControls
VisibilityModifierChooser removed

GitOrigin-RevId: 428052e5ef6c86c941f64eb7731c692674a6d394
2022-12-24 17:19:43 +00:00
Bas Leijdekkers
86f0b63857 Java: better quick fix texts for "Loop can be collapsed with Stream API" and "Simplifiable forEach() call" inspections
GitOrigin-RevId: c4db6507c258e5611f6d47b9373a0c2531802345
2022-12-23 13:26:29 +00:00
Tagir Valeev
bc8642a881 Avoid always-true warning due to wrong inference
GitOrigin-RevId: 9c999c5a7ff33dd673fba948aa3d4383a38ea61d
2022-12-21 09:22:42 +00:00
Tagir Valeev
d0ef7fb19e [inspections] OptCustom: rework now rendered with separate extensions; example with configureAnnotationsButton
I still hesitate to store custom object inside OptCustom, as this would prevent it from being easily serializable and transferable to frontends. We assume that the whole information necessary to render a specific custom control is serialized into the additional 'data' string. We'll see how it works.

GitOrigin-RevId: 50c35ad0640ba4975a9adeae21a434f2c1bc0fd2
2022-12-18 13:58:49 +00:00
Tagir Valeev
5fd18caf28 [inspections] OptCustom: component instead of control
GitOrigin-RevId: 4f2069235d26053bd0dbfc10be33e4588088829d
2022-12-18 13:58:47 +00:00
Roman Golyshev
91c6dfbf44 [java] IDEA-308360 Move collecting myAllRenames map to doRun in ConvertToRecordProcessor
`prepareRename` have to be called from EDT, and `findUsages` is called from a read action
in a background thread, so we need to call `prepareRename` before `findUsages`

GitOrigin-RevId: 84f3f4dac5d07d4e33566fd6225a6b295d733d6e
2022-12-16 13:58:20 +00:00
Tagir Valeev
107319beb3 [inspections] Use OptPane for visibility chooser
GitOrigin-RevId: e68fa50b37e27382a1dc75dbaacf8bb1bdd46c76
2022-12-15 12:43:30 +00:00
Pyltsin Mikhail
00c9b37cc8 [Java. Inspections] IDEA-277232 - improved processing comments for switch expressions
closes #2244

GitOrigin-RevId: d871a8dd8a645f30fa02ba0ec6baffd5d9c6b926
2022-12-14 00:11:11 +00:00
Tagir Valeev
7c45b3d106 [java-dfa] IDEA-307955 "Constant values" should only warn on the outer most constant expression
GitOrigin-RevId: 6ca85640d4d20ca72b7262a7a8f1733ee60ffa07
2022-12-13 18:58:48 +00:00
Mikhail Pyltsin
c511c7bc1d [Java.Inspections] IDEA-265306 Added support endless loops without initializations
GitOrigin-RevId: 2f225fc4cc406169c8bcfba8511f87ec98cb2ec1
2022-12-13 16:13:59 +00:00
Mikhail Pyltsin
9f7504dfb3 [Java.Inspections] IDEA-265306 Added support endless loops without initializations
GitOrigin-RevId: 4267bb0f026956259fed41f510ced6b20f12176e
2022-12-13 12:56:23 +00:00
Tagir Valeev
cd82cab9af Semi-automatically convert some inspections to getOptionsPane()
GitOrigin-RevId: 278738b94a3c275ce6c4d739aab5abcd99f3ba94
2022-12-10 17:06:46 +00:00
Tagir Valeev
394fd38cb5 [inspections] Automatically convert createOptionsPanel() to getOptionsPane() in simple cases
GitOrigin-RevId: 8377376db858deac58eead81e92b286c1b099e10
2022-12-10 17:06:42 +00:00
Louis Vignier
fb04b61677 [codeInspection.ui] Update inspection options using growing components
- tables need to use `InspectionOptionsPanel#addGrowing` to grow vertically when there is space available
- some components don't need to use `#addGrowingX` because they are correctly sized (eg. checkboxes)

GitOrigin-RevId: c30c8d0f683e9f4fe4409b4583808db6c01ff21f
2022-12-10 06:27:26 +00:00
Louis Vignier
9ff5c10364 [codeInspection.ui] Get rid of MigLayout in InspectionOptionsPanel
#IDEA-307785 Fixed

GitOrigin-RevId: e6c351ee8262b937579d129afe84f845600d22dc
2022-12-10 06:27:22 +00:00
Andrey Cherkasov
5c56764915 [java-inspections] SameReturnValue: make it local for methods that cannot be overridden and has no super-methods and...
make it capable to process methods returning condition expressions

IDEA-306529

GitOrigin-RevId: d9e0c0cd5e555ab3f8688832358e97133218c3dc
2022-12-07 16:47:19 +00:00
Andrey Cherkasov
386f046723 Use pattern instanceof
GitOrigin-RevId: b75b48d4765ffcc0ba8688acb9045686972c33b2
2022-12-07 16:47:15 +00:00
Tagir Valeev
e0f8104e43 [java-dfa] IDEA-307660 Avoid double reporting between "Constant values" and "Pointless boolean expression"
GitOrigin-RevId: 97cf073bd5bcd69b8903e5cf2e915fb2a4261b6b
2022-12-05 18:07:45 +00:00
Tagir Valeev
c4fee89a6e [java-dfa] IDEA-307630 Constant values: remove warning at the beginning of |= and &= series
GitOrigin-RevId: 3841398346bfc13b26cd6bed05e51e762e2f78e1
2022-12-05 15:06:26 +00:00
Tagir Valeev
397bc7edd5 Warnings fixed
GitOrigin-RevId: 6423235e560dbf2fafaa6e4439514bcc82cac761
2022-12-02 10:26:09 +00:00
Tagir Valeev
ea6d5eb5fd [java-dfa] ConstantValueInspection: use patterns, cosmetic
GitOrigin-RevId: 4b14029321a38cdf7bbe9dd2448d4703efdbe44e
2022-12-02 10:26:06 +00:00
Tagir Valeev
15b23c536a Fix constant value and some other warnings
GitOrigin-RevId: 8c9ffeab46602a73270451ae97bd25a47a2076e4
2022-12-01 17:34:54 +00:00
Tagir Valeev
456195648b [code-inspections] InspectionOptionPaneRenderer: custom control API reworked; used in DataFlowInspection
GitOrigin-RevId: 97a03b45b4981cb54f15f86cfc3b1e6c1c21736e
2022-11-29 19:49:59 +00:00
Tagir Valeev
4324ae9924 [code-inspections] Declarative inspection options preliminary (IDEA-306800)
API, docs, draft renderer (checkboxes only)

GitOrigin-RevId: a2a5f9a1d1584187ce5b3bad6e4e8683864db06e
2022-11-28 15:52:38 +00:00
Louis Vignier
91ede07714 [intention-preview] Add a text preview for GenerateEqualsHashcodeFix
GitOrigin-RevId: e4d61967d0364c62795d503ca5746dad1c85ad51
2022-11-20 16:10:45 +00:00
Andrey Cherkasov
ab8a61af0b [java-inspections] DuplicateBranchesInSwitch: don't warn if branches cannot be merged
IDEA-305716

GitOrigin-RevId: fb1dc16f1a24ccf8b6fd7a71a6e002b8067bd7d1
2022-11-16 15:02:47 +00:00
Alexey Kudravtsev
d07064d5ad notnull
GitOrigin-RevId: 20fbcd543411315944724e75220e3f25d4109512
2022-11-03 16:45:15 +00:00
Tagir Valeev
98a4b2d977 [java-inspections] ToArrayTerminal: allow reusing a target collection in another branch only when return is on the same level
Fixes IDEA-304740 FuseStreamOperationsInspection fix produces red code

GitOrigin-RevId: b9a169e54bae1de448194b8debb39f79904ceb90
2022-10-28 18:21:22 +00:00