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
Tagir Valeev
54eb6ce6af
StreamToLoop: support condition inside flatMap
2016-12-27 14:40:01 +07:00
Tagir Valeev
96cf01152f
StreamToLoop/ToPrimitiveArrayTerminalOperation: reassign final array making it possible to reuse existing variable
2016-12-27 13:58:09 +07:00
Tagir Valeev
ae5d133904
StreamToLoopInspection: sorted() operation (currently for non-primitive streams only)
2016-12-27 13:13:53 +07:00
Tagir Valeev
fb12495825
StreamToLoopInspection: unwrap && and || chains; copy return statement in found/not found places; do not eagerly evaluate non-trivial ternary branch
2016-12-27 12:38:05 +07:00
Tagir Valeev
c9c574e428
StreamToLoopInspection: preserve comments; CommentTracker: now possible to delete element first and only after that register unchanged parts.
2016-12-23 18:09:43 +07:00
Tagir Valeev
1e33755e09
StreamToLoopInspection: reuse existing variable if we should reassign it in loop, but it's possible to use it as non-final
2016-12-23 13:30:08 +07:00
Tagir Valeev
7ebe6f583d
StreamToLoop: fixed comparator parentheses wrapping; ParenthesesUtils changes reverted (unnecessary)
2016-12-20 09:48:30 +07:00
Tagir Valeev
a94e87e968
StreamToLoop: inline simple common method references
2016-12-19 18:43:21 +07:00
Tagir Valeev
437d89ac15
StreamToLoop comparator support: insert parentheses if necessary
2016-12-19 16:50:08 +07:00
Tagir Valeev
204a045f0a
StreamToLoop: min/max: Comparators as lambdas/method references supported; Comparator.naturalOrder() and reverseOrder() inlined.
2016-12-19 16:35:41 +07:00
Tagir Valeev
4b066b1b90
StreamToLoopInspection fixed when collection result is non-trivial generic type involving ? extends wildcards
2016-12-16 16:43:58 +07:00
Tagir Valeev
9c78db8af0
FunctionHelper: fix renaming in lambdas if autogenerated name conflicts with the existing one
2016-12-16 11:12:15 +07:00
Tagir Valeev
f04e5ecef5
IDEA-165397 Replace stream API with loop: support lambdas as toArray argument
2016-12-15 09:52:13 +07:00
Tagir Valeev
81e951bf90
StreamToLoopInspection#ensureCodeBlock refactored to use PsiTreeUtil.mark/releaseMark (IDEA-CR-16755)
...
RefactoringUtil#expandExpressionLambdaToCodeBlock reverted (now changes there unnecessary)
void single-expression lambda support
2016-12-14 17:57:02 +07:00
Tagir Valeev
e4f40bf51f
StreamToLoopInspection: fix when stream is inside multi-line expression lambda
2016-12-13 12:35:16 +07:00
Tagir Valeev
7b65a6919d
StreamToLoopInspection: handle some if/ifPresent cases
2016-12-13 12:33:43 +07:00
Tagir Valeev
f25764d72f
StreamToLoop: disable in this()/super() constructor invocation as we cannot generate statements before this/super call.
2016-12-12 19:12:02 +07:00
Tagir Valeev
e87c551445
StreamToLoop: reuse variable if possible when the stream is used in the declaration
2016-12-12 17:27:54 +07:00
Tagir Valeev
810445f21d
StreamToLoop: unwrap negation and ternary; minor refactoring
2016-12-12 17:27:53 +07:00
Tagir Valeev
8e128b7f32
StreamToLoop: support Optional unwrap if possible
2016-12-09 15:17:26 +07:00
Tagir Valeev
f99940c8e3
StreamToLoop: add finisher parentheses automatically if necessary
2016-12-09 11:04:29 +07:00
Tagir Valeev
c7ccea5186
StreamToLoop: add variable name suggestions from method reference output variable
2016-12-09 10:33:49 +07:00
Tagir Valeev
f0c8802a27
StreamToLoop inspection: simplify toMap mergers (a,b)->a (use putIfAbsent) and (a,b)->b (use put)
2016-12-06 12:23:06 +07:00
Tagir Valeev
4e919302c7
StreamToLoopInspection: support inside single-expression lambdas
2016-11-30 17:36:09 +07:00