Commit Graph

244 Commits

Author SHA1 Message Date
Bart van Helvert
362bcc4561 [java] Regenerate API lists with Java 23
The newly regenerated list is merged with the previous API list. The newly generated list uses an updated version of the generator that correctly writes canonical names for Java versions higher than 19. #IDEA-357683 Fixed

GitOrigin-RevId: 81c62964385d1daaeaf3e84306ebfbc5c77ad90a
2024-09-04 23:47:59 +00:00
Mikhail Pyltsin
b7d3abc522 [uast-inspections] IDEA-357019 Inspection warning 'Number of placeholders do not match number of arguments in logging call' not reported when logger not initialized inline
GitOrigin-RevId: e601f8f8c94233af84856b7be2626f71b57325eb
2024-08-15 12:29:18 +00:00
Mikhail Pyltsin
b88d49eb4c IJPF-CR-21702 [java-inspection] IDEA-337700 Improvements for logging inspections
- fix text

GitOrigin-RevId: 18aaedbc0531f144ee819d22047d33a925ee9357
2024-07-03 12:12:46 +00:00
Bart van Helvert
b291e01c7a [jvm] Enable Assert between inconvertible types inspection by default
Enable the inspection by default but disable AssertJ support because it has too many problems. #IDEA-348567

GitOrigin-RevId: 3dea62277fb224cdc5474e39b28cb4eb94aa8c3c
2024-06-29 00:21:55 +00:00
Mikhail Pyltsin
71cab9b683 [uast-inspections] IDEA-354390 Support structured logging for SLF4J
- don't highlight if last arguments are structured arguments

GitOrigin-RevId: fb0bf20ff547df4e41c5c6a50e89afe29d149f48
2024-06-04 20:10:51 +00:00
Mikhail Pyltsin
6e7179de29 [uast-inspection] IDEA-349978 Inspection "Non-safe string is passed to safe method" loses track of String after IF
- process all branches if it is impossible to predict

GitOrigin-RevId: a3b0ada8753fb00c98eb02de14fc02e9fc15452c
2024-04-03 20:02:49 +00:00
Mikhail Pyltsin
719bb1619c [uast-inspection] IJ-CR-130570 IDEA-350483 New inspection LoggingGuardedByConditionInspection also deletes comments
- uast comment tracker

GitOrigin-RevId: d484939094c50bd5b7304d9703052f9841679c46
2024-04-03 20:02:45 +00:00
Mikhail Pyltsin
e84bc31482 [uast-inspection] IDEA-350483 New inspection LoggingGuardedByConditionInspection also deletes comments
- support comments

GitOrigin-RevId: b5add2dcbe56eaca7d8c90319734bacda3e68923
2024-04-03 11:41:20 +00:00
Mikhail Pyltsin
59f94d7232 [java-inspection] IJ-CR-128589 IDEA-349655 Improvements for logging inspections. new LogStatementNotGuardedByLogCondition
- delete custom settings

GitOrigin-RevId: dc3625006922b3db74c6f478a3b1ac8bf5e5ddad
2024-03-22 14:28:29 +00:00
Bart van Helvert
f896419d92 [jvm] Split JUnit usage provider per framework
Will allow for disabling them individually. #IDEA-346510 Fixed

GitOrigin-RevId: 7b879111b92f38a7a55166d67d657520c6d9314d
2024-03-12 01:13:37 +00:00
Mikhail Pyltsin
d4b2f1f75d [java-inspection] IDEA-337700 Improvements for logging inspections
- new inspection LoggingGuardedByConditionInspection

GitOrigin-RevId: 4dc52a70105fb7bdbbf3d6ddbed5db2e6640fd0d
2024-03-08 21:31:58 +00:00
Mikhail Pyltsin
5f382bc662 [java-inspection] IDEA-337700 Improvements for logging inspections
- new LogStatementNotGuardedByLogConditionInspection

GitOrigin-RevId: e5cb767b24b33cb450597551dbbf4ece153a81e2
2024-03-07 12:05:26 +00:00
Mikhail Pyltsin
3aee4d1ab9 [uast-inspection] IJ-CR-127603 IDEA-347890 Similar logs inspection. Skip warning if they are in the same codeblock
- add case with one similar message

GitOrigin-RevId: 79c23c016c857949b91ca3cbaaf9b63e5c8243fd
2024-03-04 11:42:56 +00:00
Mikhail Pyltsin
1da47e479f [uast-inspection] IDEA-347890 Similar logs inspection. Skip warning if they are in the same codeblock
GitOrigin-RevId: 7b481eebc5196909c648b46051bfeb46feab6d59
2024-02-29 19:21:24 +00:00
Tagir Valeev
0ceb02ac9a [jvm-inspections] Move Java test data for EmptyMethodInspection to JVM module; suppression top-level test
GitOrigin-RevId: 645e9ea69d7d2c81d65bfe73d6e74dc30c4e22e6
2024-01-30 11:13:43 +00:00
Tagir Valeev
0385834f13 [jvm-inspections] Fix EmptyMethod compatibility with Kotlin
1. Fix suppression handling for Kotlin in global inspections
2. Fix RefMethodImpl#hasBody for top-level Kotlin functions
3. Move to JVM module
4. Add Kotlin tests
Fixes IDEA-330737 @file:Suppress("EmptyMethod") does not work

GitOrigin-RevId: 83f383e06754f510b6a99e35751263017734bb26
2024-01-29 19:42:30 +00:00
Mikhail Pyltsin
9408f6ef14 [java-inspections] IDEA-343899 Similar logs inspection
- strict rules for exceptions and additional info

GitOrigin-RevId: 6ca5ca3c64660ed14b3dbc8d9a48ca4c588615a0
2024-01-24 12:12:57 +00:00
Mikhail Pyltsin
23f1773740 [uast-inspection] IDEA-343298 LoggingSimilarMessageInspection should skip empty messages
- skip messages without certain beginnings and ends

GitOrigin-RevId: eb9ef8be4c8629712a0915a539fc7e9dac4c1238
2024-01-17 22:12:41 +00:00
Mikhail Pyltsin
dcc38e5eb7 [uast-inspection] IDEA-331308 Create inspection highlighting non-distinguishable logging sites in a single class
- skip error log levels with stacktrace

GitOrigin-RevId: 5662e1f1a5e43fdb371d6597693c0ab875040204
2024-01-17 13:46:03 +00:00
Mikhail Pyltsin
1f6272bff4 [java-inspections] IJ-CR-123360 IDEA-331308 Similar logs inspection
- extract some methods

GitOrigin-RevId: b73b6dc6ec6e3424ec31b7f869e47daa9cba429a
2024-01-12 20:45:59 +00:00
Mikhail Pyltsin
6959a361c2 [java-inspections] IJ-CR-123360 IDEA-331308 Similar logs inspection
- added several tests
- fixes after code review
- IDEA log supports

GitOrigin-RevId: de60fa8083b8883c98ba73b0c9741e51dbcb491a
2024-01-10 13:49:46 +00:00
Mikhail Pyltsin
cb7187787c [uast-inspections] IDEA-134025 Quickfix for "Log condition does not match logging call"
GitOrigin-RevId: 9bf9f012525aab45167daf84dd13ebd0a8c135fa
2024-01-08 20:13:25 +00:00
Mikhail Pyltsin
8efd59f2ec [java-inspections] IDEA-331308 Similar logs inspection
GitOrigin-RevId: 33b43026b651dfee14eaa91e978c0c0c2b793ba2
2024-01-08 11:12:08 +00:00
Bart van Helvert
3a5d36c5f7 [jvm] Add test case for Java API usage inspection
Adds another test case for when a method has a certain since version but its super method has a lower since version.

GitOrigin-RevId: 5962a0f2d4549b6729fe7c303798bc04b575e5c5
2024-01-05 20:01:46 +00:00
Bart van Helvert
e43e1dd876 [jvm] Clean up SuppressionAnnotationInspection
Improves inspection message and code structure. #IDEA-337709

GitOrigin-RevId: cc1fd2482724ea235a301b770abbcc02d1fcf6cc
2023-12-14 14:04:06 +00:00
Bart van Helvert
316a5db6c8 [jvm] Remove unnecessary extension point for annotation suppressions
The extension point was used to run logic for various suppression annotations. Instead of running different logic based on the language, we can run the same logic for all languages. #IDEA-337709

GitOrigin-RevId: 7c51e3774d8d0c5232d37b817d1086ba4ebdda57
2023-12-14 14:04:06 +00:00
Bart van Helvert
58298dd53c [jvm] Move JUnit inspections into JUnit plugin
#IDEA-334017 Fixed

GitOrigin-RevId: 919fb236aeb44c192944eae2bae8da621e5a0e74
2023-12-13 03:15:25 +00:00
Aleksey Dobrynin
ff17b6dabf [java, inspection, fix] IDEA-338231
- Rename an inspection class
- Add a code example in the documentation
- Support RunWith in interfaces
- Visit classes instead of annotations

GitOrigin-RevId: 2cbbe679fc77e81838cae02a6f4f4242a0e028d5
2023-12-01 11:54:54 +00:00
Karol Lewandowski
ad246cb491 IDEA-337709: Reimplement SuppressionAnnotationInspection to UAST
GitOrigin-RevId: 5384975e4786fbc34114065e117f66d930435621
2023-11-27 18:29:28 +00:00
Aleksey Dobrynin
52eece9283 [java, inspection] Detect inherited @RunWith annotation in JUnit 4 (IDEA-338231)
GitOrigin-RevId: a1b03ddd5904957286576b281aa97c6947c261e8
2023-11-23 12:15:32 +00:00
Bart van Helvert
d78141974f [jvm] Support go to related symbol for method source
#IDEA-325969 Fixed

GitOrigin-RevId: 7ae47a6e558b484cf397c7192abf66dc6eebdf22
2023-11-07 20:10:45 +00:00
Georgii Ustinov
26f97f459b [JUnit] Restrict the visibility of test classes and methods after migrating JUnit4 -> JUnit5
Improve 'Migrate to JUnit 5' action ^IDEA-237072 fixed

GitOrigin-RevId: 6bd0f4ccad30aad91b52a02b065c650cd27e4d02
2023-11-01 09:29:33 +00:00
Georgii Ustinov
6233b72cb6 [jvm] Fix false-positive UrlHashCodeInspection
Previously, this inspection highlighted the cases like `url.equals(null)` or `url == null`. This commit fixes this behavior

^IDEA-332645 fixed

GitOrigin-RevId: 7448489db08e5bbf75dfc1582788bc1f78f923f2
2023-10-26 15:23:03 +00:00
Mikhail Pyltsin
de1dca93d3 [uast-inspections] IDEA-335116 - Non-safe string, support qualifier cleaners
GitOrigin-RevId: 5bd6b1c53c32e096a7a20e7cdd23b2e39bc19fea
2023-10-17 15:20:05 +00:00
Mikhail Pyltsin
e7c4d58f83 [uast-inspections] IDEA-334967 Non-safe string: always true/false condition in taint inference in other methods
- support if in other methods

GitOrigin-RevId: 1012172402ed8ea0961b1ef552cdfb2f37a7d49e
2023-10-17 12:25:09 +00:00
Mikhail Pyltsin
0e4c75ac6d [uast-inspections] IDEA-334946 Non-safe string: always true/false condition in taint inference for ternary operators
- support ternary

GitOrigin-RevId: 3d9081be20e5e9ff1546098fc0c84b942c77b53f
2023-10-17 11:54:55 +00:00
Bart van Helvert
ba513a4d88 [jvm] Rename shared.testFramework to internal.TestFramework
To better highlight that this test framework is for internal usage only. #IDEA-334017

GitOrigin-RevId: c491de2411cdffd6eee3e97a6273982560572f4b
2023-10-11 23:39:50 +00:00
Bart van Helvert
4845f7164a [jvm] Migrate JVM inspection tests to JDK 21 language and SDK
GitOrigin-RevId: 477fad876b95025bb48419f2510d597da6dbc9bd
2023-10-06 21:56:09 +00:00
Bart van Helvert
79bce8459f [jvm] Split test framework into testBase and testFramework
Test bases should only be used in test from jvm-analysis module, the test framework can be shared in multiple modules.

GitOrigin-RevId: cbe47d864eb2c1f3f89189022d76333ed3fe3601
2023-10-06 15:10:52 +00:00
Bart van Helvert
212683a78c [jvm] Disable assertions between inconvertible types on throwables
#IDEA-331109

GitOrigin-RevId: b7f9a705ae3cce08880316d7d7a2ff0a92668bf9
2023-10-03 12:14:41 +00:00
Bart van Helvert
2c7dcce36f [jvm] Support AssertJ first in type checker
#IDEA-331109 Fixed

GitOrigin-RevId: b4b81e030b804714b32979954ac8779b29dc52c9
2023-10-03 12:14:40 +00:00
Mikhail Pyltsin
b4c698f763 [uast-inspections] IDEA-333480 support setMessage for slf4j fluent api
GitOrigin-RevId: 404bff9bebe88169f44588e209fb3eeba09eaab5
2023-10-02 10:48:06 +00:00
Mikhail Pyltsin
46d30a46d9 [uast-inspection] IDEA-333003 support fluent api for slf4j
- now `addArgument` is taken into account and complex cases are skipped

GitOrigin-RevId: acbdd50da7199f24938f76d3a84d0d17857b261e
2023-09-29 11:45:33 +00:00
Georgii Ustinov
883f800574 [Code Analysis. Inspection] IDEA-234302 System.getProperty(str) inspection implementation. Review Refactor
GitOrigin-RevId: e793b2306586a3ea6e12691b5d887fe1cf0b2913
2023-09-22 13:59:38 +00:00
Georgii Ustinov
0382910261 [Code Analysis. Inspection] IDEA-234302 System.getProperty(str) inspection implementation.
Call to System.getProperty(str) could be simplified for certain predefined constants. Implementation includes inspection and quickfix.

GitOrigin-RevId: 8b7edf6c4a6849062535ded1c49e733b8fed05a8
2023-09-21 19:51:28 +00:00
Mikhail Pyltsin
403f28bc16 [uast-inspections] IDEA-332774 Non-safe string: always true/false condition in taint inference
-support simple cases in if condition

GitOrigin-RevId: 93071f1a55fbf9e5a0d7f0798497e43781ed44ec
2023-09-21 16:22:39 +00:00
Mikhail Pyltsin
5c632ee060 [uast-inspections] Non-safe string: configuration for method with context awareness
GitOrigin-RevId: 108a4e8f5beaa951dbe1be64c578d39b7a82163b
2023-09-20 18:30:13 +00:00
Bart van Helvert
cc61bc25c7 [jvm] Convert TestCaseWithNoTestMethods inspection to JVM
#IDEA-331938 Fixed

GitOrigin-RevId: 9ecdc3d6e03d52cb54865067483b4c97e29d3236
2023-09-10 16:39:57 +00:00
Mikhail Pyltsin
b389c297de [uast-inspections] IDEA-331248 Non-safe string: allow static inter-analysis for taint inference
- support if statements during analysis

GitOrigin-RevId: cebd7172ef8964bf557c15662e4b48acb7f48fb0
2023-09-04 19:02:12 +00:00
Mikhail Pyltsin
ee4b8fa0ef [uast-inspections] IDEA-331248 Non-safe string: allow static inter-analysis for taint inference
- added new inner option to check static methods
- configurations for methods and fields are separated
- clarify some comments

GitOrigin-RevId: 9a4287b3b5045d43c88f8d2fb515056fecbc3768
2023-09-01 17:38:36 +00:00