Commit Graph

1209 Commits

Author SHA1 Message Date
Bas Leijdekkers
6916b6b005 Java: better error message when there are more arguments than parameters (IDEA-336129)
GitOrigin-RevId: a17a5f0f3878b9baf211737a614d1aa1a5103d31
2024-06-28 17:14:56 +00:00
Tagir Valeev
f701cdab11 [java-highlighting] Test for IDEA-350192 Opening < is missing for generics in inspection message
GitOrigin-RevId: 0de35be85e748d6a50d3bca9c13dcd8116e6ffdf
2024-04-17 14:20:37 +00:00
Tagir Valeev
d4b107d27a [java] The highest language level is now 22
Some tests are adjusted, as now (after unnamed variables release), we warn on every unused lambda parameter

GitOrigin-RevId: 17ce095a19332d22ba0cbcef1e6751ea309ca774
2024-03-15 14:05:44 +00:00
Bas Leijdekkers
d19410735d [java] improve error message (IDEA-223692)
GitOrigin-RevId: df344c76be34232b3dc682d36b9d233ab2a6d54f
2024-03-10 15:30:11 +00:00
Mikhail Pyltsin
82abbe2dbb IJ-CR-119726 [java-highlighting] S IDEA-306108 Assignment to a variable with non-denotable type: confusing error message
- fix for quickfix
- refactoring

GitOrigin-RevId: aedc118f2dd67bf56391792e7cd3042a8f7f33a8
2024-01-25 16:31:41 +00:00
Bas Leijdekkers
ab928055bb Java: better error reporting and quick fixes for the diamond operator and generic array creation (IDEA-299195)
GitOrigin-RevId: baa354ad9132bf6d939f19ecd2cfd6cfc56466a2
2024-01-08 17:34:42 +00:00
Mikhail Pyltsin
8adeaf3193 [java-highlighting] IDEA-306108 Assignment to a variable with non-denotable type: confusing error message and useless quick-fix
- add `anonymous` when it is not clear what type is used

GitOrigin-RevId: f3395a590fd4a48a5570fdf9ace540845e5f3879
2023-11-13 17:04:45 +00:00
Bas Leijdekkers
60a6cb2a00 Java: Provide better error message - illegal forward reference (IDEA-337031)
GitOrigin-RevId: 789b0bca6e6b1f9d0d366cd20a011c194cf1af0d
2023-11-06 11:16:57 +00:00
Bas Leijdekkers
13826505b1 Java: improve error message - repeated modifier (IDEA-330995)
GitOrigin-RevId: c2e4ddef81f2df01c0cd16ebc989f8130d255056
2023-11-01 16:15:17 +00:00
Mikhail Pyltsin
435980a002 [java-highlighting] IDEA-333141 incorrect highlighting for default and static method in interfaces
- case `static` method from class and `default` method from interface must be highlighted
- case `abstract` method from class and `static` method from interface must be highlighted

GitOrigin-RevId: 49609ad0c75b132766b85b8b232fbefddfa02239
2023-09-29 16:33:52 +00:00
Mikhail Pyltsin
0aa4d2f4f2 [java-highlighting] IDEA-332057 Not show cannot override instance error in case static methods is inherited
GitOrigin-RevId: c16f27e9799cba34bf15ec27c40430161bb7c9b3
2023-09-15 11:10:03 +00:00
Mikhail Pyltsin
bed8faeb52 [java-inspections] IDEA-328239 Casting with conjunction
- fix formatting

GitOrigin-RevId: 74955a0e5ddc5d5894455fcbfb3bec813d081b84
2023-08-30 13:11:27 +00:00
Mikhail Pyltsin
bdf1d8226d [java-inspections] IDEA-328239 Casting with conjunction
- Check if SAM is implemented in conjunction
- check lambda Methods signature with generic from types

GitOrigin-RevId: 981b75d4417e08bb6e392a2ab78d6104de19b84f
2023-08-29 22:10:43 +00:00
Mikhail Pyltsin
320f621750 Revert "[java-inspections] IDEA-328239 Casting with conjunction"
This reverts commit 97e21dbacccd9382e48387295a911b127882e625.

GitOrigin-RevId: 572b3b40ac196132e233d044631ee27b565f0edc
2023-08-29 22:10:40 +00:00
Mikhail Pyltsin
3072396ff6 [java-inspections] IDEA-328239 Casting with conjunction
- Check if SAM is implemented in conjunction
- Created lambda Methods signature with generic from types

GitOrigin-RevId: 97e21dbacccd9382e48387295a911b127882e625
2023-08-29 18:57:55 +00:00
Mikhail Pyltsin
899e5292e5 [java-highlighting] IDEA-316141 incorrect resolving static reference to static method in interfaces
GitOrigin-RevId: d558946ecb71dd2edb475d96508b1965a1036d9a
2023-04-06 15:51:30 +00:00
Mikhail Pyltsin
7129c6a6e2 [java-completion] IDEA-314367. Completion for similar methods
GitOrigin-RevId: ccce34749357dbd8b01625cc4b8322ae50445cf4
2023-03-01 11:24:28 +00:00
Mikhail Pyltsin
ff51cc96fe [java-completion] IDEA-314367. Completion for similar methods
GitOrigin-RevId: 7f12554a48a88920f81b093c58af55ed5c47ffc6
2023-02-28 20:05:18 +00:00
Tagir Valeev
b2dfb4c8a8 [java-highlighting] Do not report lambda return value error if its return type contains unsubstituted type variable
Fixes IDEA-310129 IDE hint a wrong position of Java method param compile error
Also: AdaptExpressionTypeFixUtil: try to determine wrong parameter even if several parameter types mention type parameter
Also: AdaptExpressionTypeFixUtil: new type mismatch fix to replace call with qualifier

GitOrigin-RevId: fbc63c0eb3415983ccf52ed5ade15b5895b65b21
2023-01-17 15:37:18 +00:00
Bas Leijdekkers
14a69c17fc Java: offer quick-fix to implement abstract method in enum (IDEA-231187)
GitOrigin-RevId: d7ee95a34123b69ad5ad2b3f59a5da614412e074
2022-12-05 13:46:39 +00:00
Andrey Cherkasov
e7f7a140b7 [java-highlighting] Default method overrides a member of 'java.lang.Object': false negative
IDEA-306394

GitOrigin-RevId: 3a5938ae9de0d2d5e0e7c713fa86f4b672fec0d3
2022-11-29 17:01:35 +00:00
Roman Ivanov
ed25641608 [java, parser] more specific error in argument list IDEA-256731
GitOrigin-RevId: 66c114bf41f27833279eca995c831af0d43628bb
2022-11-18 14:57:51 +00:00
Tagir Valeev
a0bc3ee404 [java-highlighting] Better actual type definition; fixes for some type mismatch in collectors
GitOrigin-RevId: 3652f4511a067b86bc9138f492a2a88cded09de0
2022-08-08 13:59:57 +00:00
Anna Kozlova
205ff84754 testdata for EA-443617 T: PsiDiamondTypeImpl.resolveInferredTypesNoCheck
fixed by 5fc2f7118bf68a1d0b9f80bfcbbbfa768fc6bea8

GitOrigin-RevId: 93cfc70499f4f9cc5d8d4ccdbde1df985f1b313f
2022-07-11 13:21:20 +00:00
Anna Kozlova
79200753fb [java] fix spaces in test data
GitOrigin-RevId: d18a60e9f966bf88b2fc2504cc1386606a980941
2022-07-08 14:04:21 +00:00
Anna Kozlova
5a29d515fc [java] skip diamond inference for constructor calls of static nested classes
EA-246216 - T: JavaMethodsConflictResolver.resolveConflict

GitOrigin-RevId: 5fc2f7118bf68a1d0b9f80bfcbbbfa768fc6bea8
2022-07-08 09:59:12 +00:00
Anna Kozlova
4dc5c9a5b0 [java] fix assertion condition
https://web.ea.pages.jetbrains.team/#/issue/396705
if method call provides explicit type arguments then no inference happens and there is no need in protection

GitOrigin-RevId: 062e4f6591bbdce03ed7ee8d666bea191bf1ba15
2022-07-06 12:28:57 +00:00
Anna Kozlova
3db82d3846 [java] inference: completely ignore expressions over which overload resolution is started
logging for EA-241551 - NPE: MethodReferenceResolver$0$0.inferTypeArguments, as there is no reproducible example, still

GitOrigin-RevId: 46216cd8171479d14af2283cf9cd4a35e68d9b48
2022-07-04 12:06:22 +00:00
Anna Kozlova
665998b55c [java] don't check poly rExpression from assignment to avoid poly expression type calculation during overload resolution
EA-434232 - T: PsiMethodCallExpressionImpl$TypeEvaluator.fun

GitOrigin-RevId: f8eca5cf007c2d453cafbcc5f72215f7c91daf39
2022-06-30 08:13:27 +00:00
Anna Kozlova
37e5457c2d [psi] ensure that cache in PsiExpressionsList#getExpressions is not corrupted during highlighting (IDEA-296766)
safer it would be to return array.clone() but there is a suspicion that it would to too expensive

GitOrigin-RevId: 9fd84fa2c3ff2d1d982d5747ec0f8f22fa220d5c
2022-06-28 15:34:01 +00:00
Andrey.Cherkasov
071a2db306 [java-highlighting] Modifier 'final' not allowed at interface methods
IDEA-290172
IJ-CR-23088

GitOrigin-RevId: f93deff04def5d65e0fe0463d1f4d5ba8a8b29d9
2022-04-28 03:39:54 +00:00
Anna Kozlova
92c59dacba [java] [inference] ease conflict detection in intersection types (IDEA-289929)
GitOrigin-RevId: aee88647f315474c421c31512f5edad3a4d07dfd
2022-03-04 15:44:51 +00:00
Anna Kozlova
8bb3536c11 [java] effectively final: ensure checks are performed on the same variable
GitOrigin-RevId: 77dc60e5a5119eecdd73268e192bd52390dff342
2022-02-10 14:42:24 +00:00
Anna Kozlova
4a300c672b [java] don't include fully qualified name in unresolved call messages (IDEA-282207)
GitOrigin-RevId: 3f22a64e3ab3173157368140af5d072e3cad2654
2022-01-28 07:21:30 +00:00
Anna Kozlova
e3c0d74cb6 [java] don't propagate ellipsis type as target type for non-vararg calls (IDEA-286407)
GitOrigin-RevId: 3693373240012db841bffaca1a5f8765200acbc8
2022-01-17 18:21:45 +00:00
Anna Kozlova
724ed16f6f [java] replace default catch block template (IDEA-161593)
`throw e` won't fix the compilation error, comment - is not really better than empty catch block.

GitOrigin-RevId: ea002c332900b032392e766f3dd13fe3258ad49c
2022-01-14 20:39:23 +00:00
Anna Kozlova
e6165048e8 [java] skip plain cannot infer diamond error (IDEA-283409); add ambiguous constructor call (IDEA-272115)
this unifies error messages with method calls and allows more specific tooltips and additional fixes

GitOrigin-RevId: 5ab4340d822bba3d6563da12a16e4c41216a8627
2021-11-29 19:27:48 +00:00
Anna Kozlova
0567932ab5 [java] junit 5 tests for fixture based highlighting tests
GitOrigin-RevId: a337b1d17a69bffb4df25f5e7c79bda973c5b4a2
2021-11-20 15:15:12 +00:00
Anna Kozlova
c266a5b737 [java] simplify error message
GitOrigin-RevId: 82e449029d1d03994dd6b4e68a5d280dd0f5b0b9
2021-11-17 12:03:12 +00:00
Anna Kozlova
846afc113d [java] expand error message about incompatible lambda expression (IDEA-282399)
GitOrigin-RevId: 39b243021881564fea9e2b359433ab79632697f4
2021-11-16 08:08:51 +00:00
Anna Kozlova
1b3bddda3b [java] [overload resolution] actively prune lambdas with wrong number of parameters (IDEA-279558)
GitOrigin-RevId: e6fdb4b920ec38c8f51cef14c33bc2c26321dd09
2021-10-05 19:12:50 +00:00
Anna Kozlova
8e5bc65c2a [java] [inference] fix explicit type lambda pertinent to applicability check (IDEA-279477)
GitOrigin-RevId: f5249362b724b60a4cac5d3856f03f61743d7266
2021-10-04 16:13:22 +00:00
Anna Kozlova
227d48e08b [java] highlighting: show interface.super error if interface is inherited through super class as well (IDEA-278862)
GitOrigin-RevId: fc0fd40caa806a4519f764bd055d6bcdbea0e75f
2021-09-27 07:41:51 +00:00
Anna Kozlova
dea5a38f11 [java] [inference] limit bound promotion per one parameter (IDEA-277612)
GitOrigin-RevId: 0ed133250f1c68c5c14b5e6c5683b03084592e1d
2021-09-14 06:40:42 +00:00
Anna Kozlova
f47a4e818b [java] method references overload resolution (IDEA-276614; IDEA-276613)
check static conflicts between applicable methods vs most specific method of another search, as the spec says

GitOrigin-RevId: d11508968a88888c41f6d69e416ab8fa5e915e5d
2021-08-27 11:42:11 +00:00
trushev
7c1c056980 [java] method references overload resolution (IDEA-276614; IDEA-276613)
GitOrigin-RevId: a12beac2ccd0ecc2512c8b9feab5e04a868c3935
2021-08-27 11:42:08 +00:00
Anna Kozlova
f33a1f5426 [functional expressions search] check method equality when applicable (IDEA-276298)
otherwise unrelated lambdas/method references may land in results when intermediate inheritors contain default methods

GitOrigin-RevId: aa5baae37ff676ca477ca41d82b782c42d5fda6c
2021-08-18 15:11:51 +00:00
Anna Kozlova
d43848c086 [change signature] ensure base method is refactored in functional expression case (IDEA-276192)
don't reorder usages for no reason

GitOrigin-RevId: 2bdeee871d696c7351addc4a1a8e886d148f6186
2021-08-18 15:11:50 +00:00
Artemiy Sartakov
fb9bddf05c MemberModel: do not suggest moving into class if there's enclosing class present (IDEA-274893)
GitOrigin-RevId: 8800ed4e42320a3df002be58955a8a02f6149c17
2021-08-09 06:52:21 +00:00
Anna Kozlova
07fe5de1ce [java inference] treat intersection type in one more place (IDEA-274350)
GitOrigin-RevId: d31b30aab900748010f28b02c483c56982d26040
2021-07-27 06:56:28 +00:00