Anna Kozlova
d138577fe1
last resource delete from try-with-resources(IDEA-145803)
...
ensure that psi remain correct, automatically resolve conflict with variables declared after the try-with-resources stmt
2018-02-01 13:40:05 +03:00
Tagir Valeev
f00980de6b
MismatchedCollectionQueryUpdate: imports restored in testdata
2018-02-01 15:58:39 +07:00
Tagir Valeev
f98cbb8d6b
MismatchedCollectionQueryUpdate: support constructors with initial content (IDEA-175455); disable for public fields of private classes (follow-up for IDEA-161979)
2018-02-01 12:28:58 +07:00
Anna Kozlova
8b064122b1
unnecessary local: ignore suppressions to break the cycle (IDEA-185868)
2018-01-31 17:25:09 +03:00
Tagir Valeev
13945953f4
MismatchedCollectionQueryUpdate: support non-private fields in private classes (IDEA-161979)
2018-01-31 17:47:51 +07:00
Tagir Valeev
1fbb882a16
MismatchedCollectionQueryUpdate: tuning default method names, more tests
2018-01-31 17:27:41 +07:00
Tagir Valeev
d177d85a68
MismatchedCollectionQueryUpdate inspection refactored, fixed many fp/fn
...
1. getOrDefault support in assignment/initialization (IDEA-185729)
2. ?: support in assignment/initialization
3. Consider addition of collection into another collection (via add/put/etc.) as update
4. Consider passing of collection into pure method returning immutable result as query only
5. Consider calling unknown method as query/update
6. Do not consider assignment of new empty collection to the variable as update/query
7. Handle keySet, etc.
2018-01-31 16:58:33 +07:00
Anna Kozlova
d8f37a3ea8
access can be tightened for inner classes (IDEA-185790)
...
check enclosing instance for null qualifiers, if accessed via inheritance, then can't be private
2018-01-30 19:38:53 +03:00
Roman Ivanov
6ffe3df05c
IfStatementWithIdenticalBranches: preserve comments when merge if's
2018-01-30 13:58:06 +07:00
Tagir Valeev
3210510c96
CollectionUtils#isCollectionOrMapSize
...
Used in ToArrayCallWithZeroLengthArrayArgumentInspection and StreamApiMigrationInspection
2018-01-30 11:01:38 +07:00
Roman Shevchenko
d6e230776d
[test framework] extracts common code for mock JDK and Java project descriptors
2018-01-29 13:56:06 +03:00
Tagir Valeev
2f547ca38f
RedundantStringOperationInspection: warn about append(s.substring(x, y))
...
Replaceable with append(s, x, y)
Fixes IDEA-185652 Improve StringBulder.append(s.substring(1,2)) intention
Also optimization of new expression resolution
2018-01-29 13:34:55 +07:00
Tagir Valeev
09e5f061ac
UnnecessaryTemporaryOnConversionFrom/ToString fix: do not apply when no arguments
...
Fixes EA-115362 - AIOOBE: UnnecessaryTemporaryOnConversionToStringInspection$UnnecessaryTemporaryObjectFix.doFix
2018-01-29 10:13:28 +07:00
Tagir Valeev
bd9f4713d6
PsiCodeBlock#getStatementCount/isEmpty()
2018-01-29 09:28:23 +07:00
Tagir Valeev
89d7f7290e
PsiParameterList#isEmpty; isEmpty and getParametersCount used where possible
2018-01-26 16:41:54 +07:00
Roman Ivanov
8f4781ecb2
AutoCloseableResourceInspection: warning on Files.lines,...: IDEA-182784
2018-01-26 16:19:51 +07:00
Tagir Valeev
0d23cefe70
ConstantExpressionInspection: display computed value in inspection message, cosmetics
...
Review ID: IDEA-CR-28753
2018-01-26 12:36:52 +07:00
Tagir Valeev
97300d73f1
IDEA-185548 Inspection to remove excessive Comparator.comparing call
2018-01-26 12:27:12 +07:00
Tagir Valeev
88bc353da4
PsiExpressionList: added getExpressionCount() and isEmpty()
...
Optimized implementations in PsiExpressionListImpl, usages replaced where possible
2018-01-26 12:27:11 +07:00
Roman Ivanov
2c40a8a181
TryFinallyCanBeTryWithResources:remove finally if no stmt: IDEA-CR-28726
2018-01-26 10:59:40 +07:00
Roman Ivanov
e926fc71e3
TryFinallyCanBeTryWithResources: support java 9 variables : IDEA-171304
2018-01-26 10:59:40 +07:00
Roman Ivanov
f40d2f8734
AutoCloseableResourceInspection: invert func, move class : IDEA-CR-28727
2018-01-26 10:41:55 +07:00
Roman Ivanov
403d526645
AutoCloseableResourceInspection: ignore immediately closed : IDEA-171866
2018-01-26 10:41:55 +07:00
Roman Ivanov
7ec14afd81
AutoCloseableResourceInspection: add EP to ignore implicit close
2018-01-26 10:41:54 +07:00
Tagir Valeev
adead41f83
ComparatorCombinatorsInspection: disable explicitly for Java <8
2018-01-26 10:14:57 +07:00
nik
1e833720ca
IDEA project configuration: the great module rename
...
Rename all modules in IntelliJ IDEA sources to ensure that they follow a consistent naming scheme.
Update references in code and comments.
2018-01-25 12:59:03 +03:00
Tagir Valeev
6cc8936598
Compute constant expression as an inspection; minor improvements
...
Works for unary operation
Do not suggested if replacement is the same as the original code
Replacement is displayed in the quick-fix name
2018-01-25 15:43:48 +07:00
Tagir Valeev
069cbb6669
CatchMayIgnoreException: added option to disable reporting on "ignore(d)" name used
...
Fixes IDEA-185345 "Catch block may ignore exception" settings considerations
2018-01-25 13:06:05 +07:00
Bas Leijdekkers
110b24921e
IG: consider anonymous classes not matching (IDEA-185470)
2018-01-24 20:17:44 +01:00
Tagir Valeev
e2d5de3528
ExpressionUtils#isEvaluatedAtCompileTime: fixed for casts to String (operand was not checked)
2018-01-24 14:36:20 +07:00
Bas Leijdekkers
ffa4af8259
IG: description tweaks
2018-01-23 17:58:03 +01:00
Bas Leijdekkers
2e3a5d9e6e
check more carefully if method is a redundant override (IDEA-185066)
2018-01-23 17:58:03 +01:00
Alexey Kudravtsev
c47470e783
IDEA-CR-28673 followup: write action is unnecessary
2018-01-23 15:35:10 +03:00
Alexey Kudravtsev
a55595d5dc
cleanup
2018-01-22 15:10:16 +03:00
Alexey Kudravtsev
5f67dd2d84
quick fix to convert empty anonymous class to the plain new expression
2018-01-22 15:10:16 +03:00
Tagir Valeev
1a40a9f877
RedundantCollectionOperation: warn on if(map.containsKey(x)) map.remove(x)
...
Review ID: IDEA-CR-28150
2018-01-22 13:39:09 +07:00
Tagir Valeev
c95dca14e9
ForLoopThatDoesntUseLoopVariable inspection removed (superceded by LoopConditionNotUpdatedInsideLoop)
...
Fixes IDEA-184207
LoopConditionNotUpdatedInsideLoop is on by default now
//noinspection ForLoopThatDoesntUseLoopVariable marks removed and other trivial warnings fixed
2018-01-22 12:24:43 +07:00
Tagir Valeev
f99f00334f
SideEffectChecker#isPure: volatile getters are not pure
2018-01-22 11:44:23 +07:00
Bas Leijdekkers
84e4ac4c32
IG: ignore method if removing it would break compilation (IDEA-185066)
2018-01-21 17:39:32 +01:00
peter
315b7969c1
migrate most usages of deprecated com.intellij.util.containers.HashMap/Set to java.util
2018-01-19 22:26:30 +01:00
Tagir Valeev
355a550e6d
LoopConditionNotUpdatedInsideLoopInspection: serialization compatibility fixed
...
Review ID: IDEA-CR-28557
2018-01-19 17:00:01 +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
Anna.Kozlova
2acd327a7d
local var type: make messages less aggressive
2018-01-18 16:56:17 +01:00
Bas Leijdekkers
f2e6fca603
use CommentTracker.text() with precedence argument
2018-01-18 15:19:20 +01:00
Alexey Kudravtsev
d81f59d434
removed redundant method overriders after "Method is identical to its supermethod" inspection run
2018-01-18 16:28:43 +03:00
Tagir Valeev
ad34f98b9c
UnnecessaryEmptyArrayUsage: fixed fp/fn; tests
...
False-positive was when array element type differs from class type
False-negative was when array field initializer is {} instead of new Type[0] or new Type[] {}
2018-01-18 14:51:09 +07:00
Tagir Valeev
db9200fcdb
Collection.toArray: use empty array instead of presized one
2018-01-18 13:41:14 +07:00
Tagir Valeev
44585d34d9
CommentTracker: support removal of reference qualifier; used in AddSingleMemberStaticImportAction
2018-01-18 12:00:24 +07:00
Tagir Valeev
32e4a691f1
ToArrayCallWithZeroLengthArrayArgument: fixes according to review IDEA-CR-28526
...
1. Use default serialization
2. myEmptyPreferred is final
3. Typos in description
2018-01-18 10:50:29 +07:00
Tagir Valeev
a745aff70a
CatchMayIgnoreException: missing space added
2018-01-18 10:22:16 +07:00