java - Minecraft Spigot 与 ImmutableList 有问题
问题描述
在代码末尾这个错误是什么问题?尝试了许多修复,但没有人帮助 https://i.stack.imgur.com/jwosT.png
解决方案
return (List<String>) ImmutableList.of();
这样做的问题是ImmutableList.of()
在应用强制转换之前确定了类型。
ImmutableList.of()
在那种情况下的类型是ImmutableList<Object>
。一个ImmutableList<Object>
不是一个ImmutableList<String>
。
我很惊讶您在这里需要任何类型提示:
return ImmutableList.of();
推荐阅读
- c# - 从每个 O365 用户收集邮箱属性所需的 PowerShell 脚本
- orientdb - 如何通过 Gremlin 查询删除 Orient DB 中的边?
- google-colaboratory - 在 Colab 上安装 Qiime2
- spring-boot - 如何从蓝图类构造 Kotlin 数据类
- c++ - C++14 遇到奇怪的“使用已删除函数”错误
- android - minifyEnabled 和字符串连接
- php - 使用php curl进行api调用时出现ssl错误
- ios - UILabel 宽度似乎不会自动调整
- matlab - Matlab:sign()函数的傅立叶系数正在振荡
- vagrant - Vagrant Up 可以使用多少硬盘空间?