Commit Graph

7205 Commits

Author SHA1 Message Date
Anna.Kozlova
e75b0faed2 inference: ensure erasure flag is pushed to the container expression
IDEA-185316
2018-03-14 17:39:04 +01:00
Anna.Kozlova
62598b023f redundant cast: poly conditional expressions (IDEA-187764)
since 1.8 type of the (poly) conditional evaluates based on it's target type, so all checks on it's type are useless, instead check that operands expressions are compatible with the target type
2018-03-14 17:39:04 +01:00
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
Pavel Dolgov
e0b966650e Java: Fixed duplicate matching for complex expressions (IDEA-188127) 2018-03-14 18:21:30 +03:00
Anna.Kozlova
4b9f5eee44 remap types according to the current place (IDEA-187378) 2018-03-14 11:50:00 +01:00
Anna.Kozlova
0327f6df84 inline: preserve comments (IDEA-188115) 2018-03-13 16:05:44 +01:00
Anna.Kozlova
a98b13aaac same parameter value: inline string literal (IDEA-188158) 2018-03-13 16:05:43 +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
5a52307e5a IDEA-188088 Suspicious parameter/name combination does not work for camelCaseWords 2018-03-13 15:26:49 +07:00
Tagir Valeev
d00541956f IDEA-188135 Report when always true/false expression in and/or chain causes short-circuit 2018-03-13 13:37:38 +07:00
Tagir Valeev
f3900f45c6 IDEA-188135 Don't report always true asserts: support expression parts; support assertion methods 2018-03-13 13:08:14 +07: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
adf14b7ded InvertIfConditionAction: better comment handling 2018-03-12 15:55:14 +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
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
253b765238 convert static to instance: don't check interface inheritance for java 1.8+
check used references for java 1.8- as call sites would call abstract method of interface anyway (IDEA-187991)
2018-03-09 16:38:07 +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
Anna.Kozlova
51f6813ee3 valid static method reference on class's inheritor (IDEA-187974) 2018-03-09 11:44:47 +01:00
Tagir Valeev
828000c586 CharsetObjectCanBeUsedInspectionTest: use Mock JDK 9 to access StandardCharsets
Review ID: IDEA-CR-30242
2018-03-09 17:16:55 +07:00
Anna.Kozlova
36b1e622eb inference: skip bounds checking for captured fresh variables (IDEA-187943) 2018-03-08 19:06:30 +01:00
Roman Shevchenko
156b436799 [java] parses local-var syntax for lambda parameters (IDEA-187804) 2018-03-08 18:14:26 +01:00
peter
7cba7ba21e IDEA-187753 Duplicate annotation in compiled class when Nullable / NotNull Problems inspection is enabled with custom NonNull annotation 2018-03-08 16:15:47 +01:00
Anna.Kozlova
877b2424ce inference: don't process lambda return expressions for void return type
those lambda return expressions can't influence containing call inference according to lambda constraint; which means that no additional inference variables could be propagated during inference process hence exception constraints could operate with proper types which are in fact type parameters - which would lead to unhandled exceptions on the top level (IDEA-187930)
2018-03-08 11:53:52 +01:00
Anna.Kozlova
99027d3bc5 fix test data (IDEA-CR-30316) 2018-03-07 14:36:37 +01: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
Anna Kozlova
227d80b202 ensure parameter list contains parenthesis (IDEA-187777)
lambda parameter list can have no parenthesis for the case when no explicit type is specified and one parameter is used. When next parameter is added or the one is deleted, parenthesis should be added
2018-03-07 08:02:42 +01:00
Anna Kozlova
bea45461b0 provide special colors for statically imported members (IDEA-98499) 2018-03-07 08:02:41 +01:00
Anna Kozlova
424081efe0 interface static methods in method refs by subclass error (IDEA-187330) 2018-03-07 08:02:41 +01:00
Anna Kozlova
54a49e7777 restore javadoc references for non-phisical methods, e.g. enum#valueOf
IDEA-187289
looks like there is no fields which can be generated, so only methods are checked through processDeclarations
2018-03-07 08:02:41 +01:00
Anna Kozlova
f295742259 interface static methods in method refs by subclass error (IDEA-187330) 2018-03-07 08:02:41 +01:00
Tagir Valeev
35dff9c9a4 IDEA-187211 Suggest using StandardCharsets.XYZ instead of "XYZ" where possible 2018-03-06 18:00:32 +07:00
Tagir Valeev
e3fb3c143c Bug fixes in DefUseInspection
IDEA-187758 Variable initializer is redundant false-negative with chained constructors
IDEA-187756 Variable initializer is redundant false-positive when the value is read before write
2018-03-06 11:42:15 +07: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
48848a8a7b IDEA-187645 NPE warning is not issued when "null -> null" method is called with Nullable argument 2018-03-03 15:02:58 +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
8ba8714ef3 DFA: warn on method-ref dereference (IDEA-186732) 2018-03-02 14:59:02 +07:00
Tagir Valeev
4f854bc34a RedundantCompareCall testdata fixed 2018-03-02 09:54:28 +07:00
peter
feeb53394c java completion: put signature suggestions below all types (IDEA-187504, IDEA-CR-28091) 2018-03-01 17:34:26 +01:00
Dmitry Batrak
1dd0a87b00 IDEA-187505 Locally-referenced images are not displayed in quick doc 2018-03-01 15:16:04 +03:00
Alexey Kudravtsev
f6002904a7 IDEA-186767 Magic constant: false positive for JFrame.EXIT_ON_CLOSE 2018-03-01 14:09:00 +03:00