Commit Graph

2187 Commits

Author SHA1 Message Date
Andrey.Cherkasov
f78c90027c [java-inspections] StreamApiMigration: "Replace with collect" fix produces wrong code for record patterns
IDEA-300726

GitOrigin-RevId: 83c638a60f4dee0a363b285535e808140e853fae
2022-08-29 17:03:09 +00:00
Andrey.Cherkasov
1c7aea69ba [java-inspections] 'Remove pattern variable' fix is available on deconstruction pattern component but produces red code
IDEA-298527

GitOrigin-RevId: 32645ea4938384d31bbe4750c3867e3b00f3fafe
2022-08-29 13:52:32 +00:00
Andrey.Cherkasov
3510811585 [java-inspections] 'Replace with a null check': add negative tests for record patterns
IDEA-300018

GitOrigin-RevId: 6e6ea72ddf6e62b06eba1daeebb23a5b477e58aa
2022-08-26 09:50:04 +00:00
Andrey.Cherkasov
1207deb772 [java-inspections] SimplifyBooleanExpressionFix: support record patterns
IDEA-300018

GitOrigin-RevId: 2f6d431cfb3baf2961ad560abdabd6fd373ef6b6
2022-08-25 18:48:55 +00:00
Bas Leijdekkers
9addc5eaf7 java: include parentheses () in text when referring to methods
GitOrigin-RevId: 1cfc8afb26b5db175d865f6bbdc752356040d8bb
2022-08-22 17:58:06 +00:00
Tagir Valeev
4efbdf1fb5 [java-inspections] IDEA-300159 Redundant close(): Search closing statements in if statements
PR#2106
Reviewed-by: Tagir Valeev <tagir.valeev@jetbrains.com>

GitOrigin-RevId: 501e4fee7441bf38e1d0ad19f826d3a7b565920b
2022-08-19 10:55:36 +00:00
Bas Leijdekkers
790d7872ae IPP: refer to methods including parentheses () in intention text
GitOrigin-RevId: 2578135cbf75767e296f6bc48db3b5a56aa6acd1
2022-08-18 20:56:33 +00:00
Andrey.Cherkasov
8cfde5e798 [java-intentions] ConvertSwitchToIf: don't add explicit null check if the selector expression is not null
IDEA-300120

GitOrigin-RevId: d49fa3356b23ec87c8f493fc4cdacb0655e4b600
2022-08-18 20:46:01 +00:00
Andrey.Cherkasov
108dc80b56 [java-intentions] ConvertSwitchToIf: fix the intention according a switch throws NPE if the selector expression is null
IDEA-300120

GitOrigin-RevId: 5d77f98e7931e32a06cb3c54076978d317f78a98
2022-08-17 23:14:53 +00:00
Bas Leijdekkers
ae1825cb0a java: surround with array quick-fix fixes
GitOrigin-RevId: 8c3e7bcf9d4423515c59b027eca3ca35b0a18ff1
2022-08-12 13:57:51 +00:00
Tagir Valeev
ed136d9dbf [java-inspections] WrapExpressionFix: suggest Arrays.toString if expected type is string and actual is array
GitOrigin-RevId: 4c838da8dbb068de751bfb71ef98448bc475bf90
2022-08-12 09:31:22 +00:00
Tagir Valeev
a952ee5872 [intention-preview] CreateClassFromUsageFix: preview; tests for preview
GitOrigin-RevId: 2eb36ee066743ffcacf4fae2968ba9d6d9c8bcff
2022-08-12 09:31:04 +00:00
Fabrice Tiercelin
1c9de6b4cf [java-inspections] IDEA-299573 Handle Optional.isEmpty() in "Non functional style Optional.isPresent() usage" inspection
PR#2100

Co-authored-by: Tagir Valeev <tagir.valeev@jetbrains.com>

GitOrigin-RevId: c0b8495f26bccf51c593deb6be927eb01c37d379
2022-08-10 18:04:05 +00:00
pyltsin-m
794497240b [java-inspections] IDEA-298475 Redundant compareTo() call for java.time classes
GitOrigin-RevId: c7effac4c48448e5e9db6360f012cc13846df41d
2022-08-09 16:34:19 +00:00
Bart van Helvert
07e6ec4678 [java-inspections] IJ-CR-27871 Introduce local variable in preview
GitOrigin-RevId: 1d9b8d6e4acab1a48e99370cf8a296e84309d7f2
2022-08-09 11:36:04 +00:00
Tagir Valeev
b41375447f [java-highlighting] Better call type mismatch reporting
GitOrigin-RevId: 1f7240ef2cdad17d78aa0f691b1b5ce3108293b3
2022-08-08 14:00:00 +00:00
Tagir Valeev
a0bc3ee404 [java-highlighting] Better actual type definition; fixes for some type mismatch in collectors
GitOrigin-RevId: 3652f4511a067b86bc9138f492a2a88cded09de0
2022-08-08 13:59:57 +00:00
Alexey Kudravtsev
0c4fbaeaa2 remove unnecessary test data
GitOrigin-RevId: 8dfc0eca12d06026ff2f81bc70cd59edc4a3603e
2022-08-05 11:30:06 +00:00
Tagir Valeev
a500d6b7b3 [java-intentions] IDEA-299075 Better support for types with several type parameters
GitOrigin-RevId: 9f7d4d429ef9aca857e36b24990be23d664c255a
2022-08-04 18:10:45 +00:00
Tagir Valeev
41d70528b5 [java-intentions] IDEA-299327 'Merge filter chain' quick-fix produces uncompilable code when lambda contains return
GitOrigin-RevId: 1e8d17520a03629891549385727b62e0bd342500
2022-08-04 18:10:44 +00:00
Bart van Helvert
2a86552363 [java-inspections] Add quotes to annotations in inspection messages
GitOrigin-RevId: a2d102bb75c6f0f213cfe79928909f8501be6ca7
2022-08-04 13:39:06 +00:00
Tagir Valeev
41cbe227c2 [java-intentions] IDEA-299075 Additional fixes
1. Map to supertype if expected is a supertype for actual
2. Do not suggest the replacement when type parameter bounds are violated

GitOrigin-RevId: 7784f18fcdb7fdd9541e5c92a211808475f62054
2022-08-04 13:37:44 +00:00
Tagir Valeev
c99da54bb4 [java-intentions] IDEA-299075 More scenarios for parameter fixes
1. Surround with array initialization
2. Apply .toArray() conversion
3. Limited vararg support
4. Limited qualifier propagation

GitOrigin-RevId: f81f593502df317b555e816af20cdec2d04488fc
2022-08-03 15:00:24 +00:00
Tagir Valeev
47924b8886 [java-intentions] Better messages for wrap and adapt intentions
GitOrigin-RevId: f0a38046a71722f48f3ff1d59ea501259139237e
2022-08-03 12:19:14 +00:00
Alexey Kudravtsev
5145671442 split UnimplementInterfaceAction to two fixes with immutable text for clarity (boolean parameter considered harmful) and for stability
GitOrigin-RevId: 3942585b2071cb81733080dee122913cdac001f1
2022-08-03 08:34:18 +00:00
Tagir Valeev
0e76072ac4 [java-intentions] Do not show "Type migration" intention if it cannot do better than "Change variable type"
GitOrigin-RevId: 6a8c95e53e4c5c160ab1e97c63a2733397cccad1
2022-08-02 18:58:12 +00:00
Tagir Valeev
c7063c97ef [java-intentions] Improve messages for add cast fixes
GitOrigin-RevId: b097e12c61cac86e789945a89316a7fef391c770
2022-08-02 18:58:09 +00:00
Andrey.Cherkasov
347fd05cd9 [java-intentions] UnwrapSwitchLabelFix produces red code when unwrapping case labels with deconstruction patterns
IDEA-297387

GitOrigin-RevId: cfdbdec0e83af90c325d41d583c749963686fd71
2022-08-02 08:33:45 +00:00
Tagir Valeev
8a9959167b [java-intentions] IDEA-299075 Better quick-fixes when generic method call has mismatched type
GitOrigin-RevId: 6fa73efcfb43cd7da05f95ef66c2cd40a3dc1a14
2022-08-01 18:23:39 +00:00
Tagir Valeev
46c6cb94ad [java-intentions] EA-465575 - AE: JavaParserUtil.parseFragment
GitOrigin-RevId: 51d05798ab9a127508bcf531a3aa1a13cdda5aae
2022-08-01 18:23:37 +00:00
Anna Kozlova
a56cd0ec87 [java] disable change signature from usage when trivial
workaround type annotations case

GitOrigin-RevId: 4c2878ff49039830bf67e66f2c2948ece03cfe0c
2022-07-29 19:28:13 +00:00
Tagir Valeev
49f4397ba0 [java-intentions] More preview tests
GitOrigin-RevId: 4d6a5487576dbbc4aca9c89b067eec8218aff686
2022-07-29 17:55:15 +00:00
Tagir Valeev
1361a10017 [java-intentions] Remove unused assignment/initializer: preview-friendly
GitOrigin-RevId: de9da180223f231638eb51804b7ed9c26c36d772
2022-07-29 17:55:14 +00:00
Tagir Valeev
7e1064ea3c [java-intentions] More preview tests; minor fixes
GitOrigin-RevId: 22a46c15d8900d8a31514846755a013f6a67ad42
2022-07-29 17:55:13 +00:00
Tagir Valeev
e74564a52c [java-intentions] Merge SuperMethodReturnFix into MethodReturnTypeFix
GitOrigin-RevId: 92f0e44f389637e925f11b21fb581ac3d8382855
2022-07-29 17:55:12 +00:00
Tagir Valeev
2c3779a08a [java-intentions] ChangeMethodSignatureFromUsageFix: better handling of annotations
GitOrigin-RevId: b4de4a64ff488b167352bac2172c9df55836b819
2022-07-29 17:55:07 +00:00
Tagir Valeev
758ecdbb56 [java-intentions] More preview tests
GitOrigin-RevId: ffe102e1f4377d52f988f59c407af3dd7acc36fc
2022-07-29 17:55:03 +00:00
Tagir Valeev
01cc468b55 [java-intentions] InlineStreamMapAction: preview-friendly
GitOrigin-RevId: 4c4a288c134b9bd9d772e42df64c8722c0bd7c65
2022-07-29 17:55:02 +00:00
Tagir Valeev
0695b6ae8a [java-intentions] InitializeFinalFieldInConstructorFix: preview-friendly
GitOrigin-RevId: 9ccb207c593ca448f9f79da94876ac87c2cac5ae
2022-07-29 17:55:01 +00:00
Tagir Valeev
11130867f8 [java-inspections] ExtractSetFromComparisonChainAction: preview-friendly+tests
GitOrigin-RevId: 4749198f7b5c3aa0da3efe82eafd8161b429b789
2022-07-29 17:55:00 +00:00
Tagir Valeev
dd689d3a39 [java-inspections] More tests for preview
GitOrigin-RevId: 6b6405ee4491ad1d58947547c40df6fb2d291ab7
2022-07-29 17:54:59 +00:00
Tagir Valeev
c642b9a580 [java-intentions] CreateLocalVarFromInstanceofAction: exact preview+tests
GitOrigin-RevId: acf0c175cda663c43d5feb5b503ed462c5acf92d
2022-07-29 17:54:57 +00:00
Bart van Helvert
1da8b85338 [java-inspections] Improve 'AddUnknownTagToCustoms' warning message
GitOrigin-RevId: bceda7452262b53ca05624669f7d7723691abfc0
2022-07-29 14:24:23 +00:00
Bart van Helvert
ed388efc1a [java-inspections] IDEA-298787 Add preview to 'ConvertFieldToLocalQuickFix'
GitOrigin-RevId: b8b06b05c9c3fbb8111f3caded9a6a2f5d3e911f
2022-07-29 14:24:14 +00:00
Bart van Helvert
57b3e68b1b [java-inspections] IDEA-298539 Fix parameter can be local quick-fix undo
Also makes it so refactoring isn't called in write action and won't cause deadlocks.

GitOrigin-RevId: 204fd9f9a0b2e942b1c9eb56b3d9938b2666d123
2022-07-29 14:24:01 +00:00
Roman Ivanov
86406ca919 [java] ConditionalBreakInInfiniteLoopInspection invert variable name and condition + fix test data
GitOrigin-RevId: f00028d2e207670784887a66d2cd12cb61f11127
2022-07-27 16:06:26 +00:00
Tagir Valeev
f19b3cd370 [java-inspections] IDEA-298718 Simplify array/list/string creation and immediate access
GitOrigin-RevId: 60df8ffa9aee53abf897e4fa6b42da4909a0e40b
2022-07-27 13:56:37 +00:00
Tagir Valeev
6266f14d9b [java-inspections] CreateLocalFromUsageFix: tests for preview
GitOrigin-RevId: 18145df666bfb6601725d6cdd13a14bb341fe32a
2022-07-27 10:00:37 +00:00
Tagir Valeev
00e0603e53 [java-inspections] createGetterOrSetter: tests for preview
GitOrigin-RevId: b570df26d740aacb84357b1fbdbb0ced890970f0
2022-07-27 10:00:35 +00:00
Tagir Valeev
d3341c8cc9 [java-inspections] CreateInnerClassFromUsageFix: preview-friendly
GitOrigin-RevId: ed0dbc12d26e87c17315f369da687dd4fe65d63d
2022-07-27 10:00:34 +00:00