Commit Graph

765 Commits

Author SHA1 Message Date
Roman Shevchenko 7c8d607d8d [tests] test data inlined 2016-11-03 16:59:34 +01:00
Tagir Valeev ef215da116 StreamToLoopInspection: disable for raw types (IDEA-163493), disable for unresolved method references 2016-11-03 09:47:40 +07:00
Anna.Kozlova 8067101fcf EA-91047 - IOE: PsiJavaParserFacadeImpl.createExpressionFromText 2016-11-02 17:02:29 +01:00
Tagir Valeev 0fb67d4f9d StreamToLoopInspection fixes: toArray intermediate list type fixed; keywords are filtered out from possible var names; context added to expression passed to BoolUtils; supported inside method calls 2016-11-02 13:50:36 +07:00
Tagir Valeev 0ae5c0f1ae StreamToLoopInspection: fixed flatMap with method reference argument 2016-11-01 18:46:15 +07:00
Tagir Valeev 9caa6d5ede IDEA-161198 Migration from Stream API back to for loops 2016-11-01 15:38:57 +07:00
Tagir Valeev efa6763db1 ComparatorCombinatorsInspection: fixed for incomplete statement (EA-90916) 2016-11-01 09:38:18 +07:00
Pavel Dolgov 689d26b3e2 Java: Quick fix for importing a package the current module doesn't read by adding "requires" statement to the module info (IDEA-162762) 2016-10-31 16:42:38 +03:00
Tagir Valeev 6e3d0c6c0e IDEA-163082 "can be replaced with addAll" inspection suggests a recursive call; support "this" qualifier for collect/addAll conversion 2016-10-25 11:38:24 +07:00
Tagir Valeev 4ce59ee865 Stream API Migration: do not add type arguments if a type is a wildcard type 2016-10-25 11:10:08 +07:00
Tagir Valeev d51f09d0d5 Stream API Migration: fix cases when boxed collection is iterated with primitive parameter (inspired by PR https://github.com/JetBrains/intellij-community/pull/455 by FHannes) 2016-10-24 17:44:45 +07:00
Tagir Valeev 7620508bc3 Stream API migration: ignore mutable variables in nested lambdas/anonymous classes; add type argument to map/mapToObj calls where necessary 2016-10-24 11:01:06 +07:00
Tagir Valeev aff7104a99 Stream API migration: add narrowing cast if necessary when replacing += with sum() 2016-10-24 10:28:29 +07:00
Tagir Valeev 3df2d1925d IDEA-162945 Stream API migration: support cases where variable is modified and reassigned 2016-10-21 15:09:35 +07:00
Tagir Valeev 8c6088647b IDEA-162875 Stream API migration: support conversion to BufferedReader.lines() 2016-10-21 12:10:10 +07:00
Tagir Valeev 74ae9731a8 IDEA-162694 Improve "Merge filter chain" intention 2016-10-20 11:19:25 +07:00
Anna.Kozlova b815947ac2 provide fix all intention for local inspections paired to global tools (IDEA-162507) 2016-10-18 10:30:52 +02:00
Tagir Valeev ab6907ca07 IDEA-162696 Intention "Merge filter chain" does not add parentheses if necessary 2016-10-18 13:49:07 +07:00
Tagir Valeev ee1bd69c2e IDEA-162574 False positive 'Lambda can be replaced with method reference' 2016-10-18 12:53:15 +07:00
Tagir Valeev d807cd3b24 add missing StreamApiMigration test 2016-10-18 10:54:33 +07:00
Tagir Valeev 86eaaf22bf IDEA-160988 Add inspection to merge adjacent Stream API calls 2016-10-17 17:17:46 +07:00
Anna.Kozlova 5af6b0be16 defer assignment: choose anchor from same code block
EA-48621 - assert: CompositeElement.addChild
2016-10-12 14:04:38 +02:00
Anna.Kozlova 44c7364228 extends type parameter: allow wildcards (IDEA-162229) 2016-10-10 14:19:25 +02:00
Tagir Valeev eaff2cebb6 fix invalid negative tests for quick-fixes 2016-10-10 18:24:14 +07:00
Tagir Valeev c844054768 IDEA-162190 Inspection to convert anonymous ThreadLocal subclass to ThreadLocal.withInitial 2016-10-10 15:21:24 +07:00
Tagir Valeev aa605118de LightQuickFixTestCase: Check whether <caret> is present in "before" files; wrong tests fixed 2016-10-07 16:34:42 +07:00
Tagir Valeev ebf320b288 Stream API migration various fixes
1. findFirst() scenario can pull previous assignment (not declaration) now
2. anyMatch() fix did not work if there's single assignment to non-variable (e.g. array element)
3. if non-adjacent return becomes unreachable after findFirst()/anyMatch(), it returned automatically now
2016-10-07 11:59:52 +07:00
Tagir Valeev 0ad3891e96 IDEA-162157 Stream API migration: support counted for loop (both outer and flatMapped) 2016-10-06 17:59:25 +07:00
Tagir Valeev 46f9ce3e03 fix cast introduction in LambdaCanBeMethodReferenceInspection#replaceLambdaWithMethodReference 2016-10-05 12:24:55 +07:00
Anna.Kozlova e3f966a2ed @SuppressWarning for foreach and try-with-resources parameters 2016-10-04 11:07:24 +02:00
Tagir Valeev a53a0f3d61 StreamAPI migration: limited sorting support 2016-10-04 15:55:00 +07:00
Tagir Valeev 10c8616d19 StreamAPI migration: propose to use any/all/noneMatch if next return is not true/false (using || or &&) 2016-10-04 15:32:19 +07:00
Tagir Valeev 6723bcc1ea ExpressionUtils#getAssignment now returns simple assignments only (not compound assignments) 2016-10-04 14:16:08 +07:00
Tagir Valeev c6cf323132 ControlFlowUtils#statementBreaksLoop; StreamApiMigrationInspection#getInitializerUsageStatus simplified 2016-10-04 09:49:28 +07:00
Tagir Valeev 3c07adbe09 Stream API migration: replace with findFirst().ifPresent() chain 2016-10-03 12:43:45 +07:00
Tagir Valeev b53646340b Stream API migration: support nested anyMatch 2016-10-03 12:43:44 +07:00
Tagir Valeev df36bfcf5f IDEA-CR-14049 missing getType() added; support array initializers in Optional map 2016-09-30 16:53:43 +07:00
Tagir Valeev 355973cb56 IDEA-CR-13980: comments handling is simplified (they just extracted and placed before the condition) 2016-09-30 16:32:25 +07:00
Tagir Valeev 738994f1c0 IDEA-161925 Stream API migration: support toArray conversion, fixed mapping to initialized array, fixed final variable status, clean up in RefactoringUtil 2016-09-30 16:12:57 +07:00
Tagir Valeev 7cb4480fd1 StreamApiMigrationInspection: references to non-final variables in intermediate operations were incorrectly handled sometimes 2016-09-30 10:23:12 +07:00
Tagir Valeev 5cbf3d5a9b StreamApiMigrationInspection: correctly handle anonymous classes/lambdas (IDEA-CR-14138) 2016-09-30 10:04:58 +07:00
Tagir Valeev b9a06d65b9 IDEA-161861 Stream API migration should handle cases where result variable is not declared just before the for loop 2016-09-29 15:54:08 +07:00
Anna.Kozlova e149c3fa7d renamed static import -> import static (IDEA-161681) 2016-09-27 17:21:04 +02:00
Tagir Valeev 7e72d2fe9e OptionalIsPresentInspection: simplify isRaw() and isOptionalLambdaCandidate(); fix getComments(); add more tests (IDEA-CR-13980) 2016-09-27 12:01:07 +07:00
Tagir Valeev b141891dc1 StreamApiMigrationInspection: fix noneMatch()/allMatch() quick-fix name when continue is used; prettier Optional code generated in some cases 2016-09-27 11:21:17 +07:00
Anna.Kozlova 0c1b50e60f provide extends fix for overriding return types (IDEA-161739) 2016-09-26 18:14:53 +02:00
Tagir Valeev e69109e521 StreamApiMigrationInspection improvements: expression+break conversion to anyMatch; pull out cast of stream.findFirst().map(x -> (T)x).orElse(null) to (T) stream.findFirst().orElse(null) 2016-09-26 15:52:55 +07:00
Tagir Valeev 16e8ad126e IDEA-161706 Migration to Stream API: support primitive types int/long/double 2016-09-26 13:05:05 +07:00
peter 853fc23fe1 remove unnecessary parentheses in IDEA-161061 Quick-fix to replace nullableExpr.equals(...) with Objects.equals(nullableExpr, ...) (IDEA-CR-13960) 2016-09-21 10:50:32 +02:00
Tagir Valeev aadd111eda IDEA-161420 Quick-fix to replace if(optional.isPresent()) with better alternatives 2016-09-21 15:41:20 +07:00