Commit Graph

3586 Commits

Author SHA1 Message Date
Roman Shevchenko 193aa1f2cf [tests] more cases for enhanced switch statements highlighting tests 2018-11-13 13:27:30 +01:00
Tagir Valeev 8545659a0a StreamToLoop test: ternary in return is supported now 2018-11-11 18:05:27 +07:00
Roman Shevchenko 35ca6e9efd [java] validates container annotation "concreteness" (IDEA-201354) 2018-11-09 22:09:35 +01:00
Roman Shevchenko 14bc258e3f [java] restores multifaceted switch labels support (parser/PSI + basic highlighting) 2018-11-09 18:22:32 +01:00
Roman Shevchenko 5740f632e6 [java] reverts multifaceted switch labels support 2018-11-08 21:24:31 +01:00
Roman Shevchenko fdf6239bfc Cleanup (formatting) 2018-11-08 17:12:29 +01:00
Roman Shevchenko dca9f4a33d [java] multifaceted switch labels: basic highlighting (IDEA-196643) 2018-11-08 17:11:20 +01:00
Tagir Valeev eda6bb3c28 FunctionHelper#registerReusedElements: pass qualifier only
Because ::xyz part is not actually reused, comments from there are not preserved.
2018-11-08 17:30:50 +07:00
peter 1c50ca6d08 java completion: remove irrelevant suggestions after Unresolved:: (IDEA-201798)
to enable chain completion, which only works when there are no other suggestions
2018-11-08 09:22:18 +01:00
Anna.Kozlova c8dc243d71 redundant suppression (fall through switch stmt): ensure suppressed will be reported by inspection (IDEA-201885) 2018-11-07 17:58:39 +01:00
Anna.Kozlova 7334c6e736 suggest to create class with lower case first letter if ref is located in type element/ref list (IDEA-201744) 2018-11-07 13:51:27 +01:00
Tagir Valeev 2c7124b0b0 ExpressionUtils#getTopLevelExpression; used in SurroundWithTryCatchFix
Fixes EA-131551 - NPE: EnsureCodeBlockImpl.splitIf
We need to avoid custom logic for processing && chains, etc. in RefactoringUtil#ensureCodeBlock.
2018-11-07 10:45:38 +07:00
Anna.Kozlova 316f8bfc63 change extends <-> implements: ensure resulted list is formatted (IDEA-201751)
lists are created from light elements which are created from canonical texts and they just do not contain whitespaces
2018-11-06 19:04:10 +01:00
Anna.Kozlova df236e8c91 check compiler version (IDEA-163104)
compiler will be chosen as max(module compiler, project compiler)
2018-11-06 10:47:58 +01:00
Anna.Kozlova 4be054181c testdata for IDEA-171701 2018-11-06 10:47:57 +01:00
Tagir Valeev 11e73d577f RedundantStringOperation: id changed, merger updated (IDEA-CR-34351) 2018-11-04 10:54:34 +07:00
Roman Shevchenko 5d10b37246 [java] enhanced 'switch' statements: basic highlighting (IDEA-196643) 2018-11-02 18:22:34 +01:00
Roman Shevchenko 95b4898527 Cleanup (formatting) 2018-11-02 18:09:05 +01:00
Anna.Kozlova 2ef3685dd6 don't suggest casts for assignable types (IDEA-201457) 2018-10-30 16:09:23 +01:00
Pavel Dolgov e6e432446a Java: Highlight unreachable assignment of array element (IDEA-199556) 2018-10-26 13:11:13 +03:00
Anna.Kozlova 382cf50470 ignore type arguments on calls on raw types (IDEA-201219) 2018-10-25 16:20:57 +02:00
Anna.Kozlova af3e15a689 highlight method call: don't ignore args with applicable calls as they may still cause parent call incompatibility
IDEA-201175
2018-10-25 16:20:56 +02:00
Tagir Valeev 2e36108630 SimplifyBooleanExpressionFix: support always-false last disjunct in if
Fixes IDEA-200961 Simplification of "!list.add(type) is always false" may change code semantic
2018-10-23 17:44:26 +07:00
Tagir Valeev 747aec38c9 ConvertSwitchToIfIntention: better comments handling 2018-10-23 15:34:51 +07:00
Anna.Kozlova 50b66d9d4b method reference overloads: second search should provide actual parameter types with 1 offset (IDEA-200218) 2018-10-22 17:02:20 +02:00
Anna.Kozlova 9aa64b30d9 inference: allow child session inference if containing method is not generics 2018-10-19 17:52:43 +02:00
Tagir Valeev e79ea86e18 EnsureCodeBlock: support or-chains in return/lambdas 2018-10-18 19:21:37 +07:00
Anna.Kozlova 265764b961 fix testdata 2018-10-18 11:12:33 +02:00
Tagir Valeev 6e5d42e80b afterAddFinally.java: whitespace fixed 2018-10-18 10:42:21 +07:00
Tagir Valeev 50abafa3f8 UnwrapSwitchLabelFix: when only one switch branch is reachable
Fixes IDEA-200651 Analysis for 'switch' statements may determine always truthy conditions on branches in addition to always falsy
Minor refactoring of reporting in DataFlowInspectionBase
2018-10-17 16:39:25 +07:00
Tagir Valeev 5878fde5e9 Add 'catch' block after incomplete try (final piece of IDEA-200560) 2018-10-17 13:04:54 +07:00
Tagir Valeev 3eaa3ff64f Add 'finally' block fix (part of IDEA-200560) 2018-10-17 12:17:52 +07:00
Anna.Kozlova 3b68fe09e7 redundant suppressions in editor: ensure suppressions from injections are processed 2018-10-12 19:21:31 +02:00
Tagir Valeev 35de5a903d 'compare()' method can be used to compare primitives -> 'compare()' method can be used to compare numbers 2018-10-12 12:41:24 +07:00
Tagir Valeev 95f2337448 UseCompareMethod: support boxed inputs and suggest "compareTo"
Allows to do IDEA-200365 in three steps now
2018-10-12 12:22:38 +07:00
Tagir Valeev 66504c8088 BoolUtils: negate the equality token for float/double as this does not change the semantics (only >, >=, <, <= change) 2018-10-12 10:34:56 +07:00
Anna.Kozlova 6fa0522d1b remove redundant suppressions: allow unrelated comment inside same noinspection comment 2018-10-11 15:57:00 +02:00
Anna.Kozlova 2733df787f preserve comments when remove redundant type arguments 2018-10-10 18:18:09 +02:00
Tagir Valeev cee88f887b FindFirstMigration: use ifPresent when stream element type is primitive and the final statement is an assignment
This case is possible only if we have no non-final locals updated in the loop, so the assignment updates field or array element.
Using common assignment scenario may not work as primitive optionals lack map/filter operations
Fixes IDEA-200209 "Replace with findFirst" produces incompilable code
2018-10-10 15:55:53 +07:00
Pavel Dolgov a2c0f2202c Java: Improved inspection "Join Declaration And Assignment" - handle C-style array declarations (IDEA-177132) 2018-10-09 15:08:01 +03:00
Pavel Dolgov 1402f1a2f6 Java: Improved inspection "Join Declaration And Assignment" - simplify handling of comments (IDEA-177132) 2018-10-09 13:29:33 +03:00
Anna.Kozlova 291c5cb03b unchecked warnings: don't check containing class parameters (IDEA-194678) 2018-10-08 18:57:16 +02:00
Pavel Dolgov d8f1620454 Java: Improved inspection "Join Declaration And Assignment" - simplify handling of comments (IDEA-177132) 2018-10-08 13:34:50 +03:00
Tagir Valeev 1554b0c513 DeleteSwitchLabelFix: check again whether the whole branch should be removed when fix is actually applied
Fixes IDEA-200021 Red code after applying 'Fix all 'Constant conditions and exception' problems in the file' with multiple case labels
2018-10-08 14:09:25 +07:00
Tagir Valeev c09250da45 CommentTracker#replaceAndRestoreComments: try to keep comments after the statement (not move them to the front) 2018-10-08 14:09:24 +07:00
Tagir Valeev 5663e0bde8 IDEA-200030 Quick-fix to remove unreachable should remove body only if previous branch has 'break' at the end 2018-10-08 10:57:50 +07:00
Pavel Dolgov 1245d379ff Java: Improved inspection "Join Declaration And Assignment" - preserve 'final' (IDEA-177132) 2018-10-05 20:02:21 +03:00
Pavel Dolgov 0dcbd3f6e5 Java: Improved inspection "Join Declaration And Assignment" - corner case handled (IDEA-177132) 2018-10-05 17:34:02 +03:00
peter c9694995ac IDEA-199875 Rank println higher than print 2018-10-05 11:25:23 +02:00
Tagir Valeev 422d8fad2f Rename Java inspections
Imperative names changed to declarative
Keywords/method names quoted
Cosmetics
2018-10-05 14:01:19 +07:00