Commit Graph

985 Commits

Author SHA1 Message Date
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
Bart van Helvert
4fb30b4e18 [jvm] Disable Assert between inconvertible types by default
#IDEA-348567

GitOrigin-RevId: 55bcf9ffba0c7d29e8831b84e21e44290cd51f0e
2024-06-27 15:51:48 +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
941b59cc1a [uast-inspections] KTIJ-29797 support escape symbols when string literal is created
- separate tests

GitOrigin-RevId: b7e3b6131d5de50e0150abd0e41c0c8febed9438
2024-05-23 10:53:10 +00:00
Mikhail Pyltsin
14098259dc [uast-inspection] IDEA-352839 introduce an option to check if calls contain only exception as an argument
- improve description a bit

GitOrigin-RevId: 72ee4dfb4bc56b0b9254bfbe61c82cbee5f71568
2024-05-23 10:10:00 +00:00
Mikhail Pyltsin
f2c420a40b [uast-inspection] IDEA-352839 introduce an option to check if calls contain only exception as an argument
GitOrigin-RevId: 8e44bb25369e0c6f936e9aa9a14ea4ddbb348c26
2024-05-22 19:34:42 +00:00
Mikhail Pyltsin
22fac7715b [uast-inspections] KTIJ-29797 support escape symbols when string literal is created
GitOrigin-RevId: a1dc2cf91d81991fac6442e57b2e5b65addeb987
2024-05-22 01:09:46 +00:00
Georgii Ustinov
3a961fdccd [Java. Refactorings] Extract common base for test methods
IDEA-351758

GitOrigin-RevId: 3732c0bac541df2ae4d9a8fc103b0b9b625ed30d
2024-05-03 14:51:35 +00:00
Georgii Ustinov
647431bb3d [Java. Logging] Fix error for builder-like loggers when argument method has no parameters
IDEA-342484

GitOrigin-RevId: 150bf9b811983b87041c8c384ca5088334872186
2024-04-30 02:32:05 +00:00
Georgii Ustinov
ef0255c10d [Java. Logging] Add javadoc for some methods LoggingArgumentSymbolReferenceProvider.kt and rename DefUsage to PsiElementUsage
IDEA-342484

GitOrigin-RevId: e40968673369c6b796f4a71dce087561bc7aad95
2024-04-29 15:27:06 +00:00
Georgii Ustinov
508892773d [Java. Logging] Refactor LoggingPlaceholderUtil
IDEA-342484

GitOrigin-RevId: b127b5028c732175b62f86ec968555dd493fdbb3
2024-04-29 15:27:01 +00:00
Georgii Ustinov
8b49638252 [Java. Logging] Add tests for consecutive escape symbols for LoggingArgumentSymbolReferenceProvider
IDEA-342484

GitOrigin-RevId: 529dba46a0c31714e8c2a3b59507bf8558265319
2024-04-29 11:18:36 +00:00
Georgii Ustinov
1367dfa422 [Java. Logging] Add better way to check if SLF4J log placeholder is located before backslash
IDEA-342484

GitOrigin-RevId: 2e1646050dfcec175d282d4ccadb3b20bbe8da0e
2024-04-29 11:18:32 +00:00
Georgii Ustinov
0e73acf094 [Java. Logging] Restore support for escape symbols in LoggingArgumentSymbolReferenceProvider
IDEA-342484

GitOrigin-RevId: 68d3e58e45554128c59d0a81d4d24ad415b8b812
2024-04-25 13:58:42 +00:00
Georgii Ustinov
c25c1ba670 [Java. Logging] Properly handling with logging placeholders resolve with backslash character
IDEA-342484

GitOrigin-RevId: 70cbc9a537943dd3520282206ef8ddb20f01ad5f
2024-04-22 13:15:03 +00:00
Georgii Ustinov
44598e3b3b [Java. Logging] Move options panel to the jvm analysis bundle
IDEA-342483

GitOrigin-RevId: 1cc4c4fd19ded9c576d6f22945768da412340fbb
2024-04-22 13:15:00 +00:00
Tagir Valeev
098214398a [java-property-tests] SourceToSinkPropertyInspectionTest fixed
Likely, the improvements in inspection were not reflected in test:
1. Later assignment to local variable overwrites the previous tainted state
2. Constant conditions like (1 == 1) are evaluated by inspection, so we need a non-constant one in test

GitOrigin-RevId: 62e373f85011b8302186cdf3b951cb8b056a7603
2024-04-19 17:41:56 +00:00
Alexey Kudravtsev
bea50636b2 notnull, cleanup
GitOrigin-RevId: 04cf8a716196d0c05031edc810a44bb5e1a19e38
2024-04-18 15:28:24 +00:00
Georgii Ustinov
fa429131ac [Java. Logging] Chain transformation methods in LoggingArgumentUsageSearcher#collectSearchRequests
IDEA-342484

GitOrigin-RevId: 011a02fc11b996c664100201a7029e977251bdd8
2024-04-15 11:51:31 +00:00
Georgii Ustinov
4fb2b2230d [Java. Logging] Add tests for placeholder highlighting for java
IDEA-342483

GitOrigin-RevId: 5894b7a35a44d19fbdfb461e3bdb45f07b5581b8
2024-04-10 14:15:19 +00:00
Georgii Ustinov
cb061ed4cf [Java. Logging] Add check if any of validators for formatter logger placeholders are null
IDEA-342483

GitOrigin-RevId: f16fc3f3782e64ef3d8c3a61bf995261cde8452e
2024-04-10 14:15:14 +00:00
Georgii Ustinov
1a2988e233 [Java. Logging] Add tests for placeholder highlighting for kotlin
IDEA-342483

GitOrigin-RevId: 844783d24eaa6adacf29cb3f7e64116c3100d16b
2024-04-10 14:15:08 +00:00
Georgii Ustinov
eeb55944e0 [Java. Logging] Add support for previous placeholder for formatted loggers
IDEA-342483

GitOrigin-RevId: 45174cc38568c42c7d3b42a7605d31f5168d4c31
2024-04-10 14:15:03 +00:00
Georgii Ustinov
2fc989a3bf [Java. Logging] Add trace and arbitrary level to the LoggingTestUtils
IDEA-342483

GitOrigin-RevId: 4b86a5dc9e689b56cbecfc55c4748ac508f017d9
2024-04-10 14:14:58 +00:00
Georgii Ustinov
61cbad1fe9 [Java. Logging] Simplify LoggingArgumentSymbolReferenceProvider#getReferences
IDEA-342484

GitOrigin-RevId: ba2d013c5b74a4dec73f60c3cb22b908ed0ff546
2024-04-10 14:14:53 +00:00
Bart van Helvert
9a45358f1c [jvm] Add mockk support to test method without assertion inspection
#KTIJ-29367 Fixed

GitOrigin-RevId: d000d87fafddf792c552d06fdd0fae359a9ec658
2024-04-09 15:31:36 +00:00
Bart van Helvert
c856f5fe2c [junit] Migrate JUnit reference contributor tests to JVM test
#IDEA-349194 Fixed

GitOrigin-RevId: 70fe2fbaef0e37234d846171338974185f8031cc
2024-04-09 14:27:15 +00:00
Maksim Sasnouski
9e9e546fe0 [junit] IDEA-349194 Add tests for EnumSource go to
closes https://github.com/JetBrains/intellij-community/pull/2710

GitOrigin-RevId: 13034a60972e73fd3986bd68a954ab58100584be
2024-04-09 14:27:11 +00:00
Mikhail Pyltsin
df6d77f795 [uast-inspection] IDEA-350483 IJ-CR-130570 New inspection LoggingGuardedByConditionInspection also deletes comments
- move commenter into UastCodeGenerationPlugin

GitOrigin-RevId: 8c0079fb1e3c0b7f4606bca547e40721c118b9c2
2024-04-09 13:05:17 +00:00
Bart van Helvert
03f636ac44 [kotlin] Add JUnit 5 Kotlin assertions support
Adds support for Kotlin bindings to JUnit 5 assertions #KTIJ-29366

GitOrigin-RevId: 43062c8cda70f91ac1bd58b6a3c27b5fe80086cf
2024-04-09 01:17:54 +00:00
Georgii Ustinov
2350a6602f [Java. Logging] Add visual settings for colorscheme for the placeholders
IDEA-342483

GitOrigin-RevId: ea2357d858baf4f40f8573ab7a41ea7dc47e1632
2024-04-08 12:28:01 +00:00
Georgii Ustinov
bd7855d137 [Java. Logging] Reorder logger method resolving during getting PlaceholderContext
IDEA-342483

GitOrigin-RevId: 3b52acb66e19046264a060410067ac57f941d7f2
2024-04-08 12:27:58 +00:00
Georgii Ustinov
7efc1956d2 [Java. Logging] Implement simple logic for Logging placeholder annotator
IDEA-342483

GitOrigin-RevId: 009a594b4e80011599b846580d89ce4097149b6f
2024-04-08 12:27:54 +00:00
Georgii Ustinov
df9b489f0d [Java. Logging] Represent usage search for the logging argument symbols as collection of queries
IDEA-342484

GitOrigin-RevId: ef33bddec45ca221d9e81ce26209aff115afabda
2024-04-05 15:21:32 +00:00
Georgii Ustinov
0f3b38bc6f [Java. Logging] Add extra tests for multiline strings and interpolation
IDEA-342484

GitOrigin-RevId: 9ec93ffa94d6109978ab3e219900f939427fe1a2
2024-04-05 15:21:26 +00:00
Georgii Ustinov
fee13aa547 [Java. Logging] Add tests for numbered and previous placeholders for logging resolve
IDEA-342484

GitOrigin-RevId: d711077e2cabbff3068df6e442a91b8b8ffcd852
2024-04-05 15:21:21 +00:00
Georgii Ustinov
3c3fbeda83 [Java. Logging] Add support for indexing and previous placeholders for the formatted logger
IDEA-342484

GitOrigin-RevId: 0db515ac740f77f6285e8aca6b78c703c2dff9f7
2024-04-05 15:21:16 +00:00
Georgii Ustinov
698243a1e3 [Java. Logging] Improve placeholder detection for multiline strings
IDEA-342484

GitOrigin-RevId: 9147075f3419b28c52ad465e2a246ec352226fec
2024-04-05 15:21:10 +00:00
Georgii Ustinov
22ea585370 [Java. Logging] Add null check for fetching additional arguments in LoggingPlaceholderUtil.kt
IDEA-342484

GitOrigin-RevId: 18f6bd8b43d011d2cb280bf8eade0c653ef02035
2024-04-05 15:21:05 +00:00
Georgii Ustinov
ba36f6277e [Java. Logging] Encapsulate log4j detection inside LoggingPlaceholderUtil.kt#getPlaceholderContext + remove useless checks in LoggingArgumentSymbolReferenceProvider
IDEA-342484

GitOrigin-RevId: 40eaac869b061e4a6c5c9a1887ea9497ca77374c
2024-04-05 15:20:59 +00:00
Georgii Ustinov
11fbdf5172 [Java. Logging] Update javadoc for LoggingPlaceholderUtil#findAdditionalArguments
IDEA-342484

GitOrigin-RevId: 7db7a50357f8b5fc1caebddfdf52aa36a40ad66e
2024-04-05 15:20:54 +00:00
Georgii Ustinov
ccbc16539c [Java. Logging] Add NotNull annotation for arguments in StringFormatUsageSearcher#getFormatUsages
IDEA-342484

GitOrigin-RevId: 287a20e56e462d7bda871c50001871fd0e9d1f2d
2024-04-05 15:20:49 +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
Georgii Ustinov
8940560c5d [Java. Logging] Refactor LoggingArgumentSymbolReferenceProvider
IDEA-342484

GitOrigin-RevId: 979e333aa1dd99b27e3d2851d184717ce640ba47
2024-03-22 21:23:15 +00:00
Mikhail Pyltsin
ae303dd2a8 [java-inspection] IJ-CR-128589 IDEA-349655 Improvements for logging inspections. new LogStatementNotGuardedByLogCondition
- fix description

GitOrigin-RevId: f2d26236ef96e3cf2724091352c8b4296bd0ab32
2024-03-22 20:35:53 +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
Georgii Ustinov
72f8dd7b29 [Java. Logging] Add tests for kotlin logging resolve placeholders
IDEA-342484

GitOrigin-RevId: 80da1ccf89b4cc37813facc71d3fc389ead42869
2024-03-21 14:02:59 +00:00
Georgii Ustinov
b2271b925a [Java. Logging] Implement better logging placeholder detection in text blocks for java
IDEA-342484

GitOrigin-RevId: ccb5043d439b20207103cb2d81a09a40bb9f65cd
2024-03-21 14:02:55 +00:00