Commit Graph

1862 Commits

Author SHA1 Message Date
Artemiy Sartakov
b0c9f63799 Sealed classes: show create class fix instead of create type parameter in permits list (IDEA-251830)
GitOrigin-RevId: 4de0ea71c210e7da57f99b8295b7e511d9674120
2020-10-07 05:42:50 +00:00
Tagir Valeev
d833da5281 [java-inspection] IDEA-252155 False positive "Lambda can be replaced with method reference" when casting with additional bounds
GitOrigin-RevId: 2b752e6b47a0d53b05b4e7cd98064c5ce54e2904
2020-10-06 08:04:23 +00:00
Tagir Valeev
ebc61af5e8 [java-intention] CollapseIntoLoopAction: disable inside switch and on declarations (IDEA-251600)
GitOrigin-RevId: de00fe6b26f1969f8f9df0ac2d944ec76f402c8c
2020-10-02 04:09:06 +00:00
Andrey.Cherkasov
4d2632fc41 Fixes after review: IDEA-202309
GitOrigin-RevId: 542cdc5e1c3b401a6a3e37504cf9351212aac4be
2020-09-28 10:57:18 +00:00
Andrey.Cherkasov
6fbd744430 RedundantUnmodifiableInspection created: IDEA-202309
GitOrigin-RevId: d5a5e1f45ba0f6e0af786ca588caaa192cd4b554
2020-09-25 11:52:07 +00:00
Andrey.Cherkasov
f65fd090cd Fix test IDEA-244144
GitOrigin-RevId: fe15366aaed97e7c3f0c07453a51d121ab3ab3bc
2020-09-23 09:12:25 +00:00
Andrey.Cherkasov
9845c0a0c2 Support parentheses, fix bug when the array branch has a primitive array, more tests: IDEA-244144
GitOrigin-RevId: 4c644d8b1e11869e4f3853763d09d7e0b91b5740
2020-09-22 12:24:19 +00:00
Tagir Valeev
a0f0dabaa4 [java-highlighting] IDEA-246748 Remove support of C-style array declaration in record components
Actually suggest a fix if somebody uses it

GitOrigin-RevId: 57ee72ebdc99ebe506a88696bf37f9319cdbcc33
2020-09-21 09:44:54 +00:00
Andrey.Cherkasov
eb5e81dcb4 SuspiciousTernaryOperatorInVarargsCallInspection created: IDEA-244144
GitOrigin-RevId: cc56e98bf46b87d1b685177a72bccfd4fc80a596
2020-09-18 23:04:15 +00:00
Andrey.Cherkasov
50af51d8d1 Support the case when then array initializer is taken into parentheses; more attention to comments in fix: IDEA-238645
GitOrigin-RevId: d4557daa9b37e9f103b6453d9e0ad3a18df0a870
2020-09-16 12:30:36 +00:00
Andrey.Cherkasov
d6ecf8f1f0 Fixes after review: IDEA-249165
GitOrigin-RevId: 5f90b50bd298dbc73283a6b2e78267483211c111
2020-09-15 21:23:00 +00:00
Tagir Valeev
390a408fa0 Bundle ICU4J; create NlsMessages to format duration and and/or lists
Fixes IDEA-247854 Formats#formatDuration is not localizable

GitOrigin-RevId: adb56cac0ecc7c47a644887e3eb17e9ca26b47bd
2020-09-15 04:50:16 +00:00
Andrey.Cherkasov
6100adc63f IDEA-238645 Test fixes and some refactoring
GitOrigin-RevId: 5a3ac649c4639a0a2981608c1f503fbea72ce3be
2020-09-15 01:56:30 +00:00
Artemiy Sartakov
859a8fa5ba ExtendSealedClassFix: fix added (IDEA-249603)
GitOrigin-RevId: d47a517c15f0a011fae581db7aacf4b1a76bad1b
2020-09-10 09:55:47 +00:00
Andrey.Cherkasov
080b533383 Fixes after code review: IDEA-249165
GitOrigin-RevId: db35ebb920618b5e2105715406c1e24eb50bb71a
2020-09-08 07:31:16 +00:00
Tagir Valeev
a7fbd25b9e [java-intention] MoveParenthesisFix: remove unnecessary MethodCandidateInfo check
It prevented from finding single correct version if multiple overloads are available

GitOrigin-RevId: 8759aaaee8f0b7cce044a3bf447661e5ea30dabe
2020-09-07 10:28:38 +00:00
Bas Leijdekkers
e310b0c94c inspection warning text improvements
GitOrigin-RevId: 9aaad61ae52463727c77930af532258ea16dd1da
2020-09-04 10:23:25 +00:00
Andrey.Cherkasov
a65ac28d32 RedundantFileCreationInspection created: IDEA-249165
GitOrigin-RevId: 2d8ea0c12c2320d5f8b0e685b9a047bf3f972852
2020-09-04 09:42:42 +00:00
Tagir Valeev
5b88621295 [java-intentions] IDEA-249810 Automatically fix closing parentheses in nested calls
GitOrigin-RevId: 9447905d0f2fda68b7f61b9310088b2f109d6b0e
2020-09-03 03:45:03 +00:00
Tagir Valeev
a0f9fd146b [java-i18n] More uniform call-chain support; fixes property test with parentheses
GitOrigin-RevId: 7f91d71dd6e87771165b35a33f322533f64a49ca
2020-09-01 09:28:19 +00:00
Anna Kozlova
a2e3d7e5ab java: reject diamonds in anonymous classes with non-private methods (IDEA-248972;IDEA-248973)
GitOrigin-RevId: 5300c91c601dd59f3a020ac6a6627517aaca68c7
2020-08-27 11:11:51 +00:00
Anna Kozlova
9fe8cbf7c9 fix testdata
GitOrigin-RevId: cfd971b44341a6c0c218aa986da7d5d3101f54da
2020-08-26 16:51:25 +00:00
Anna Kozlova
6b78c18ce8 i18n: detect last concatenation (IDEA-249116)
GitOrigin-RevId: 5bf832e023bc24f721ece8eafc698e3e042c94b7
2020-08-26 16:23:57 +00:00
Anna Kozlova
aa937e1f93 i18n: don't create nested choices, escape special symbols in choice sides (IDEA-247804)
GitOrigin-RevId: dcb56f8bf352bc8f656edd85242be6b3c70af34d
2020-08-25 11:17:27 +00:00
Tagir Valeev
93479e1f99 [java-intentions] Remove 'Add constructor parameter' fix for record fields (IDEA-248139)
As record instance field declaration is illegal, this action is useless anyway and only adds confusion

GitOrigin-RevId: 4a1862f66c5a175fef675705e6af53ef5bae1f78
2020-08-24 12:08:39 +00:00
Anna Kozlova
a232f81e1a i18n fix assignment: detect concatenations in rOperand
GitOrigin-RevId: 62ff07771c6b55807cddee1c0e514540c0b258d7
2020-08-24 11:19:48 +00:00
Tagir Valeev
8a830c1018 ReturnSeparatedFromComputationInspection: do not process if variable and return are in different scopes
Fixes EA-237085 - assert: ControlFlowUtil.isVariableReadInFinally

GitOrigin-RevId: 1f48700f3f08faf96f12b440b3fd54d735c50620
2020-08-24 10:42:56 +00:00
Anna Kozlova
af1c8c2574 i18n fix: traverse to the expression top level (IDEA-248707)
if one need to extract subpart of concatenation, it's required to extract a variable; similar to parts of polyadic expression

GitOrigin-RevId: 46cd1a75303b72ea64e9694617fb43f4d3da5982
2020-08-21 08:03:52 +00:00
Anna Kozlova
05ccb72166 i18n fix: fix choice format parameters ordering (IDEA-248709)
GitOrigin-RevId: 84fa26fcbd459bcf263df0adf224afebb6bdeb31
2020-08-21 07:10:41 +00:00
Tagir Valeev
fa03a31c48 Messages clarified, quotes added
GitOrigin-RevId: f191ad36a574aa3543758ce87ad0b03cc01cc550
2020-08-18 12:02:48 +00:00
Anna Kozlova
8fc89fc6f5 java: add fix to expand 'var' type when type annotation is used (IDEA-248364)
GitOrigin-RevId: 826f1e07587dc4d85214f5d0cafd5776d3448a95
2020-08-18 11:11:09 +00:00
Tagir Valeev
ea5e79ca14 [java-inspections] StreamApiMigration: parentheses like (br).readLine()
GitOrigin-RevId: 9f71c7b1a41cd74abd0e51a0637a3da13ce955b6
2020-08-10 09:36:28 +00:00
Artemiy Sartakov
ec30bf3a97 Sealed classes: update hierarchy fixes (IJ-CR-2554):
1. add missing same file inheritors to permits list during safe delete or create subclass refactoring
2. inline isParentSealed for inline to anonymous class refactoring
3. do not make sealed class final when removing last inheritor (just remove sealed modifier)

GitOrigin-RevId: acf3652f12144446116c5d71ea1722b06b9f6b92
2020-08-10 09:19:20 +00:00
Ilyas Selimov
39c3b20e3d [java-i18n] fixes
GitOrigin-RevId: 6c6aa131594515157bad57a25703e147cd529f88
2020-08-06 06:17:39 +00:00
Peter Gromov
457c7b42b6 java: disable AddOnDemandStaticImportAction on broken code where it'd break stub-text consistency otherwise
GitOrigin-RevId: 705892a1471eff7797a1fe2abfcbd320849dd76e
2020-08-03 13:00:08 +00:00
Tagir Valeev
fcec11b91c [java-inspection] StringConcatenationInLoops preview-friendly & fixed toString in null-safe mode
GitOrigin-RevId: b545a5a7acb3daa45b6aa4f675c819fefd70c350
2020-08-03 09:51:39 +00:00
Tagir Valeev
9ca4341d7f [java-intention] BreakConverter#process fixed
isRemovable must be called before any modifications. Otherwise, previous modifications may affect its results.

GitOrigin-RevId: d05be1e54ba62e5ac18003bf54dab2abb16124ce
2020-08-03 09:51:38 +00:00
Tagir Valeev
5e28a88df9 [java-inspections] IDEA-247103 "Assert x != null" quick fix does nothing
GitOrigin-RevId: f1a0fa854bceb37349dfb893cf1bf2e0df301726
2020-07-31 10:25:51 +00:00
Anna Kozlova
2022bfbf66 i18n: try choice format when ternary is used in concatenation (IDEA-246848)
GitOrigin-RevId: 2f4592ad2ee277075a72b2debc71d3e470084d0b
2020-07-29 10:43:44 +00:00
Artemiy Sartakov
fccea59571 InlineSuperClass: support sealed classes (IDEA-243902)
GitOrigin-RevId: 9e9d53ec7fa1ade7e0d1890fb5682c41da7c4f97
2020-07-29 10:15:32 +00:00
Artemiy Sartakov
69c40bf3bb UnimplementInterfaceAction: sealed parent support (IDEA-243902)
GitOrigin-RevId: 9718672f06b58358200d5d7156adb0081e6154d7
2020-07-29 03:30:08 +00:00
Anna Kozlova
0f68daff23 i18n: test for shortenClassReferences during java fixes
GitOrigin-RevId: 2b813e4b08248b962f1fc1f4cb55dac01c46e7db
2020-07-27 11:23:25 +00:00
Tagir Valeev
a3838dcd03 [java-i18n] Restore passed to non-nls variable behavior
GitOrigin-RevId: 8ec8b1f762120000cb492411bf0386e18325a7e1
2020-07-24 08:49:24 +00:00
Tagir Valeev
6cfec9484e SplitFilterAction: allow parentheses around lambda
GitOrigin-RevId: e83bfe28747e7e41e96ec430ba754507a0cb5b77
2020-07-23 09:36:19 +00:00
Artemiy Sartakov
4eba7180d7 FillPermitsListInspection: intention is inspection now, compilation error fix added (IDEA-243901)
GitOrigin-RevId: cbab81c1117410e6bb56bd7066ebd074bbe1d015
2020-07-22 06:12:11 +00:00
Nikita Eshkeev
82099584a0 [codeInsight] IDEA-201714 Missing "fix all" for "Redundant throws clause"
This patch fixes the notes from the code review it includes:

- splitting the code that detects related @throws in the local inspection from the code that is used in the global one
- related @throws are no longer returned if one of the duplicates in the throws list is being removed
- related @throw tags are not being removed if there is an element in the throws list that can be assigned with the class of the @throws tag

Signed-off-by: Nikita Eshkeev <nikita.eshkeev@jetbrains.com>

GitOrigin-RevId: e68823093d88427dbbb7efa0cd1171988d1f5360
2020-07-21 22:58:57 +00:00
Tagir Valeev
55ad5be04b Do not process unknown tokens when simplifying the polyadic expression
Fixes IDEA-246008 "Constant condition" Inspection quick fix removes boolean value from string concatenation when between two values

GitOrigin-RevId: 635e6b5f0b0a102d9c1ddecbbf54315b9b52f2dd
2020-07-20 10:23:20 +00:00
Tagir Valeev
47b9916057 Surround with try-catch: disable in resources
There's another fix 'Add catch to try' and this is most likely what people want. Having too many fixes is confusing.

GitOrigin-RevId: c6c03bf52a9b59a14e7e8025e0fa525de7872630
2020-07-20 05:06:04 +00:00
Tagir Valeev
f801cdb18f Do not split try when expression is in the first resource without catch/finally
It's unnecessary and otherwise try-block is automatically unwrapped
(see com.intellij.psi.impl.source.tree.java.PsiTryStatementImpl.deleteChildInternal) causing EA-235365 - PIEAE: LazyParseablePsiElement.getContainingFile

GitOrigin-RevId: 4ea3e54f8ea27854e23537a8de22f2923feaf842
2020-07-20 05:04:11 +00:00
Nikita Eshkeev
a2c8f3ed4a [codeInsight] IDEA-201714 Missing "fix all" for "Redundant throws clause"
Redundant throws exception inspetction used to report both the redundant
exceptions in the throws list and @throws tags in the javadoc. It was
not convenient since the same problem got reported twice. This patch
changes this behaviour, no @throws tags is reported as redundant. If
there are redundant @throws tags they get removed when its corresponding
throws declarations is being removed. The redundant @throws tags are
detected like this:

1. If there is only one throws declaration in the throws list of a
method then all the @throws tags get removed.
2. A @throws tag is considered related to the throws declaration that is
being removed if it is the exact match with the throws declaration or if
it is a subclass of it and there are no exact matches for the @throws
tag in the throws list.
3. If there are duplicates in the throws list then when one of the
duplicates is getting removed then all the related @throws tags are
considered related to that copy leaving the other duplicates without any
related @throws tag in the javadoc.

Signed-off-by: Nikita Eshkeev <nikita.eshkeev@jetbrains.com>

GitOrigin-RevId: 1c4d0388903411a424fd5e4ca37aa71d5a606500
2020-07-17 17:18:38 +00:00