Incompatible types
- 错误示例
- 代码块
- 错误分析
- 错误解决
- 扩展举例
- 总结
错误示例:
代码块
从错误提示中可以看出
需要java.util.list<com.dxc.raas.orchestrator.model.Robot>,
即,需要List<Robot>但找到的是com.dxc.leap.raas.common.model.ServiceResponse<java.util.list>,
即ServiceResponse<List>
错误分析:
robotService.getRobots()返回的实际类型是
com.dxc.leap.raas.common.model.ServiceResponse<java.util.list>而程序员写的返回类型是
java.util.list<com.dxc.raas.orchestrator.model.Robot>从而不符合
错误解决
修改robotService.getRobots()的返回类型
ServiceResponse<List> responses = robotService.getRobots()
扩展举例:
int str = String.toString();将会报错,因为String.toString()返回的是String类型,而程序员写的返回类型却是int型。所以会报错
总结:
Incompatible types
Required:......
Found:......
这种错误是由于类型不符合导致的:
等号前与等号后的类型不相等的
Incompatible types相关推荐
- java incompatible types: int cannot be converted to java.lang.Long
java incompatible types: int cannot be converted to java.lang.Long 解决方案: 1改成1L即可
- error: incompatible types when assigning to type ‘const struct wiphy_wowlan_support‘
环境说明 系统:Centos7 (3.10.0) 驱动版本:00014996-RTL8192EU_linux_v5.6.3.1_34030_COEX20171113-0047.20190613.zip ...
- 【Java】- Incompatible types. Found: java. lang. String', required:' byte, char, short or int'
IDEA项目编译报错:Incompatible types. Found: java. lang. String', required:' byte, char, short or int',swit ...
- C: error: incompatible types when initializing type ‘int’ using type ‘atomic_t’ {aka ‘struct <anonym
typedef.c:17:10: error: incompatible types when initializing type 'int' using type 'atomic_t' {aka ' ...
- flink报错:incompatible types for field cpuCores
现象 一个flink项目,flink版本1.9.2,对自己写的代码还是比较有数,但在本地测试环境提交任务运行的时候,报错如下,有些莫名其妙 org.apache.flink.client.progra ...
- 使用Process运行程序提示error: incompatible types: java.lang.Process cannot be converted to android.os.Proces
一.在android framework sevice里面 添加下面的代码,使用Process java中运行第三方程序,编译的时候提示 error: incompatible types: jav ...
- java.sql.SQLException: Cannot set createTime: incompatible types
今日在写OrderDaoImpl类,进行测试一直报错,起初以为是Order类的名字与数据库不同引起,在查询函数中起了别名来解决,但一直报Cannot set createTime错误,上网找了说法,都 ...
- Incompatible types for sink column报错解决
由于Flink支持的数据类型有限,特别是LocalDate之类的还不支持,所以对于POJO中使用了这些类型,就需要自行指定. 方法是在POJO class上添加org.apache.flink.api ...
- Android Studio报错:Incompatible types. Required:android.app.ActionBar及Android如何隐藏系统默认标题栏
今天在学习<第一行代码>中关于隐藏系统默认标题栏出现了以下错误从而造成程序崩溃: 通过上网查询将getSupportActionBar改成getActionBar完全没有效果.其他方法也都 ...
最新文章
- linux网络命名空间详解,Linux Network Namespace (netns) 详解
- 写了一个将VxWorks的shell打印输出到指定内存中的接口,可广泛用于CLI下的调试函数显示以及故障自动捕获等功能,稍作修改可以适合其它嵌入式OS...
- 还不知道事务消息吗?这篇文章带你全面扫盲
- linux i2c调试命令,嵌入式Linux下I2C接口调试
- python爬虫框架排行榜-公认8个效率最高的爬虫框架
- stdthread(3)detach
- 冒泡排序(Bubble_Sort)
- SpringMVC的Controller
- JLabel鼠标停在上面显示小手图标 点击跳转到相应网页
- 【观点】微博的弊端和它的真正意义
- Eucalyptus-NC管理
- 湿空气性质计算,随笔与学习记录 (4.空气比容,空气密度)
- linux关闭监听端口命令,如何在Linux系统中监听和关闭端口
- 【冬镜网】什么是搜索引擎优化?
- 帮你自动化办公的python - 自动提取pdf指定页(项目概述)
- fastboot 命令
- 【日常积累】hr标签的属性及样式
- 帝国源码php安装文件是哪个,帝国CMS数据库配置文件是哪个文件?
- 什么是jdk的java运行工具_下面( )是 JDK 中的 JAVA 运行工具。
- Servlet规范之安全
热门文章
- java null转空_Java对象为空时,将null转换为 保存值为空的属性
- Windows下使用Inno Setup 制作exe安装包
- 迁移学习和模型的微调
- 漫步数学分析十九——介值定理
- 用c语言编写界面,「分享」C语言如何编写图形界面
- leakcanary内存泄露检测工具 Dumping memory, app will freeze. Brrr
- CAD经典版本界面设置
- 苹果电脑怎么关闭当前页面、打开终端、截图
- linux 内存清理 释放命令,linux 内存清理释放命令(示例代码)
- MPLS:多协议标签交换