Commit Graph

1598 Commits

Author SHA1 Message Date
Anna Kozlova d3928de54b change method return type: avoid changes in hierarchy when assignable (IDEA-209931)
GitOrigin-RevId: 43166bdd806d2a0b6ed2e72e6630c9cf53fba7b4
2019-04-28 19:25:11 +03:00
Tagir Valeev 3368f8e2d5 ParenthesesUtils#removeParensFromPolyadicExpression: check operand validity
As processing the previous operands may completely rewrite the whole polyadic expression, we have to stop if this happens
No need to find the replacement and process the tail: it's already processed in removeParensFromParenthesizedExpression
Fixes EA-141996 - PIEAE: CompositePsiElement.getContainingFile

GitOrigin-RevId: 64162346a612e2d95eec426419bef51d6c5d46a3
2019-04-28 17:44:13 +03:00
Anna Kozlova 38f5055d00 replace type with var: allow anonymous type replacement (IDEA-210534)
though interface to implementation replacement may lead to implementation type propagation, anonymous type can't be propagated so it's safe to be used as var

GitOrigin-RevId: cae306614efcb92551f2aa907f8d66e1bd2db930
2019-04-28 16:02:06 +03:00
Tagir Valeev 9af3284048 StreamToLoopInspection: simplify getEffectiveQualifier usage; support unqualified Iterable.forEach, Map.forEach
Review ID: IDEA-CR-46452

GitOrigin-RevId: 7622f0f1274d9f23bfaef88096b3eedd2b4d18a6
2019-04-28 14:53:13 +03:00
Tagir Valeev 723c055455 FinishMarker: use the first movable value when mayNeedMarker is true (may generate shorter code) 2019-04-19 15:02:32 +07:00
Tagir Valeev 179a83f60e TrivialFunctionalExpressionUsageInspection: support parentheses for anonymous class 2019-04-19 11:55:23 +07:00
Tagir Valeev e13567df50 Better comment handling in ternary->if conversion & stream-to-loop 2019-04-19 11:45:55 +07:00
Tagir Valeev 9e1982a819 ExpressionUtils#getQualifierOrThis -> getEffectiveQualifier, nullable now (cannot construct this expression for outer anonymous class)
Fixes EA-140652 - assert: JavaParserUtil.parseFragment
2019-04-18 13:04:43 +07:00
Tagir Valeev e0d1fab43d ConvertToSingleReturn: default return value tuned; define it always before actual conversion 2019-04-12 17:19:54 +03:00
Tagir Valeev cb2e86701d IterableUsedAsVararg: fixes according to review IDEA-CR-45949 2019-04-10 14:49:18 +07:00
Roman.Ivanov 46ae614bd3 AddExceptionToExistingCatchClause: remove unrelated to java 6 test 2019-04-09 14:12:34 +07:00
Roman.Ivanov 970afc84ff JoiningMigration: remove unnecessary side effect check for prefix: IDEA-207456 2019-04-09 12:34:13 +07:00
Tagir Valeev 4598cf2d46 IDEA-209951 Inspection to detect when collection is accidentally passed as vararg and will be wrapped into one-element array 2019-04-04 19:21:52 +07:00
Roman.Ivanov 0f8d589a14 Remove GeneralizeCatchFix as more general alternative exists 2019-04-03 12:37:11 +07:00
Roman.Ivanov 6d37214f4d AddExceptionToExistingCatch: fix non replacement intention text 2019-04-03 12:24:01 +07:00
Roman.Ivanov 7f160662a5 AddExceptionToExistingCatch: supply more concrete intention text 2019-04-03 11:59:52 +07:00
Bas Leijdekkers fc1cc50ff9 IG: merge two inspections and enable at INFORMATION level (IDEA-30715)
merging "Multiple variables in one declaration" and "Multiple typed variables in one declaration" inspections
2019-04-02 19:55:05 +02:00
Roman.Ivanov ed9d67604e AddExceptionToExistingCatch: support language levels < 7 2019-04-02 17:30:17 +07:00
Roman.Ivanov 5c55f93cd1 AddExceptionToExistingCatch: do not suggest catches if its successors are assignable to exception type: IDEA-208457 2019-04-02 16:10:45 +07:00
Tagir Valeev e85e0ebdfb LambdaCanBeMethodReferenceInspection: fix EA-140341 CCE; cleanup 2019-03-26 10:42:03 +07:00
Tagir Valeev 8fa34c7dbe LambdaCanBeMethodReferenceInspection: allow parenthesized qualifier 2019-03-25 10:57:30 +07:00
Tagir Valeev a26ebd6de8 Convert to single return: fix for incorrect code 2019-03-20 10:47:52 +07:00
Tagir Valeev 38f4026184 IDEA-209056 Switch, try-catch, synchronized support; avoid conflicting var names; fix reads of uninitialized vars 2019-03-19 17:35:03 +07:00
Tagir Valeev 5b3d311505 IDEA-209056 Action to transform method with multiple returns into the method with single exit point
First implementation
2019-03-19 15:02:38 +07:00
Pavel Dolgov 79022c29ce Java: Intention that wraps list/set/map with Collections.unmodifiable - don't suggest on the left-hand side of assignment (IDEA-208885) 2019-03-15 13:16:09 +03:00
Bas Leijdekkers 5f578b9250 Java: fix "Move into anonymous object" quick fix problems (EA-139632) 2019-03-14 17:59:35 +01:00
Tagir Valeev 6bef676307 CollectMigration: do not wrap nullable values with toUnmodifiableList/Set (IDEA-207976) 2019-03-14 11:10:38 +07:00
Tagir Valeev 77b6a04c45 IDEA-207874 Inspection to replace Map.keySet().contains(K) with Map.containsKey(K) 2019-03-12 13:54:25 +07:00
Tagir Valeev 7906dd0dcd RedundantCastUtil: fix isCastRedundant (avoid checking another cast) 2019-03-11 17:53:32 +07:00
Bas Leijdekkers 27c17db32b IG: make ExpressionUtils.resolveLocalVariable() skip parentheses 2019-03-08 11:32:41 +01:00
Tagir Valeev 43b636f63f UiInterceptors: ability to intercept UI components in tests and emulate user action
Currently only popup chooser is supported
A usage example added for AddExceptionToExistingCatchTest
2019-03-06 13:37:43 +07:00
Pavel Dolgov 564bb424de Java: Intention that wraps list/set/map with Collections.unmodifiable - use results of DFA, test fixed (IDEA-93154) 2019-02-25 17:55:54 +03:00
Bas Leijdekkers 767bf19c4a don't suggest to replace annotated type elements with diamond (IDEA-207586) 2019-02-23 19:14:13 +01:00
Pavel Dolgov 8ce43b883c Java: Intention that wraps list/set/map with Collections.unmodifiable - handle ternary 'if' (IDEA-93154) 2019-02-21 18:03:24 +03:00
Pavel Dolgov 96b9ab4f80 Java: Intention that wraps list/set/map with Collections.unmodifiable - handle the caret at the end of the expression (IDEA-93154) 2019-02-21 18:03:24 +03:00
Pavel Dolgov 0267b104b3 Java: Intention that wraps list/set/map with Collections.unmodifiable - check the required type (IDEA-93154) 2019-02-21 18:03:24 +03:00
Tagir Valeev 1f132fb51e ConstantConditionalExpressionInspection: respect precedence when creating type-cast
Fixes EA-137355 - CCE: ConstantConditionalExpressionInspection$ConstantConditionalFix.doFix
Also fix removing parentheses inside RemoveRedundantCastUtil#removeCast
2019-02-21 13:14:16 +07:00
Pavel Dolgov 63092d9c2e Java: Intention that wraps list/set/map with Collections.unmodifiableList/Set/Map (IDEA-93154) 2019-02-20 18:00:15 +03:00
Pavel Dolgov ec58711cf3 Java: Quick fix for missing 'return' in lambda body (IDEA-169551) 2019-02-20 13:27:57 +03:00
Tagir Valeev 5c0748b0bc StreamApiMigrationInspection: BufferedReaderLines: support parentheses around readLine in while scenario 2019-02-18 12:37:12 +07:00
Tagir Valeev 7a897157f1 MergeFilterChainAction: support parentheses 2019-02-08 15:24:53 +07:00
Anna.Kozlova a98a18ce8a calc expected type on the left of assignment based on standalone expression type from the right side (IDEA-199273) 2019-02-07 15:59:00 +01:00
Artemiy Sartakov 043c2d563e Field can be local: added support for nested and local classes (IDEA-206647) 2019-02-07 17:27:00 +07:00
Tagir Valeev 5de8f58f34 Replace with trivial lambda default fixed after 2cfd1ece23 2019-02-07 10:58:44 +07:00
Pavel Dolgov d9412eba69 Java: Fixed typos in test data file names (IDEA-203895) 2019-02-06 18:40:08 +03:00
Bas Leijdekkers 4e7a841173 qualify field access in initializer when shadowed by new declaration (IDEA-173780) 2019-02-06 16:09:30 +01:00
Anna.Kozlova dac182b6d9 var -> explicit type: fix for foreach parameter (IDEA-206640) 2019-02-05 16:36:29 +01:00
Artemiy Sartakov 1b87c1a508 ConvertToLocalInspection: changed quick-fix to explicitly show type of code block where field is used (IDEA-CR-42222) 2019-02-05 13:26:10 +07:00
Anna.Kozlova 1ace9ab2c3 lambda -> method ref: reuse comment tracker (IDEA-189934) 2019-02-04 15:21:43 +01:00
Pavel Dolgov cf34272833 Java: More tests for intention to split switch branch with multiple values into separate branches (IDEA-203895) 2019-02-04 12:33:41 +03:00