Commit Graph

1177 Commits

Author SHA1 Message Date
Anna Kozlova
c879ed4e4a java redundant cast: preserve multiple type casts around functional interface when if expected type is the same as cast
isAssignable check may fail otherwise

GitOrigin-RevId: d02c9d50645a2bbb0e957f077a4a66813c94afd6
2020-05-11 20:09:58 +00:00
Anna Kozlova
7f02ca14a9 java redundant cast: check conditional expression as call argument inplace
GitOrigin-RevId: ee7fa6ef4cac4e39e9dad97c7d5ace983bc81044
2020-05-11 08:33:17 +00:00
Anna Kozlova
e3bc888dc7 java redundant cast: cleanup checks for calls
GitOrigin-RevId: 2d999bc7356856ef7d2fea45f793d69f401f7256
2020-05-11 08:33:17 +00:00
Anna Kozlova
78891be4bb java redundant cast: cleanup: extract conditional
GitOrigin-RevId: ca95c0e70c197e27943596e91df8d526bbfbf1bb
2020-05-11 08:33:17 +00:00
Anna Kozlova
efc6106e02 java redundant cast: cleanup: avoid dbl cast registration for expressions with expected type
GitOrigin-RevId: a31b1d892b2e19bfaf556e85724eb244189111b4
2020-05-11 08:33:17 +00:00
Anna Kozlova
fdc80d017c java redundant cast: fixed multiple casts in synchronized stmt
GitOrigin-RevId: 49a7d8dbcd26a3aa905c57db97d386bcbd285464
2020-05-11 08:33:17 +00:00
Anna Kozlova
1c35803b4a java redundant cast: cleanup: extract foreach, instanceof, throws statements
GitOrigin-RevId: ac04ea8db453518f4c15d3e37e33d9a25a22ce35
2020-05-11 08:33:17 +00:00
Anna Kozlova
0a41902bda java redundant cast: normalize parenthesis
GitOrigin-RevId: 8069758686e0e76c3aed4d6851914315d29a493e
2020-05-05 21:49:48 +00:00
Anna Kozlova
c2ec0c2e78 java redundant cast: forbid changing of substitutor if cast is removed (IDEA-184330)
this way neighbour functional expressions can't be broken

GitOrigin-RevId: c13823eca79157030f3dde53fa6a6d496be9c2b7
2020-05-05 21:49:48 +00:00
Anna Kozlova
349c96eaee java redundant cast: allow warnings in poly conditional when target type remains the same
GitOrigin-RevId: f953fc42882a1eaad0b0a8c65d1e94236f0ec99e
2020-05-05 11:29:06 +00:00
Anna Kozlova
462856d81c java: ensure that lambda parameters are available inside lambdabody.copy() (IDEA-222542)
GitOrigin-RevId: b31c6c8484d8e77e96dfad104b08ce13631ddeaa
2020-05-05 07:04:28 +00:00
Anna Kozlova
02d7164d3b java redundant cast: check erased context (IDEA-205885)
GitOrigin-RevId: 1dd464c7b8feba43181c9e60472170b2bbbaa72e
2020-05-04 20:49:32 +00:00
Tagir Valeev
3643ee6506 Fixes according to review IDEA-CR-61871
GitOrigin-RevId: 206247808adba050a5839ee8ac0be790bb53c8ac
2020-04-24 08:26:53 +00:00
Tagir Valeev
ec8510b0a6 PsiPolyExpressionUtil#isBooleanOrNumericType: do not check bounds
JLS 15.25 says: ...has return type boolean or Boolean. or ...is convertible to a numeric type.
JLS 5.1.8 says:
A type is said to be convertible to a numeric type if it is a numeric type (§4.2), or it is a reference type that may be converted to a numeric type by unboxing conversion.

Nothing about bounds
PolyConditionalExpressionWithTargetPrimitive test behavior matches Java 9+ now (with --release=8)

GitOrigin-RevId: fa14e909ad623a3ab6bb8355bbbe396003cd782c
2020-04-23 08:56:21 +00:00
Peter Gromov
0b3f27a0af java: make resolveAllQualifiers go through RecursionManager to take advantage of its memoization (IDEA-236961)
GitOrigin-RevId: 1bfe281cbfaa8c6423a12313daf6f72aae738846
2020-04-17 06:14:17 +00:00
Anna Kozlova
641ac74ad8 java inference: support nested constraints inside code blocks (IDEA-237446)
GitOrigin-RevId: e865db7a88560615b1abca31b3ceefeb1ae76573
2020-04-14 12:01:57 +00:00
Anna Kozlova
d439f31f50 failing performance test for IDEA-236961
GitOrigin-RevId: 37ffa237be6c2c6965d8ce72854ef2976c6c837d
2020-04-14 09:20:37 +00:00
Anna Kozlova
0580ad0043 don't prohibit caching if overload resolution is impossible (IDEA-221094)
exactly one candidate is available

GitOrigin-RevId: 4c6d5b4eef79fb60af46d8d9db9f7e49adb2f8c4
2019-12-04 19:31:48 +00:00
Anna.Kozlova
4ad4e7d908 java overload resolution: fix NPE
found by property testing

GitOrigin-RevId: b45cb07402ad58a37886b7f1b5afb62bca2746fe
2019-12-04 09:38:15 +00:00
Anna.Kozlova
21e434894f java inference: stop when argument has no associated formal parameter
GitOrigin-RevId: cbc4e435f6e03bd06eac4dcf21196bdd61dc6c3d
2019-12-03 16:04:11 +00:00
Anna.Kozlova
c20dfc0165 java inference: ignore method reference constraints when starting from them
EA-209460 - IAE: ObjectUtils.$$$reportNull$$$

GitOrigin-RevId: 8476b832fcc1c85c10aed6ea56f65645bfd02b03
2019-11-28 10:38:15 +00:00
Anna.Kozlova
d4ff582489 assert no type execution under overload lock for diamonds
IDEA-CR-55327

GitOrigin-RevId: e2b1043a41b9548df3c2eb263a27da6d6c22b6be
2019-11-19 09:12:58 +00:00
Tagir Valeev
3fa35e0750 testResolveDiamondBeforeOuterCall simplified (TreeSet ctor overloads don't matter here)
GitOrigin-RevId: 6b303239bed1ffcfd94cbd54f781541e38dc5837
2019-11-15 10:05:32 +00:00
Tagir Valeev
85f72bfc0f testResolveDiamondBeforeOuterCall (fails if new expression type is requested before highlighting)
GitOrigin-RevId: b01abb3fbbebe28e3115aa109005851b62a02e7b
2019-11-15 08:03:12 +00:00
Anna Kozlova
eb79bfc3d3 java inference: ease assertion for lambdas in non-generic calls (EA-143883)
GitOrigin-RevId: 0e5ff0aa54375926c8ea5e2140458457250034dc
2019-11-08 21:03:13 +00:00
Anna Kozlova
856ec460c6 overload resolution: detect qualifier of unqualified call by processDeclaration's source where candidate was found
conflict resolution for static methods of the interface found by inheritance and nesting

GitOrigin-RevId: b637b02de4f59010a138c66890d1efcbcd1d588d
2019-11-07 02:40:58 +00:00
Anna Kozlova
d6297185ce java resolve: don't stop on found static method of the interface (IDEA-225660)
if the call site' qualifier is incorrect

GitOrigin-RevId: 782629045050df08fed3cf554682b63db8c9e1a8
2019-11-07 02:40:58 +00:00
Anna.Kozlova
589b029a97 java method ref highlighting: don't mirror errors of not applicable methods of return type (IDEA-224306)
GitOrigin-RevId: 40b4293c754640445b9fac741eab24261e8060cc
2019-10-10 10:03:10 +00:00
Anna.Kozlova
87deef960c incompatible types: highlight parent call instead of lambda when the error isn't related to lambda (IDEA-218801)
GitOrigin-RevId: 17a2f1f62f7703930aa25a8cfd6dfd4a918e1fe7
2019-10-10 07:01:11 +00:00
Anna.Kozlova
8db821428d lvti: special highlight for self referencing variables (IDEA-224449)
assume that null as type of the left side of the assignment is not possible

GitOrigin-RevId: c407cdc11e991c8db24ffd683f3b8ea883d41244
2019-10-09 10:32:32 +00:00
Anna Kozlova
1768efa804 incompatible types: highlight only wrong arguments instead of full arg list (IDEA-220107)
GitOrigin-RevId: 38a12e4fa7ea27d156dae1fe6bc7bd6902db6251
2019-09-20 19:31:36 +00:00
Anna Kozlova
fb5f755910 java inference: prevent recursive conflict resolution when it isn't prevented by ResolveCache guard
advanceResolve(incomplete=true) prevents guard to work

GitOrigin-RevId: 437ec02af808a89c8339909411bec6d95ff225dc
2019-09-13 07:12:19 +00:00
Anna Kozlova
d829a7c8f4 java inference: ensure that applicability check is not re-entered
this fixes assertion
	at com.intellij.util.ObjectUtils.assertNotNull(ObjectUtils.java:84)
	at com.intellij.psi.infos.MethodCandidateInfo.inferTypeArguments(MethodCandidateInfo.java:453)
caused by including expression compatibility constraints for expressions inside lambdas for which parameter types are calculated

GitOrigin-RevId: 0588bff4a719fb73ff49a51bc86635e56cd8d146
2019-09-05 19:19:32 +00:00
Anna Kozlova
55426d88a9 java resolve: ensure cached all qualifiers do not lead to cached types based on ThreadLocalTypes values
fixes failed check for different types returned on different threads (see JavaResolveCache#reportUnstableType)

GitOrigin-RevId: a5efd5e5a9657ad55c74e413185959c517e341e8
2019-09-01 17:03:16 +00:00
Anna Kozlova
1e5631c6ee fixing grammar
IDEA-CR-51559

GitOrigin-RevId: f44d7b539164a8086c022b786c721bf7011608b1
2019-08-22 01:50:10 +03:00
Anna Kozlova
fd969c0595 java resolve: cache resolved qualifiers when global cache is prohibited (IDEA-219505) ^peter
when type inference is called, it's not known if the client calls inference on resolved method or enumerates all possible candidates and thus the results cant be cached; current implementation is pessimistic and prohibit all caching during inference. Thus, for long method call chains which depend on some non-trivial calculations, it may be extremely resource consuming. Let's cache all qualifiers locally: this doesn't prevent recalculation globally but works around performance problems per single call

GitOrigin-RevId: b9b42cbc50918259f5de3a81d5f3a38967c153f1
2019-08-20 10:01:31 +03:00
Anna Kozlova
8777687e32 java inference: proceed with nested inference for lambda parameter type detection (IDEA-219330)
GitOrigin-RevId: f0a4862b94f9cff4c88b1f56425663bbd8659d7a
2019-08-07 00:03:21 +03:00
Anna Kozlova
616e3ca030 method references: allow access to protected methods through super (IDEA-217862)
GitOrigin-RevId: f1d86f6127a64146e87998423f3034e38a46409c
2019-08-05 23:03:36 +03:00
peter
a04504dddc don't suggest inaccessible qualifiers when chain-completing a java method reference (IDEA-217955)
GitOrigin-RevId: 78fc63c40948e6873279d6fe4c923bf3113a8b2e
2019-07-23 17:44:15 +03:00
Anna Kozlova
67839b3676 java unchecked warning: narrow down highlighting to class/method reference (IDEA-203860)
GitOrigin-RevId: ee686cedeef7aa677445b5054c9e191ce1d15a77
2019-07-15 12:05:58 +03:00
Anna Kozlova
bd882f2a97 java inference: stop walkUp in assignment context inside method call chain (IDEA-217928)
GitOrigin-RevId: 79ac2370cd302d7e38d029e065ff4a28ed8709a4
2019-07-11 23:22:40 +03:00
Anna Kozlova
cf944efffb java: adjusted "Cannot resolve method" message (IDEA-206898)
GitOrigin-RevId: 40fc7d00d6bcc4792dc097dde63dd40d08864068
2019-07-10 23:02:59 +03:00
Artemiy Sartakov
642c65dd11 MethodReturnTypeFix: highlight only return statements when method return type doesn't match expected (IDEA-216275)
GitOrigin-RevId: d5f7dc3b03d68d249ba29532b0e8c0555cae60d6
2019-07-08 15:09:05 +03:00
Anna Kozlova
afa0706bfc java highlighting: provide better incompatible types message on failed inference
GitOrigin-RevId: 5f97ec808f753d9ca40c417704ec93a802512745
2019-07-08 12:04:21 +03:00
Artemiy Sartakov
42d733a694 MethodReturnTypeFix: updated fix to change method return type based on return statements in method body (IDEA-216275)
GitOrigin-RevId: e97990950039123c8c41921a71342b8ed60afdee
2019-07-04 09:02:24 +03:00
Anna Kozlova
667d922108 overload resolution: static methods from super interfaces should be skipped in favor to instance methods (IDEA-216009)
GitOrigin-RevId: f172ea91498434cd956010df286dc418334a83b9
2019-06-16 07:52:26 +03:00
Roman Shevchenko
04e6f4a623 Cleanup (warnings; typos; formatting)
GitOrigin-RevId: 1cad4232ba1d1f58c522aa26019d245e2bf6832d
2019-06-16 06:52:20 +03:00
Vyacheslav Karpukhin
d5fb24d414 Merge commit 'a85b798667f6a81500b21eda3c8d508a28cb969c' into slava/out_of_process_sim_and_dev
GitOrigin-RevId: ccfc7bb2ab1846fbf2c169f6262ffa412f3efb80
2019-06-16 06:51:48 +03:00
Dmitry Jemerov
da9e941d80 @NotNull for RunConfigurationExtension.updateJavaParameters()
GitOrigin-RevId: 5c472044f340aeaf67f3a81695814e70e3a125f0
2019-06-16 06:51:17 +03:00
Vyacheslav Karpukhin
24d766790c Merge commit 'a85b798667f6a81500b21eda3c8d508a28cb969c' into egorzhdan/coverage
GitOrigin-RevId: 55b653eb620e8dc5642c467b0308e447a5ac32a7
2019-06-16 06:50:45 +03:00