Commit Graph

1251 Commits

Author SHA1 Message Date
Anna.Kozlova
6a9bc6782d ensure class added to the throws list is visible outside of method
IDEA-187595
2018-03-14 17:39:04 +01:00
Anna.Kozlova
d2bfe3d14b ensure name when retrieving constructors from a class (IDEA-188068) 2018-03-13 10:35:45 +01:00
Tagir Valeev
2e6232e029 StreamApiMigration tests reorganized 2018-03-13 11:21:23 +07:00
Tagir Valeev
b2d5f75a92 StreamApiMigration: support Java10 toUnmodifiableList/Set (part of IDEA-187213) 2018-03-13 11:21:22 +07:00
Daniil Ovchinnikov
47bedfb488 [jvm-lang] java: return if no method is found after reformat IDEA-188113 2018-03-12 21:40:30 +03:00
Anna.Kozlova
117f3f1d2f ensure tailing comments doesn't break statement in the middle (IDEA-188072) 2018-03-12 18:34:26 +01: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
552f6fd49e IDEA-188021 "Move assignment to field declaration" leaves comment in class initializer 2018-03-12 10:18:09 +07:00
Anna.Kozlova
acfb22157b remove redundant type args: get rid of 2 different fixes 2018-03-09 18:44:26 +01:00
Anna.Kozlova
e3f42bdb9b extract PsiPrecedenceUtil as read-only part of ParenthesisUtils
leave methods to ensure compatibility, to be inlined and deprecated in separate commit (IDEA-CR-30329)
2018-03-09 16:38:07 +01:00
Tagir Valeev
a0923d48b8 MoveFieldAssignmentToInitializerFix: keep comments when removing empty initializer
Fixes IDEA-187524 "Move assignment to field declaration" loses comment on class initializer
2018-03-09 19:45:31 +07:00
Tagir Valeev
350eba5000 Optional compared with null: do not warn when subsequent isPresent check is found
IDEA-187578  Inspection to detect when Optional is compared with null
2018-03-09 19:30:59 +07:00
Tagir Valeev
a24ad7b268 OptionalAssignedToNull: added optional (sic!) warning on optional == null comparison
Fixes IDEA-187578 Inspection to detect when Optional is compared with null
2018-03-07 16:20:10 +07:00
Anna.Kozlova
9bdd5f11e3 respect precedence for div as production argument (IDEA-187205) 2018-03-07 09:18:32 +01:00
Anna Kozlova
b69f886265 redundant type arguments for non-generic methods & method references
IDEA-187548
2018-03-07 08:02:42 +01:00
Tagir Valeev
2c4af2781d Inspection: Expression can be folded into Stream chain (IDEA-187123) 2018-03-05 16:35:35 +07:00
Tagir Valeev
43b86a988e CodeEditUtil#removeChildren: fixed nextLeaf determination
Before when removing more than one element, nextLeaf was invalid as well. The invalidation check below did not work as parent might still exist (element might be relinked to dummy file)

Fixes IDEA-187531 "Add on demand static import" with intervening comment and an empty line breaks code
2018-03-03 15:47:21 +07:00
Tagir Valeev
aa89c3b6fa CommentTracker: do not add a comment as a first child of PsiElement
Fixes IDEA-187526 "Add static import" with an intervening comment leads to exception
2018-03-02 16:22:19 +07:00
Tagir Valeev
4f854bc34a RedundantCompareCall testdata fixed 2018-03-02 09:54:28 +07:00
Tagir Valeev
2735fd74d5 IDEA-187474 Ternary condition is not boolean: add a quick-fix for method call 2018-03-01 14:45:49 +07:00
Tagir Valeev
c4da8fdb79 IDEA-187130 Inspection: Comparison of primitives with compareTo() 2018-03-01 12:33:56 +07:00
Tagir Valeev
f6c45995d3 IDEA-187224: test fixed (beforeStringSubstringLength.java was not added mistakenly) 2018-02-28 14:15:23 +07:00
Tagir Valeev
5feb5cb75a IDEA-187224 Add inspection for substring with String#length as second param 2018-02-27 13:05:45 +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
c483ae9cd0 ControlFlowUtils#getInitializerUsageStatus fixed for do-while loops where var is declared just before the loop 2018-02-21 12:24:01 +07:00
Tagir Valeev
3b96a595b9 DeleteSideEffectsAwareFix: handle comments 2018-02-20 17:06:53 +07:00
Tagir Valeev
413aca292b WrapWithAdapterMethodCallFix: correctly handle disjunction type
Fixes EA-116570 Cannot create expression for type class com.intellij.psi.PsiDisjunctionType
2018-02-18 07:54:47 +07:00
Anna.Kozlova
8703c07861 disable add on demand static import for method reference qualifiers
IDEA-186826
2018-02-16 16:01:55 +01:00
Daniil Ovchinnikov
872ddb5d0e [jvm-lang] rename create getter/setter actions
- _Create Getter_ -> _Create read-only property 'foo' in 'Bar'_
- _Create Setter_ -> _Create write-only property 'foo' in 'Bar'_

Action names are now consistent with _Create property 'foo' in 'Bar'_.
2018-02-15 16:00:36 +03:00
Daniil Ovchinnikov
544ee7980f [jvm-lang] java: port _Create getter/setter from usage_ actions
- extract PropertyRenderer for reusing;
- make them work with type parameter guesser.
2018-02-13 01:15:09 +03:00
Daniil Ovchinnikov
3151924a52 [jvm-lang] java: don't create private abstract methods (IDEA-186499) 2018-02-12 19:25:20 +03:00
Daniil Ovchinnikov
fbe959bf47 [jvm-lang] java: port _Create property from usage_ action
- make it create template for both getter and setter;
- make it work with type parameter guesser;
- add tests!
2018-02-12 17:45:12 +03:00
Tagir Valeev
7e915181dc RedundantCollectionOperationInspection: fix redundant asList type 2018-02-07 11:10:20 +07:00
Tagir Valeev
8d8dce807a RedundantCollectionOperationInspection: simplify Collections.sort(asList(arr)) to Arrays.sort(arr)
Fixes IDEA-93038 Inspection: Replace Collections.sort() with Arrays.sort()
2018-02-06 13:05:29 +07:00
Tagir Valeev
d5f9284f2e ExpressionUtils#isSimpleExpression: disable for non-final fields 2018-02-05 15:53:39 +07:00
Tagir Valeev
818b20eff3 RedundantComparatorComparing: cosmetic changes, internationalization
Review ID: IDEA-CR-28770
2018-02-05 12:33:55 +07:00
Tagir Valeev
4be91bbc65 Fixed imports in testdata. 2018-02-04 17:21:33 +07:00
Tagir Valeev
5bfb15ec8c CommentTracker: do not add comments at the beginning of reference qualifier: add it to the parent element instead 2018-02-04 16:34:23 +07:00
Daniil Ovchinnikov
6e0f6897c9 [jvm-lang] group 'Create method' and 'Create field' actions 2018-02-02 17:07:57 +03:00
Tagir Valeev
b477b32395 IDEA-186034 Lambda can be method call inspection should not generate code with inference failures 2018-02-02 12:09:53 +07:00
Anna Kozlova
30464d6b08 disable fixes when target types depend on unresolved type params (IDEA-185967) 2018-02-01 13:40:04 +03:00
Tagir Valeev
f06e8ca2f0 IDEA-185812 Allow to force explicit toCollection(ArrayList::new) instead of toList() in "Subsequent steps can be fused into Stream API" 2018-02-01 17:16:04 +07:00
Tagir Valeev
dde611b8f4 IDEA-185819 Operator ! cannot be applied to void: add a quick-fix 2018-02-01 10:37:29 +07:00
Roman Ivanov
465f4124a2 SortContentAction: support generic types in vararg: IDEA-185852 2018-01-31 16:23:10 +07:00
Roman Ivanov
798fea215a SortContentAction: fix warping in the middle of initializer: IDEA-185786 2018-01-30 13:58:05 +07:00
Roman Ivanov
c71ae7e4f1 SortContentAction: consistent count of expr to be available: IDEA-185785 2018-01-30 13:58:05 +07:00
Tagir Valeev
3210510c96 CollectionUtils#isCollectionOrMapSize
Used in ToArrayCallWithZeroLengthArrayArgumentInspection and StreamApiMigrationInspection
2018-01-30 11:01:38 +07:00
Roman Ivanov
abd1458307 SortContentAction: fix IOOBE, check if expr is literal: IDEA-185784 2018-01-30 10:39:30 +07:00
Roman Ivanov
d5d06483fe RedundantExplicitCloseInspection created: IDEA-176630 2018-01-30 10:39:29 +07:00