Commit Graph

2977 Commits

Author SHA1 Message Date
Roman Ivanov 5acdc9ccdc add tests 2017-09-01 12:07:23 +07:00
Anna Kozlova 90924b2043 align message according to javac (IDEA-178211) 2017-08-30 19:53:27 +03:00
Tagir Valeev 8e9216b907 Fix IDEA-178248 WrapWithAdapterMethodCallFix exception on unresolved code 2017-08-30 16:38:53 +07:00
Tagir Valeev ca9fffa746 IDEA-178242 Extract Set from comparison chain: find duplicates within class 2017-08-30 14:29:54 +07:00
Tagir Valeev d3e36561f4 IDEA-174813 Intention to replace multiple enum comparisons with EnumSet.contains()
ExtractSetFromComparisonChainAction enhanced to support enums and support == comparisons
2017-08-29 17:40:32 +07:00
Daniil Ovchinnikov c7b4b47dc9 [jvm-lang] update Java-to-Java Create Field from usage tests 2017-08-28 13:33:38 +03:00
Tagir Valeev 02a917ed17 HighlightVisitorImpl: add standard quick-fixes for lambda return value 2017-08-28 17:30:01 +07:00
Tagir Valeev 791c182306 AdjustFunctionContextFix: suggest to change method accepting lambda/methodRef
Fixes cases 1, 2 from IDEA-174219 Add quick-fixes for incompilable Stream API call chains when using primitive streams
2017-08-28 14:55:00 +07:00
Tagir Valeev 661388f0c2 WrapWithAdapterMethodCallFix replaces individual cases
WrapArrayToArraysAsListFix, WrapLongWithMathToIntExactFix, WrapStringWithFileFix are united into WrapWithAdapterMethodCallFix. Also Paths.get(), Collections.singleton(), Collections.singletonList(), Arrays.stream() wrappers added

Fixes IDEA-175129 Suggest to wrap a value with `Collections.singleton*()`
2017-08-25 14:33:41 +07:00
Tagir Valeev 2e611b4917 StreamToLoopInspection: reuse variable of inexact type (IDEA-167414) 2017-08-24 15:25:19 +07:00
Roman Ivanov aaee667ca7 add nested stream filter recognition 2017-08-24 11:35:17 +07:00
Tagir Valeev 6d7d4c9a53 ReplaceWithTernaryOperatorFix: method reference scenario as separate class
Review ID: IDEA-CR-23763
2017-08-23 15:06:04 +07:00
Anna.Kozlova 18c13320a2 since api: check annotation pairs (IDEA-177856) 2017-08-21 19:10:14 +02:00
Anna.Kozlova 07fa74c8b5 inference: restore captured wildcard from fresh type parameter (IDEA-165871; IDEA-176592)
register return type constrain replaces wildcard parametrization with fresh variables aka custom capture conversion. When the specification would deal with these fresh type parameters further, IDEA expects them like PsiCapturedWildcards. Let's restore captured wildcards when inference failed to add any new constraints for fresh variables but initial upper bound of captured wildcard
2017-08-18 19:07:17 +02:00
Tagir Valeev 009ceae493 IDEA-177602 'Move assignment to field declaration' doesn't work if rhs contains field reference 2017-08-18 12:23:33 +07:00
Tagir Valeev f73a5572c0 Fix IDEA-177647 Convert String to StringBuilder intention produces wrong code 2017-08-17 17:52:16 +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
Roman Ivanov ef335f6a88 fix codegen for natural order: IDEA-CR-23874 2017-08-17 16:13:48 +07:00
Roman Ivanov f9f85c0832 improve codegen in simple case 2017-08-17 16:13:47 +07:00
Roman Ivanov fa416812fc improve conversion to stream api for joining cases 2017-08-17 10:21:31 +07:00
Anna.Kozlova dc7edd84fa copy to final: ensure to walk up through nested lambdas (IDEA-177496) 2017-08-16 15:35:15 +02: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
Dmitry Batkovich 7fb26c249d redundant throws: filter out unchecked exception (IDEA-177478, IDEA-177506) 2017-08-14 10:47:25 +03:00
Tagir Valeev 1e9f078fa4 Quick-fix for NPE in method reference to convert to lambda and add ?: (IDEA-176699) 2017-08-11 11:17:57 +07:00
Anna.Kozlova 3d1ba95725 unhandled exception: shrink the highlighted range (IDEA-177234) 2017-08-09 18:38:29 +02:00
Dmitry Batkovich c4f2ca674c AddMissingRequiredAnnotationParametersFix: handle nameless parameter as value (EA-105427) 2017-08-09 12:48:39 +03:00
Dmitry Batkovich 52cf50c461 redundant throws inspection:
1. global and local inspections are merged to one
2. local inspection reports "non-final" methods (if cheap enough) IDEA-177230
2017-08-09 12:14:26 +03:00
Anna.Kozlova 6d1f106889 support Rename Reference on invalid method call (IDEA-176918) 2017-08-08 17:42:39 +02:00
peter 4dc12ddb60 update AnnotateMethodTest data 2017-08-08 16:41:09 +02:00
Anna.Kozlova f67eaef468 trivial functional expression fix for empty lambda code block 2017-08-08 13:28:41 +02:00
Tagir Valeev a454ab1c33 Quick-fix to insert .filter(Objects::nonNull) (IDEA-176699) 2017-08-08 12:14:36 +07:00
Anna.Kozlova dec0d16597 overload resolution: adapt return types before comparing (IDEA-177065) 2017-08-07 18:28:03 +02:00
Anna.Kozlova fe61fc50e0 extend trivial method reference to support lambdas, convertible to method references 2017-08-07 16:00:10 +02:00
Anna Kozlova ba81ad7cd1 NPE (IDEA-176934) 2017-08-07 08:12:25 +02:00
Anna Kozlova 873df28d36 anonym -> lambda: disable for strictfp 2017-08-07 06:37:45 +02:00
Dmitry Batkovich ca93a04a0a simplify AnnotateMethodFix 2017-08-03 15:42:34 +03:00
Roman Ivanov 1003727653 Merge remote-tracking branch 'origin/master' 2017-08-02 13:11:56 +07:00
Roman Ivanov 72bab18a58 support min/max in stream api migration, rearrange tests 2017-08-02 12:57:45 +07:00
Tagir Valeev eaec99dcce DataFlowInspection: npe fixes fixed
Fixes duplicating NPE expression are disabled when expression has side-effect (not when it's a method call)
Parentheses added to generated code when necessary
2017-07-27 19:06:34 +07:00
Tagir Valeev 4882d4a589 IDEA-176650 Provide a quick fix of "can produce NPE" that wraps qualifier with Obejcts.requireNonNull 2017-07-27 18:48:43 +07:00
peter 99dec77a5a disable "insert new" fix on invalid code 2017-07-25 13:15:10 +02:00
Bas Leijdekkers 8d6551408c fix ControlFlowUtil.canCompleteNormally() regression (IDEA-141259) 2017-07-24 19:34:17 +02:00
Bas Leijdekkers aa515b08a1 generate "constant".equals(variable) code when converting switch to if (IDEA-157516) 2017-07-24 19:34:16 +02:00
peter 6c171f8e54 fix yet another PSI internals exception while updating "add on demand static import" intention 2017-07-22 08:08:18 +02: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
Bas Leijdekkers f5fdb50da7 Insert casted declaration in a nice place without exceptions (IDEA-176211) 2017-07-20 20:14:11 +02:00
Roman Ivanov dd4ba58889 add support for binary operation reduction in stream migration 2017-07-20 17:15:07 +07:00
Anna.Kozlova b59ffe20e4 type arguments in bounds check: ensure capture conversion (IDEA-175899) 2017-07-18 19:13:24 +02:00
Anna.Kozlova 01e64268f9 ensure method, imported statically, is not hidden by a local one (IDEA-175967) 2017-07-18 14:32:41 +02:00
Pavel Dolgov 7d30d532c6 Java: Don't report the catch section as unreachable where a subclass of declared exception can be thrown (IDEA-175863) 2017-07-18 14:25:32 +03:00