Commit Graph

3534 Commits

Author SHA1 Message Date
Anna.Kozlova bc61fc52a0 redundant suppression: don't delete all same comments/top annotation when one suppress comment is actually to be deleted 2018-10-04 18:20:21 +02:00
Pavel Dolgov 799b769b2f Java: Convert intention "Join Declaration And Assignment" into inspection (IDEA-178919) 2018-10-04 16:46:00 +03:00
Tagir Valeev f12b4848c6 RefactoringUtil#ensureCodeBlock: support &&-chains in returns/lambdas (IDEA-199811)
Also implementation extracted to package-private class
2018-10-03 13:46:47 +07:00
Tagir Valeev 46ffa7b2cc Testdata fixed 2018-10-03 10:55:33 +07:00
Pavel Dolgov acbb991ce1 Java: Convert intention "Join Declaration And Assignment" into inspection - minor fixes after review (IDEA-178919) 2018-10-02 15:12:37 +03:00
Tagir Valeev 8bb578e43c SimplifyBooleanExpressionFix: fix 'while' handling after ensureCodeBlock improvements 2018-10-02 16:36:16 +07:00
Tagir Valeev 49e8a5a7ff IDEA-199811 RefactoringUtil#ensureCodeBlock: support while conditions; support && chains in if-then and while 2018-10-02 16:36:15 +07:00
Tagir Valeev ec3b05f6a3 ConstantExpressionVisitor fixes
1. Relational operators are promoted according to JLS, not always to double type (IDEA-199775)
2. Casting to boxed type is disabled, as JLS 15.28 suggests
Result of boxed comparison like (Long)128L == (Long)128L is unknown now as size of boxing cache is not specified in JLS
2018-10-02 12:59:27 +07:00
Roman.Ivanov 19b4764435 SortContentAction: fix \n placement in presence of comments: IDEA-199734 2018-10-02 12:08:47 +07:00
Anna Kozlova fe3955570d redundant suppression in the editor: treat suppress ALL 2018-10-01 18:50:39 +02:00
Pavel Dolgov 0623c7b75f Java: Convert intention "Join Declaration And Assignment" into inspection - improved highlighting (IDEA-178919) 2018-10-01 17:51:52 +03:00
Tagir Valeev 763ad22de9 Support local classes 2018-10-01 16:31:37 +07:00
Tagir Valeev 5fc3612fa9 DeleteSwitchLabelFix: delete unreachable switch branch
Fixes IDEA-199692 Quickfix to delete unreachable switch branch reported by "constant conditions & exceptions"
2018-10-01 14:54:36 +07:00
Anna Kozlova fe9799965c unchecked warnings: check poly conditional branches in context of target type (IDEA-199615) 2018-09-28 19:59:32 +02:00
Tagir Valeev ca1c783ed1 InlineStreamMapAction: correctly handle lambda parameters with explicit types 2018-09-28 18:17:03 +07:00
Pavel Dolgov 37a3fcab85 Java: Convert intention "Join Declaration And Assignment" into inspection (IDEA-178919) 2018-09-28 13:20:45 +03:00
Tagir Valeev 43f52af2ba WrapObjectWithOptionalOfNullableFix: get nullability from common dataflow 2018-09-28 11:13:11 +07:00
Tagir Valeev 003aa20f96 LambdaCanBeMethodCallInspection: support Java11 Pattern.asMatchPredicate()
IDEA-199626 Suggest Java 11 Pattern.asMatchPredicate() instead of x -> pattern.matcher(x).matches()
2018-09-28 10:56:07 +07:00
Anna Kozlova 3366ae8733 restore comments on removing redundant cast 2018-09-27 13:57:12 +02:00
Tagir Valeev 625c1cc676 ConvertSwitchToIfIntention: fixes after review IDEA-CR-37311:
1. Do not suggest intention if `default` case is not the last one and fallthrough is possible into or out of that case
2. Generate a code-block if side-effect should be extracted to variable
2018-09-27 10:17:10 +07:00
Anna.Kozlova 01eb8ca66b redundant lambda code block: warn for self suppressions so it would be suppressed by LocalInspectionPass
otherwise Redundant Suppression would report such cases as suppress comment would prevent reporting by itself
2018-09-26 17:51:41 +02:00
Anna.Kozlova 89c0f4af1c redundant suppressions: remove suppression from local variable annotation fixed 2018-09-26 17:51:41 +02:00
Anna.Kozlova 09ee7d2e36 redundant suppressions: don't warn for unfair inspections (IDEA-199532) 2018-09-26 17:51:41 +02:00
Tagir Valeev 1b4e5c1e39 Merge SwitchStatementWithSingleDefaultInspection into SwitchStatementWithTooFewBranches
Fixes IDEA-199499 Improve "Replace 'switch' with 'if'" action and make it a quick-fix for "Switch has too few branches"
Now default is not counted as branch in SwitchStatementWithTooFewBranches
2018-09-26 17:06:07 +07:00
Tagir Valeev f859a4c439 Support BreakConverter in ConvertSwitchToIfIntention
Fixes IDEA-141261 'Replace 'switch' with 'if'' intention produces incorrect code if some 'case' clause contains 'break' statement inside 'if'
2018-09-26 11:58:20 +07:00
Tagir Valeev 9530731ea5 IDEA-196805 Warn about switch statement with single 'default' 2018-09-25 14:19:43 +07:00
Anna.Kozlova 83a859546b redundant suppression available in the editor IDEA-151197
also, global inspection redundant suppressions made java independent (WEB-16634)
2018-09-21 19:37:01 +02:00
peter 9f0c066ae9 when "if" or a loop body is deleted, replace it with an empty code block
to preserve PSI-text consistency
2018-09-21 13:48:12 +02:00
Anna.Kozlova 5cec08212e create method from usage: guess return types by context of the same method calls (IDEA-199042) 2018-09-19 13:56:49 +02:00
Tagir Valeev 596a850fa3 LambdaCanBeMethodCallInspection: support Pattern.negate() case
IDEA-197892 Explicitly negated Predicate::test can be simplified with Predicate::negate
2018-09-19 17:51:26 +07:00
Tagir Valeev 85f0872d9b StreamToLoop: support parentheses inside flatMap 2018-09-19 12:26:21 +07:00
Tagir Valeev 65049765b0 StreamRefactoringUtil#isRefactoringCandidate disable if method reference is not resolved 2018-09-19 12:20:47 +07:00
Anna.Kozlova 0acc44b025 exceptions collection: don't visit anonymous class body (IDEA-198967)
simple visit of expression list doesn't work as walking visitor starts to go down when it starts an element and element has no children
2018-09-18 18:54:06 +02:00
Alexey Kudravtsev 858e241d05 add test case for IDEA-CR-36995 2018-09-17 18:33:55 +03:00
Tagir Valeev b7688efea7 TerminalOperation: check arguments count for "collectingAndThen" collector.
Fixes EA-127467 - AIOOBE: TerminalOperation.fromCollector
2018-09-17 09:30:59 +07:00
Alexey Kudravtsev 544c3b670f fix for changing parameter types for method which used to extend the generic-parameter-method which was refactored to bounded wildcards and "both method signatures have same erasure" error appeared as a result 2018-09-14 16:01:02 +03:00
Tagir Valeev e890bb870b IDEA-198546 "Replace cast with variable" inserts unresolved reference 2018-09-12 16:10:45 +07:00
Roman.Ivanov 824da44572 CreateTypeParameterFromUsageFix: stop searching variants when inside enum 2018-09-12 10:54:42 +07:00
Roman.Ivanov 8eb4c7c109 SortContentAction: more accurate \n placement in presence of EOL comments: IDEA-198267 2018-09-10 19:04:32 +07:00
Tagir Valeev aee5f482a6 JoiningMigration: preserve comments in removed toString() call 2018-09-07 18:31:22 +07:00
peter 390caa70ad disable "swap if statements" intention where it would fail 2018-09-07 12:37:21 +02:00
Tagir Valeev 1e73838ca1 StreamToLoop: disallow peek which cannot finish normally as the result will not be compilable 2018-09-07 17:02:26 +07:00
Dmitry Batkovich 54ee69b6df functional expression can be folded quick fix should work in case of statement lambda 2018-09-06 11:48:09 +03:00
Tagir Valeev a0f1b41336 TerminalBlock: preserve comments after continue statement (not in the proper place though) 2018-09-03 19:57:02 +07:00
Roman Shevchenko 2bad8db30c [java] allows '@author' tag in module docs 2018-08-30 09:03:45 +03:00
Roman.Ivanov 2de5249609 SortContentAction: fix \n placement, better layout 2018-08-30 11:33:05 +07:00
Roman.Ivanov a816ff3861 SortContentAction: fix EOL comment capturing another elements while codegen 2018-08-30 11:31:17 +07:00
Roman.Ivanov 40ba62d4d8 SortContentAction: fix javadoc movement while sorting enum constants 2018-08-30 11:31:17 +07:00
Anna Kozlova 56eface1fa expand static import: available on the onDemand import (IDEA-175102) 2018-08-29 11:46:30 +03:00
Anna Kozlova de2d0de27f make static: remove inappropriate modifiers, add method body if needed (IDEA-197813) 2018-08-27 15:33:03 +03:00