Commit Graph

127 Commits

Author SHA1 Message Date
Tagir Valeev 036f556c55 ControlFlowUtils#statementBreaksLoop: fix void return case 2017-04-21 17:52:15 +07:00
Tagir Valeev d0bd812d05 BoolUtils#getNegatedExpressionText: push negation down into || and && 2017-04-10 16:11:18 +07:00
Tagir Valeev 478cae19bf IDEA-170032 Replace with foreach is not proposed in alt-enter
Now both options (when unchecked) only disable warning and batch-mode replacement, but the action is still available as an intention.
2017-03-30 13:07:18 +07:00
Tagir Valeev b2cd46bdeb StreamApiUtil: fix addition of map operation when object-object cast is involved 2017-03-14 13:19:47 +07:00
Tagir Valeev 909f89ab6e StreamApiMigration: disallow reassigning counting loop variable 2017-02-20 13:29:52 +07:00
Tagir Valeev 21b3f46f1a StreamApiMigration: collect(joining()): allow separator addition based on counting loop variable value 2017-02-19 18:37:49 +07:00
Tagir Valeev b8c9f1a1e0 IDEA-168203 Follow-up: do not suggest if initializer may throw checked exception or accesses non-final variable 2017-02-17 12:47:39 +07:00
Tagir Valeev 024c0831ac IDEA-168203 StreamApiMigration: accept more standard collection constructors 2017-02-15 11:46:18 +07:00
Tagir Valeev fc3f0bb09d SimplifyStreamApiCallChainsInspection: convert IntStream.range(0, Math.min(limit, arr.length)).map(idx -> arr[idx]) to Arrays.stream(arr).limit(limit) and so on 2017-02-15 11:46:18 +07:00
Tagir Valeev 95ed6b3fd6 StreamApiMigrationInspection: use Stream.of, etc. to iterate explicitly created array 2017-02-14 14:27:23 +07:00
Tagir Valeev 05ccacfa5f StreamApiMigration: check for label not pointing to the statement (Fix for EA-96734 - NPE: TerminalBlock.extractOperation) 2017-02-13 16:14:55 +07:00
Tagir Valeev 95baf652ae StreamApiMigration: support joining with prefix and suffix 2017-02-06 14:40:21 +07:00
Tagir Valeev 9fbe22a647 afterAnyMatchAssignmentBooleanInverted: fixed after automatic simplification 2017-02-03 16:46:00 +03:00
Tagir Valeev 0bc8981efa IDEA-167574 Provide inspection for find redundant StreamSupport.stream
Refactor SimplifyStreamApiCallChainsInspection
2017-02-03 10:40:11 +03:00
Tagir Valeev 9246190c9c StreamApiMigrationInspection: suggest to use takeWhile() in Java-9 2017-02-01 19:46:04 +03:00
Tagir Valeev e8c6ba183b IDEA-167263 Stream API migration does not work when replacing simple loop on array of primitive types (int, long, double) 2017-01-30 14:00:52 +03:00
Tagir Valeev 533f500368 IDEA-167088 Stream API migration: support joining with delimiter 2017-01-26 09:42:45 +01:00
Tagir Valeev 5f29e676e6 IDEA-167088 Stream API migration: allow resulting StringBuilder usages in concatenation 2017-01-25 14:36:47 +07:00
Tagir Valeev 4e6237cc7f IDEA-167088 Stream API migration: intermediate mapping added 2017-01-25 13:36:56 +07:00
Tagir Valeev bfa2fb9348 IDEA-167088 Stream API migration: support simple joining cases: fixed AT_WANTED_PLACE case 2017-01-25 13:05:08 +07:00
Tagir Valeev 16ddd276ed IDEA-167088 Stream API migration: support simple joining cases 2017-01-25 12:46:01 +07:00
Tagir Valeev 327e51962b IDEA-166814 Stream API migration: support more post-loop steps 2017-01-19 14:14:20 +07:00
Tagir Valeev cbd273dda8 StreamApiMigration: minor fixes in FindFirst scenarios 2017-01-18 13:52:12 +07:00
Tagir Valeev a363362459 StreamApiMigration: automatically simplify IntStream.range().mapXyz chains; IndexedContainer#getElementType: do not erase 2017-01-16 17:43:50 +07:00
Tagir Valeev 5b04785164 IDEA-166499 Stream API migration: support array filling in a loop 2017-01-12 17:37:10 +07:00
Tagir Valeev 5a599cdffd IDEA-166424 Guava create collections , nonsupport replace with stream API 2017-01-12 11:55:44 +07:00
Tagir Valeev 347bd66e81 StreamApiMigrationInspection: enable flatMap with primitive type change 2017-01-12 11:18:29 +07:00
Tagir Valeev 0957d52585 Convert for-loop with Collections.addAll: support primitive types; switch off when count expression is used; wrong contracts removed 2017-01-12 11:04:58 +07:00
Tagir Valeev 1ee8a1fbfe IDEA-166211 Convert for-loop with Collections.addAll inside into Java 8's stream API calls chain 2017-01-11 15:57:54 +07:00
Tagir Valeev b3a181a091 StreamApiMigrationInspection: refactoring of collect scenarios: CollectTerminal interface extracted and used; all forEach scenarios moved to ForEachMigration; cosmetics 2017-01-11 14:37:50 +07:00
Tagir Valeev 3738e54fee StreamApiMigration: add parentheses if necessary when .stream() can be omitted (fix for EA-93812). 2017-01-10 09:42:03 +06:00
Tagir Valeev 01d7ee7d3c IDEA-165942 Inspection to replace method call in a loop with bulk operation 2016-12-30 13:01:31 +07:00
Tagir Valeev 9cae3c25fa IDEA-165790 Stream API migration: support distinct() with collect(toList()) 2016-12-22 16:33:06 +07:00
Tagir Valeev e2b7d60680 StreamApiMigrationInspection: support limit count with separate variable 2016-12-22 12:33:15 +07:00
Tagir Valeev fb7790606c StreamApiMigrationInspection: try continue extracting operations when limit is successfully peeled off 2016-12-21 16:04:42 +07:00
Tagir Valeev 6341a52ccd StreamApiMigrationInspection: support postfix limit conversion (like if(count++ > 100) break; => limit(102)) (IDEA-CR-16910) 2016-12-21 13:45:42 +07:00
Tagir Valeev a15916ae24 IDEA-165063 Stream API migration: support simple limit conversions 2016-12-20 16:31:57 +07:00
Tagir Valeev e778bb8680 StreamApiMigrationInspection: chained computeIfAbsent generated incorrect code 2016-12-20 10:56:31 +07:00
Tagir Valeev 50223c222e Fix IDEA-165466 Stream API migration: automatically simplify emptyList().stream() to empty()
SimplifyStreamApiCallChainsInspection refactoring: simplifyCollectionStreamCalls extracted;
2016-12-15 17:13:14 +07:00
Tagir Valeev 54f7edf064 StreamApiMigrationInspection: use collect when computeIfAbsent is used; VariableAccessUtils#variableIsUsed instead of ReferenceSearch (IDEA-CR-16490) 2016-12-07 12:51:54 +07:00
Anna.Kozlova e55fbf3f1d isEffectivelyFinal: disallow effectively final variables to be initialized twice (IDEA-165060) 2016-12-06 17:54:19 +01:00
Tagir Valeev 203c11fca6 IDEA-164822 Migrate to Stream API: support toMap/groupingBy scenarios 2016-12-02 16:30:57 +07:00
Tagir Valeev 9fe8c96b78 OptionalUtil#getMapTypeArgument: check nulls; remove 0-arg check 2016-11-11 12:02:36 +07:00
Tagir Valeev 7e574d661c IDEA-163764 "Replace Optional.isPresent() checks with functional-style expressions" create uncompilable code
IDEA-163463 Stream API migration: type argument before map appears sometimes when it's unnecessary
2016-11-11 11:28:44 +07:00
Tagir Valeev ff8a32476a StreamApiMigrationInspection: NPE fixed (EA-91387) 2016-11-09 12:27:15 +07:00
Tagir Valeev 21564bba7b IDEA-163627 Simplify optional.isPresent() inspection could better handle some specific cases
IDEA-163462 Simplify Optional.isPresent() ? Optional.get() : ...
2016-11-07 17:23:00 +07: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