Commit Graph
1830 Commits
Author SHA1 Message Date
Artemiy Sartakovandintellij-monorepo-bot 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 Selimovandintellij-monorepo-bot 39c3b20e3d [java-i18n] fixes
GitOrigin-RevId: 6c6aa131594515157bad57a25703e147cd529f88
2020-08-06 06:17:39 +00:00
Peter Gromovandintellij-monorepo-bot 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 Valeevandintellij-monorepo-bot fcec11b91c [java-inspection] StringConcatenationInLoops preview-friendly & fixed toString in null-safe mode
GitOrigin-RevId: b545a5a7acb3daa45b6aa4f675c819fefd70c350
2020-08-03 09:51:39 +00:00
Tagir Valeevandintellij-monorepo-bot 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 Valeevandintellij-monorepo-bot 5e28a88df9 [java-inspections] IDEA-247103 "Assert x != null" quick fix does nothing
GitOrigin-RevId: f1a0fa854bceb37349dfb893cf1bf2e0df301726
2020-07-31 10:25:51 +00:00
Anna Kozlovaandintellij-monorepo-bot 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 Sartakovandintellij-monorepo-bot fccea59571 InlineSuperClass: support sealed classes (IDEA-243902)
GitOrigin-RevId: 9e9d53ec7fa1ade7e0d1890fb5682c41da7c4f97
2020-07-29 10:15:32 +00:00
Artemiy Sartakovandintellij-monorepo-bot 69c40bf3bb UnimplementInterfaceAction: sealed parent support (IDEA-243902)
GitOrigin-RevId: 9718672f06b58358200d5d7156adb0081e6154d7
2020-07-29 03:30:08 +00:00
Anna Kozlovaandintellij-monorepo-bot 0f68daff23 i18n: test for shortenClassReferences during java fixes
GitOrigin-RevId: 2b813e4b08248b962f1fc1f4cb55dac01c46e7db
2020-07-27 11:23:25 +00:00
Tagir Valeevandintellij-monorepo-bot a3838dcd03 [java-i18n] Restore passed to non-nls variable behavior
GitOrigin-RevId: 8ec8b1f762120000cb492411bf0386e18325a7e1
2020-07-24 08:49:24 +00:00
Tagir Valeevandintellij-monorepo-bot 6cfec9484e SplitFilterAction: allow parentheses around lambda
GitOrigin-RevId: e83bfe28747e7e41e96ec430ba754507a0cb5b77
2020-07-23 09:36:19 +00:00
Artemiy Sartakovandintellij-monorepo-bot 4eba7180d7 FillPermitsListInspection: intention is inspection now, compilation error fix added (IDEA-243901)
GitOrigin-RevId: cbab81c1117410e6bb56bd7066ebd074bbe1d015
2020-07-22 06:12:11 +00:00
Nikita Eshkeevandintellij-monorepo-bot 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 Valeevandintellij-monorepo-bot 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 Valeevandintellij-monorepo-bot 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 Valeevandintellij-monorepo-bot 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 Eshkeevandintellij-monorepo-bot 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
Tagir Valeevandintellij-monorepo-bot ad7a6a7e33 TypeCorrector#annotate: update provider for delegate
As methods like getCanonicalText, getPresentableText, etc. are just delegated, updating TypeAnnotationProvider on PsiCorrectedClassType only (without updating it on delegate) produced inconsistency.
Fixes IDEA-244190 'Override method' action should produce method with sorted modifiers

GitOrigin-RevId: e06785ba0810910d858d40b070a99c00a33c4e09
2020-07-16 03:56:07 +00:00
Artemiy Sartakovandintellij-monorepo-bot 8eaa9d4c52 FillPermitsListAction: intention to add missing inheritors to permits list (IDEA-243901)
GitOrigin-RevId: a0fc70e03b6339890e8fe42ac651fe0ac910d02b
2020-07-15 04:37:48 +00:00
Nikita Eshkeevandintellij-monorepo-bot 03c771b5bc [codeInsight] IDEA-201714 Missing "fix all" for "Redundant throws clause"
This patch fixes the problem with the absent the "fix all" quick fix for
redundant throws clause inspection. It also does a major refactoring in
the both global and local redundant throws clause exceptions applying
modern code technics.

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

GitOrigin-RevId: 9336c9afd9a6c64b12d4e29f58e1c9da4f33e25e
2020-07-10 14:30:55 +00:00
Anna Kozlovaandintellij-monorepo-bot 4bb02e9e68 create from usage: don't go through polyadic to deep (IDEA-244730)
GitOrigin-RevId: f7ab010a75203486f0c967ae5ba7c69db81ad812
2020-07-10 09:53:37 +00:00
Roman.Ivanovandintellij-monorepo-bot f2a37677b6 SealClassAction: show error if no inheritors for interface + cleanup
GitOrigin-RevId: b5a6dfbf1531dd788eed14a4364cd5431ce8e28e
2020-07-09 04:35:50 +00:00
Roman.Ivanovandintellij-monorepo-bot be3b895bb2 Make enums with fields with class bodies implicitly sealed
GitOrigin-RevId: c1077073a038df9853e3a38a33672bf4dc21c28c
2020-07-09 03:04:40 +00:00
Roman.Ivanovandintellij-monorepo-bot cd624b4c86 SealClassAction: rename, short circuited inheritors search, reject local inheritors
GitOrigin-RevId: 282a1fc9cbb4ccacca545d01bfc036007d7fdfe8
2020-07-09 02:49:59 +00:00
Tagir Valeevandintellij-monorepo-bot 056c5c57f5 Testdata fixed after CodeBlockSurrounder update
GitOrigin-RevId: 52503300404d69cbc12239080e745d53ba5c450b
2020-07-08 11:00:38 +00:00
Tagir Valeevandintellij-monorepo-bot 142b1e7fd9 Fix unwrap 'if' when it's immediately followed by label
GitOrigin-RevId: 8dd9e0c5ba33fb2452e66126e51845ee1999af36
2020-07-07 08:18:42 +00:00
Tagir Valeevandintellij-monorepo-bot 95f61a978b IDEA-245337 'Change field type' for record component field does nothing
GitOrigin-RevId: be89f44adee20d7ca36c0705c35b6264b7189762
2020-07-07 05:55:20 +00:00
Tagir Valeevandintellij-monorepo-bot 0fcad6c545 MoveFieldAssignmentToInitializerInspection: disable for record components
GitOrigin-RevId: a8055e5eaf54381011763d64f34433d62142a4b8
2020-07-07 05:02:41 +00:00
Tagir Valeevandintellij-monorepo-bot a9d4eed68b IDEA-245312 Exception on removing throws clause from record constructor
GitOrigin-RevId: 03cfe1f332222795cc78522dea6b160498f31471
2020-07-07 04:46:37 +00:00
pyltsinandintellij-monorepo-bot d808337407 IDEA-217572 Inspection to replace String.toLowerCase().equals() with String.equalsIgnoreCase()
Contributed by pyltsin <pyltsin-m@yandex.ru> (PR#1398)

GitOrigin-RevId: 8f8582ce822deb0dadb6ba89834e39f3b5db3aa6
2020-07-06 05:49:10 +00:00
Tagir Valeevandintellij-monorepo-bot f3b5023004 EquivalenceChecker: more robust expression sorting
GitOrigin-RevId: 7c2287c2fccd4868e5c17480e9bda49e0317c16f
2020-07-03 10:14:20 +00:00
Tagir Valeevandintellij-monorepo-bot 7315560413 Fixes according to review IDEA-CR-1967
GitOrigin-RevId: 291843a9ecd55948c4f94844aec63c6057d1cb40
2020-07-02 04:37:52 +00:00
Anna Kozlovaandintellij-monorepo-bot 24cb042051 java: create constructor from usage: ensure parameter type is evaluated before constructor is inserted (IDEA-244902)
otherwise inference may detect overload conflict with existing no-arg constructor

GitOrigin-RevId: bade4409a64e31bd0c7c4d79ffa41222b17a7c8f
2020-07-01 08:27:38 +00:00
Anna Kozlovaandintellij-monorepo-bot fab2f3b722 java: hide method return type fix when compilation error won't be fixed (IDEA-244902)
GitOrigin-RevId: 8617da7628ec1ca24f66305b10573e331aa2c031
2020-07-01 08:27:38 +00:00
Roman.Ivanovandintellij-monorepo-bot 8d1e52195e introduce intention to make class sealed: IDEA-243848
GitOrigin-RevId: e69276f3747898731be50b3fc258211924582a48
2020-07-01 03:56:44 +00:00
Tagir Valeevandintellij-monorepo-bot 8baaccc9b5 Testdata fixed
GitOrigin-RevId: d8395deca656da0bbcfb3eae6fbda59db39a420e
2020-06-26 07:32:52 +03:00
Tagir Valeevandintellij-monorepo-bot 2d1a6a067b GenericsUtil#simplifyExtendsFinalClass (IDEA-24201)
GitOrigin-RevId: 758c1e9c3be3c016093d84bf0617ef0b030161b1
2020-06-26 07:29:05 +03:00
Tagir Valeevandintellij-monorepo-bot 14fa0849cd AddTypeCast: automatically convert literals in common cases (IDEA-20480)
GitOrigin-RevId: f44030ecd28f1dd7e268474fafe9beb7f65e81fb
2020-06-26 06:40:29 +03:00
Tagir Valeevandintellij-monorepo-bot 54dc3625c7 More friendly messages for change signature from usage; tests for records (IDEA-244030)
GitOrigin-RevId: 47ea76c9514b26c3e91a1b0e8450169a75b89576
2020-06-23 18:48:59 +03:00
Tagir Valeevandintellij-monorepo-bot 1f6ad2d2bb Preserve comment right after the loop
GitOrigin-RevId: e096580618c805f0e1f5c8e1a878b5e3321174c7
2020-06-23 13:11:19 +03:00
Tagir Valeevandintellij-monorepo-bot 91092e2ef7 MoveIntoIfBranchesAction: disable if if branch cannot complete normally
GitOrigin-RevId: 07c9d5a46c0ded0d1de27c0a0c4b372061b84917
2020-06-17 09:24:13 +03:00
Tagir Valeevandintellij-monorepo-bot 615388d9cb ReuseVariableDeclarationFix: support array initializers
GitOrigin-RevId: 2b384594722e9e8b92792336b9e39a1479e5e8d4
2020-06-17 08:15:25 +03:00
Tagir Valeevandintellij-monorepo-bot 52cd7af434 CollapseIntoLoopAction: handle comments; handle case if x-th iteration equals to the first one
GitOrigin-RevId: 104dc5f3fec65604aef4288e24df1113227f8ac2
2020-06-17 07:41:40 +03:00
Tagir Valeevandintellij-monorepo-bot f988f89bbd Avoid suggesting counting loop if loop variable must be effectively final
GitOrigin-RevId: eb15165f5034fa75de9c9af97fb2707a233e9fe5
2020-06-17 07:41:39 +03:00
Tagir Valeevandintellij-monorepo-bot 868aa78cf3 CollapseIntoLoopAction: avoid counting loop for two iterations when step is not +1/-1
GitOrigin-RevId: d8aef85c6d2620a9dd7e9216932388672a049979
2020-06-17 07:41:38 +03:00
Tagir Valeevandintellij-monorepo-bot 7470db33d8 CollapseIntoLoopAction: use tracking equivalence checker
GitOrigin-RevId: e8194d0ed5c4603eacbb0d904232f79f6373e56a
2020-06-17 06:31:00 +03:00
Tagir Valeevandintellij-monorepo-bot 0322598dbc CollapseIntoLoopAction: disable when expression refers to written variable
Also, EquivalenceChecker.getComplexElementDecision fixed

GitOrigin-RevId: 6848a57ddc1cf4992030fff614c246a6316f4807
2020-06-17 06:30:58 +03:00
Tagir Valeevandintellij-monorepo-bot 51cd561f79 CollapseIntoLoopAction: disable when expression is written
GitOrigin-RevId: aa405149d65d0e669bc18f87359f486981c1c899
2020-06-17 06:30:57 +03:00
Tagir Valeevandintellij-monorepo-bot 8a7d1000b1 MoveIntoIfBranchesAction: conflict detection improved
GitOrigin-RevId: bf8c3d050e5cfa51e71d6e34921ab2c2036b8e5e
2020-06-15 10:59:08 +03:00