Commit Graph

4895 Commits

Author SHA1 Message Date
Anna.Kozlova
af3e15a689 highlight method call: don't ignore args with applicable calls as they may still cause parent call incompatibility
IDEA-201175
2018-10-25 16:20:56 +02:00
Tagir Valeev
2e36108630 SimplifyBooleanExpressionFix: support always-false last disjunct in if
Fixes IDEA-200961 Simplification of "!list.add(type) is always false" may change code semantic
2018-10-23 17:44:26 +07:00
Tagir Valeev
747aec38c9 ConvertSwitchToIfIntention: better comments handling 2018-10-23 15:34:51 +07:00
Anna.Kozlova
50b66d9d4b method reference overloads: second search should provide actual parameter types with 1 offset (IDEA-200218) 2018-10-22 17:02:20 +02:00
Anna.Kozlova
9aa64b30d9 inference: allow child session inference if containing method is not generics 2018-10-19 17:52:43 +02:00
Tagir Valeev
e79ea86e18 EnsureCodeBlock: support or-chains in return/lambdas 2018-10-18 19:21:37 +07:00
Anna.Kozlova
265764b961 fix testdata 2018-10-18 11:12:33 +02:00
Tagir Valeev
6e5d42e80b afterAddFinally.java: whitespace fixed 2018-10-18 10:42:21 +07:00
Tagir Valeev
50abafa3f8 UnwrapSwitchLabelFix: when only one switch branch is reachable
Fixes IDEA-200651 Analysis for 'switch' statements may determine always truthy conditions on branches in addition to always falsy
Minor refactoring of reporting in DataFlowInspectionBase
2018-10-17 16:39:25 +07:00
Tagir Valeev
5878fde5e9 Add 'catch' block after incomplete try (final piece of IDEA-200560) 2018-10-17 13:04:54 +07:00
Tagir Valeev
3eaa3ff64f Add 'finally' block fix (part of IDEA-200560) 2018-10-17 12:17:52 +07:00
Anna.Kozlova
3b68fe09e7 redundant suppressions in editor: ensure suppressions from injections are processed 2018-10-12 19:21:31 +02:00
Tagir Valeev
35de5a903d 'compare()' method can be used to compare primitives -> 'compare()' method can be used to compare numbers 2018-10-12 12:41:24 +07:00
Tagir Valeev
95f2337448 UseCompareMethod: support boxed inputs and suggest "compareTo"
Allows to do IDEA-200365 in three steps now
2018-10-12 12:22:38 +07:00
Tagir Valeev
66504c8088 BoolUtils: negate the equality token for float/double as this does not change the semantics (only >, >=, <, <= change) 2018-10-12 10:34:56 +07:00
Anna.Kozlova
6fa0522d1b remove redundant suppressions: allow unrelated comment inside same noinspection comment 2018-10-11 15:57:00 +02:00
peter
3c99a1b1e9 IDEA-200139 Smart completion for super constructor call suggests base field 2018-10-11 09:12:18 +02:00
Anna.Kozlova
2733df787f preserve comments when remove redundant type arguments 2018-10-10 18:18:09 +02:00
Anna.Kozlova
4831eed1ce preserve comments: invert if with comment after then branch 2018-10-10 18:18:09 +02:00
Anna.Kozlova
4f4012fecf preserve comments: invert if in case when else branch become empty 2018-10-10 18:18:09 +02:00
Tagir Valeev
cee88f887b FindFirstMigration: use ifPresent when stream element type is primitive and the final statement is an assignment
This case is possible only if we have no non-final locals updated in the loop, so the assignment updates field or array element.
Using common assignment scenario may not work as primitive optionals lack map/filter operations
Fixes IDEA-200209 "Replace with findFirst" produces incompilable code
2018-10-10 15:55:53 +07:00
Pavel Dolgov
a2c0f2202c Java: Improved inspection "Join Declaration And Assignment" - handle C-style array declarations (IDEA-177132) 2018-10-09 15:08:01 +03:00
Pavel Dolgov
1402f1a2f6 Java: Improved inspection "Join Declaration And Assignment" - simplify handling of comments (IDEA-177132) 2018-10-09 13:29:33 +03:00
Anna.Kozlova
291c5cb03b unchecked warnings: don't check containing class parameters (IDEA-194678) 2018-10-08 18:57:16 +02:00
Pavel Dolgov
d8f1620454 Java: Improved inspection "Join Declaration And Assignment" - simplify handling of comments (IDEA-177132) 2018-10-08 13:34:50 +03:00
Tagir Valeev
1554b0c513 DeleteSwitchLabelFix: check again whether the whole branch should be removed when fix is actually applied
Fixes IDEA-200021 Red code after applying 'Fix all 'Constant conditions and exception' problems in the file' with multiple case labels
2018-10-08 14:09:25 +07:00
Tagir Valeev
c09250da45 CommentTracker#replaceAndRestoreComments: try to keep comments after the statement (not move them to the front) 2018-10-08 14:09:24 +07:00
Tagir Valeev
5663e0bde8 IDEA-200030 Quick-fix to remove unreachable should remove body only if previous branch has 'break' at the end 2018-10-08 10:57:50 +07:00
Pavel Dolgov
1245d379ff Java: Improved inspection "Join Declaration And Assignment" - preserve 'final' (IDEA-177132) 2018-10-05 20:02:21 +03:00
peter
03fd1b00f5 disable completion after enum constant (IDEA-199935) 2018-10-05 18:22:23 +02:00
Pavel Dolgov
0dcbd3f6e5 Java: Improved inspection "Join Declaration And Assignment" - corner case handled (IDEA-177132) 2018-10-05 17:34:02 +03:00
peter
c9694995ac IDEA-199875 Rank println higher than print 2018-10-05 11:25:23 +02:00
Tagir Valeev
422d8fad2f Rename Java inspections
Imperative names changed to declarative
Keywords/method names quoted
Cosmetics
2018-10-05 14:01:19 +07:00
Anna.Kozlova
3bf18f4db9 expand static import intention available at the end of the line (IDEA-199910) 2018-10-04 19:13:47 +02:00
Pavel Dolgov
82abf56a28 Java: Improved inspection "Join Declaration And Assignment" (IDEA-177132) 2018-10-04 19:31:15 +03:00
Anna.Kozlova
bc61fc52a0 redundant suppression: don't delete all same comments/top annotation when one suppress comment is actually to be deleted 2018-10-04 18:20:21 +02:00
Pavel Dolgov
799b769b2f Java: Convert intention "Join Declaration And Assignment" into inspection (IDEA-178919) 2018-10-04 16:46:00 +03:00
Roman.Ivanov
ecc74e9a2d BoolUtils: make it recognize methods with negated counterparts: IDEA-199888 2018-10-04 17:39:11 +07:00
Tagir Valeev
f12b4848c6 RefactoringUtil#ensureCodeBlock: support &&-chains in returns/lambdas (IDEA-199811)
Also implementation extracted to package-private class
2018-10-03 13:46:47 +07:00
Tagir Valeev
46ffa7b2cc Testdata fixed 2018-10-03 10:55:33 +07:00
Pavel Dolgov
acbb991ce1 Java: Convert intention "Join Declaration And Assignment" into inspection - minor fixes after review (IDEA-178919) 2018-10-02 15:12:37 +03:00
Tagir Valeev
8bb578e43c SimplifyBooleanExpressionFix: fix 'while' handling after ensureCodeBlock improvements 2018-10-02 16:36:16 +07:00
Tagir Valeev
49e8a5a7ff IDEA-199811 RefactoringUtil#ensureCodeBlock: support while conditions; support && chains in if-then and while 2018-10-02 16:36:15 +07:00
Tagir Valeev
ec3b05f6a3 ConstantExpressionVisitor fixes
1. Relational operators are promoted according to JLS, not always to double type (IDEA-199775)
2. Casting to boxed type is disabled, as JLS 15.28 suggests
Result of boxed comparison like (Long)128L == (Long)128L is unknown now as size of boxing cache is not specified in JLS
2018-10-02 12:59:27 +07:00
Roman.Ivanov
19b4764435 SortContentAction: fix \n placement in presence of comments: IDEA-199734 2018-10-02 12:08:47 +07:00
Anna Kozlova
fe3955570d redundant suppression in the editor: treat suppress ALL 2018-10-01 18:50:39 +02:00
Pavel Dolgov
0623c7b75f Java: Convert intention "Join Declaration And Assignment" into inspection - improved highlighting (IDEA-178919) 2018-10-01 17:51:52 +03:00
Tagir Valeev
763ad22de9 Support local classes 2018-10-01 16:31:37 +07:00
Tagir Valeev
5fc3612fa9 DeleteSwitchLabelFix: delete unreachable switch branch
Fixes IDEA-199692 Quickfix to delete unreachable switch branch reported by "constant conditions & exceptions"
2018-10-01 14:54:36 +07:00
Anna Kozlova
fe9799965c unchecked warnings: check poly conditional branches in context of target type (IDEA-199615) 2018-09-28 19:59:32 +02:00