Commit Graph

22 Commits

Author SHA1 Message Date
Tagir Valeev
0269e72a79 IDEA-191856 "Replace Optional.isPresent() condition with functional style expression" creates bad code when used with Type Promotion 2018-05-24 12:44:33 +07:00
Tagir Valeev
b3b019e5b7 ExpressionUtils#isSimpleExpression: consider Collections.emptyXyz as simple (they are just static field getters) 2018-01-19 15:07:20 +07:00
Tagir Valeev
f1bc1f9819 OptionalIsPresentInspection: warn if map(x -> nullable).orElse(null)
In this case semantics preserved if map expression returns null.
2017-12-27 15:40:02 +07:00
Tagir Valeev
5bd30e691d IDEA-181743 IntelliJ suggests bad refactoring for compareTo with Optionals
Reference expressions are compared instead of variables now
2017-11-10 17:38:53 +07:00
Tagir Valeev
b2df7a760a IDEA-179490 "Can be replaced with single expression in functional style" in Java fails when field name matches class name 2017-09-26 09:44:21 +07:00
Tagir Valeev
b1d286f8f6 IDEA-177515 Optional.isPresent() refactoring should not be suggested for ternary with incompatible branch types 2017-08-14 17:51:24 +07:00
Tagir Valeev
926a541520 Test and comment for IDEA-176340 "Optional.isPresent not highlighted"
Actually was fixed in 0234c70
2017-07-21 17:13:52 +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
Tagir Valeev
588d978362 OptionalIsPresentInspection: do not warn if map() part can be null
If we cannot determine the non-nullity of map expression, then info
level is used. Fixes IDEA-172609 "Replace Optional.isPresent() checks
with functional-style expressions" is broken.
2017-05-31 17:48:57 +07:00
Tagir Valeev
55466aeef1 IDEA-169678 "Replace Optional.isPresent() condition with functional style expression" breaks code in case of 'Collection' return type 2017-03-16 11:22:15 +07:00
Tagir Valeev
f396483457 Fixed EA-96417 - IOE: PsiJavaParserFacadeImpl.createExpressionFromText 2017-02-08 18:16:37 +07:00
Tagir Valeev
3741495801 LambdaGenerationUtil: disable if expression is accessed for writing
Fixes IDEA-165482 Optional.isPresent suggests to replace the code which assigns the variable defined outside
2016-12-15 11:51:58 +07:00
Tagir Valeev
dddfd5d7b6 LambdaGenerationUtil#canBeUncheckedLambda: supports statements; checks control-flow breaks;
Fix for IDEA-165369 Replace Optional.isPresent() should be disabled if the thenBranch contains non-local control flow
2016-12-14 15:44:59 +07:00
Tagir Valeev
0f7c78a5a6 IDEA-163991 ifPresent is not suggested when value is not used inside expression; OptionalIsPresentInspection uses CommentTracker now 2016-11-23 17:26:57 +07:00
Tagir Valeev
3fa339e3dd IDEA-164016 Replace Optional.isPresent() checks with functional-style expressions fix produces non-compilable code 2016-11-21 14:47:02 +07:00
Tagir Valeev
0fa3853dfb IDEA-163767: fixed for assignment, tests for assignment and ternary 2016-11-11 13:24:09 +07:00
Tagir Valeev
1d74e0af9d IDEA-163767 Simplify optional.isPresent() inspection doesn't suggest simplify trivial case 2016-11-11 13:14:55 +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
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
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
7e72d2fe9e OptionalIsPresentInspection: simplify isRaw() and isOptionalLambdaCandidate(); fix getComments(); add more tests (IDEA-CR-13980) 2016-09-27 12:01:07 +07:00
Tagir Valeev
aadd111eda IDEA-161420 Quick-fix to replace if(optional.isPresent()) with better alternatives 2016-09-21 15:41:20 +07:00