Corda IntelliJ/Kotlin升级导致“;“不兼容类型”;错误?
几天前我更新了IntelliJ和kotlin的最新版本。我认为是这两种行为之一导致了我的问题。IntelliJ开始突出显示我的QueryCriteria语句中以前没有的错误:Corda IntelliJ/Kotlin升级导致“;“不兼容类型”;错误?,corda,Corda,几天前我更新了IntelliJ和kotlin的最新版本。我认为是这两种行为之一导致了我的问题。IntelliJ开始突出显示我的QueryCriteria语句中以前没有的错误: QueryCriteria myQueryCriteria = new QueryCriteria.LinearStateQueryCriteria(null, singletonList(uuid), null, Vault.StateStatus.ALL); 错误: Incompatible types. Found
QueryCriteria myQueryCriteria = new QueryCriteria.LinearStateQueryCriteria(null, singletonList(uuid), null, Vault.StateStatus.ALL);
错误:
Incompatible types. Found: 'net.corda.core.node.services.vault.QueryCriteria.LinearStateQueryCriteria', required: 'net.corda.core.node.services.vault.QueryCriteria'
我一直使用这种语法,因为我随后会将myQueryCriteria传递到查询中:
Vault.Page<myContractState> page = mockNodeA.getServices().getVaultService().queryBy(myContractState.class, myQueryCriteria);
Vault.Page=mockNodeA.getServices().getVaultService().queryBy(myContractState.class,myQueryCriteria);
该错误不会阻止我的测试运行。我尝试过更改一些设置,但最终意识到我最好先询问更熟悉java/kotlin/intelliJ/Corda的人,然后再让问题变得更糟。目前支持的kotlin版本是
1.2.71
(您可以在github()上查看或Corda的源代码)
我建议您降级Kotlin版本。快速历史记录:
- 最初安装的IntelliJ 2018.3至2019.3–无问题
- 升级至IntelliJ 2020.3.2–无问题
- 更新至IntelliJ 2021.1–出现错误
- 2021.1不允许我安装Kotlin插件1.2.71,因为它不受支持
- IntelliJ 2019.3 Kotlin插件1.3.61-release-IJ2019.3-1=无错误
- IntelliJ 2020.3 Kotlin插件203-1.4.10-release-IJ7717.8=无错误
- IntelliJ 2021.1 Kotlin插件211-1.4.32-release-IJ6693.72=错误
在构建、执行和部署中更改Kotlin编译器没有任何效果。我猜您指的是插件版本?我只能通过降低IntelliJ的等级来解决我的问题(参见下面的公认解决方案)。我真的不想那样做,但我想尽一切办法。我很欣赏你的想法。是的,插件版本。对不起,不清楚。投你的解决方案,有用的分析!