Commit Graph

80 Commits

Author SHA1 Message Date
Tagir Valeev
8545659a0a StreamToLoop test: ternary in return is supported now 2018-11-11 18:05:27 +07: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
Tagir Valeev
e79ea86e18 EnsureCodeBlock: support or-chains in return/lambdas 2018-10-18 19:21:37 +07: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
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
85f0872d9b StreamToLoop: support parentheses inside flatMap 2018-09-19 12:26:21 +07: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
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
Tagir Valeev
0ee4ea1fad IDEA-195573 groupingBy test 2018-07-29 09:25:38 +07:00
Tagir Valeev
9d96fb9a63 IDEA-195573 Support collectingAndThen in Stream-to-loop (for now only if downstream is collection-based) 2018-07-29 09:14:48 +07:00
Tagir Valeev
a6643bdab2 StreamToLoopInspection: handle labeled expression statement (found by property testing) 2018-07-27 13:09:38 +07:00
Tagir Valeev
1325835ce7 StreamToLoop: support parenthesized collectors 2018-07-06 13:58:52 +07:00
Tagir Valeev
2217968c28 StreamToLoop: support functions in parentheses 2018-07-06 13:58:36 +07:00
Tagir Valeev
49a1e9e78a afterCommentInBlock: space restored (IDEA-CR-34134) 2018-06-26 15:46:35 +07:00
Tagir Valeev
1a38128af4 StreamToLoop: do not trim trailing whitespace for block lambdas
Fixes trailing line comment handling
2018-06-26 12:36:58 +07:00
Roman.Ivanov
5076e08145 set SPACE_BEFORE_COLON_IN_FOREACH true by default, fix tests 2018-06-26 12:04:00 +07:00
Roman.Ivanov
ae37e14386 fix foreach formatting in tests 2018-06-05 11:58:44 +07:00
Roman.Ivanov
5858ba478c fix tests for foreach formatting 2018-06-05 11:31:17 +07:00
Tagir Valeev
c76d9aba62 StreamToLoopInspection: support Map.forEach()
Fixes IDEA-190440 Convert usage of java.util.Map.forEach() to for (... entrySet()) loop
2018-04-19 12:12:40 +07:00
Tagir Valeev
c1f2c5c380 StreamToLoop: special handling of max().orElse(MIN_VALUE), etc. 2018-03-12 15:24:01 +07:00
Tagir Valeev
ebbdbbe432 StreamToLoop: special handling of skip(1) 2018-03-12 15:24:00 +07:00
Tagir Valeev
0da4fd17f3 IDEA-187214 Stream to loop inspection: support Java 10 toUnmodifiableList/Set/Map 2018-02-27 10:57:08 +07:00
Tagir Valeev
d5f9284f2e ExpressionUtils#isSimpleExpression: disable for non-final fields 2018-02-05 15:53:39 +07:00
Tagir Valeev
d7f09f6cdd StreamToLoop: support array slice (Arrays.stream(arr, from, to)) 2017-09-18 17:30:53 +07:00
Tagir Valeev
6e87cb9bfd RefactoringUtil#ensureCodeBlock enhanced and used in Surround with try-catch
Fixes IDEA-178781 "Surround with try-catch" QuickFix for "Unhandled exception" in a field initializer
Enables stream-to-loop in field initializer
Fixes stream-to-loop in for initializer
Disables stream-to-loop in for update
2017-09-12 13:34:43 +07:00
Tagir Valeev
2e611b4917 StreamToLoopInspection: reuse variable of inexact type (IDEA-167414) 2017-08-24 15:25:19 +07:00
Tagir Valeev
86874d0883 Fix IDEA-177668 "Replace stream chain with loop" exception on unresolved collection type 2017-08-17 16:36:34 +07:00
yarik
ced545552a [java formatter] c style comments formatting supported. Note, only single line comments or comments with each line starting with asterisks will be formatted, since by using /* and */ you 2017-06-20 14:48:26 +03:00
Roman Shevchenko
5e5c14c57e [java] raises language level to Java 9 2017-03-24 18:35:57 +01:00
Tagir Valeev
b0c584a295 IDEA-170033 Support raw-types when converting Iterable.forEach to loop 2017-03-22 16:51:46 +07:00
Tagir Valeev
f764692965 StreamToLoopInspection refactoring: strings replaced with actual PsiType's (as they are valid now); removed unnecessary code due to all PsiExpressions are also valid 2017-03-21 14:21:29 +07:00
Tagir Valeev
b5e80dfbd8 StreamToLoopInspection: disable elements which type is PsiIntersection type or PsiImmediateClassType which is not resolvable in outer context (fixes EA-97901); better diagnostic for cases like EA-97901 2017-03-01 12:37:17 +07:00
Tagir Valeev
4230df9ede StreamToLoop: VoidBlockLambdaFunctionHelper: recreate body if invalid (fixes EA-97022 - PIEAE: CompositePsiElement.getContainingFile) 2017-02-17 11:15:58 +07:00
Tagir Valeev
4351d56253 IDEA-167613 Exception converting Arrays.stream to loop with generics: test added 2017-02-03 17:07:29 +03:00
Tagir Valeev
7a4f84ead5 IDEA-167583 Uncompilable code after conversion Stream -> Loop with lambda 2017-02-03 00:19:56 +03:00
Tagir Valeev
a767bc9672 IDEA-167580 Uncompilable code after conversion Stream -> Loop with generics 2017-02-02 22:08:44 +03:00
Tagir Valeev
803b3aa940 IDEA-167588 Uncompilable code after conversion Stream -> Loop with unknown Stream sources 2017-02-02 21:52:15 +03:00
Tagir Valeev
2e1c753a6d IDEA-167578 Uncompilable code after convertion forEach -> Loop with generics wildcard 2017-02-02 21:52:14 +03:00
Tagir Valeev
80256c9bfb StreamToLoopInspection: support some simple StreamEx scenarios; support Java 9 takeWhile/dropWhile 2017-02-01 13:45:40 +03:00
Tagir Valeev
d8836c315d StreamToLoopInspection: support block void lambdas (and returns in forEach not inside nested loop) 2017-01-31 16:29:03 +03:00
Tagir Valeev
c15f721206 StreamToLoopInspection: support Iterable.forEach() 2017-01-31 16:29:03 +03:00
Tagir Valeev
fb6ba726e5 StreamToLoop tests grouped 2017-01-27 17:41:53 +07:00
Tagir Valeev
2d57e55143 StreamToLoopInspection: support groupingBy(..., counting()/summingInt()/summingLong()/summingDouble()/mapping(summing...)) 2017-01-24 17:56:19 +07:00
Tagir Valeev
1820f2db99 StreamToLoopInspection: allow custom sources when option is set 2017-01-24 15:34:50 +07:00
Tagir Valeev
ed51fbe99b LambdaRefactoringUtil#convertToLambda: check context when deciding whether to add qualifier 2017-01-24 13:56:26 +07:00
Tagir Valeev
305c101ca6 StreamToLoop: fixed method references unwrap when functional interface type parameter is captured wildcard with upper bound 2017-01-20 17:52:44 +07:00
Tagir Valeev
8924fda614 StreamToLoopInspection: fixed unqualified reference to stream() method handling 2017-01-16 14:44:34 +07:00
Tagir Valeev
5e742cdfac StreamToLoopInspection: reuse final variable as non-final (removing "final" keyword) (IDEA-CR-17006) 2016-12-30 15:09:55 +07:00
Tagir Valeev
d707262f9d StreamToLoop: merge sorted().toArray() and sorted().collect(Collectors.toList()) into single step 2016-12-27 17:47:44 +07:00