当前位置:网站首页>开发报错记录
开发报错记录
2022-06-22 08:37:00 【回忆是昨天里的海】
项目上一直报了个空指针,但是我就是看不出来到底哪报错了,感觉处处排空了,报错位置在倒数第二行的jdyInfos.stream()处,Service代码如下,后来发现是jdyInfos这个list中有空的Object对象,后来对jdyInfos的Object对象做了判空处理
public List<String> getRequireBu() {
List<RequirementInfo> requirementInfos = this.list(Wrappers.lambdaQuery(RequirementInfo.class).select(RequirementInfo::getRequireNo)
.orderByDesc(RequirementInfo::getCreateTime));
List<String> requireNos = requirementInfos.stream().map(RequirementInfo::getRequireNo).filter(ele->StringUtil.isNotBlank(ele)).distinct().collect(Collectors.toList());
List<JdyInfo> jdyInfos = jdyInfoService.list(Wrappers.lambdaQuery(JdyInfo.class).select(JdyInfo::getSecondaryDept)
.in(JdyInfo::getRequireNo, requireNos).orderByDesc(JdyInfo::getUpdateTime));
List<String> list = jdyInfos.stream().map(JdyInfo::getSecondaryDept).filter(ele -> ele != null && StringUtil.isNotBlank(ele)).distinct().collect(Collectors.toList());//报错前
// List<String> list = jdyInfos.stream().filter(ele->ele != null).map(JdyInfo::getSecondaryDept).filter(ele -> ele != null && StringUtil.isNotBlank(ele)).distinct().collect(Collectors.toList()); //过滤空对象后,不报错了
return list;
}边栏推荐
- Spark Yarn内存资源计算分析(参考)--Executor Cores、Nums、Memory优化配置
- 13 代理模式
- Deeply analyze the usage of final keyword
- [conda]conda switch to source of China University of science and technology
- Some mathematical operation functions in LabVIEW
- Basic knowledge and practical application of redis
- MySQL sub database and sub table
- 新型冠状病毒疫情
- Introduction to MySQL database Basics
- 读取jar包里面文件夹下的所有文件
猜你喜欢

依图在实时音视频中语音处理的挑战丨RTC Dev Meetup

np.arange与np.linspace细微区别(数据溢出问题)

I spring and autumn web Penetration Test Engineer (elementary) learning notes (Chapter 3)

一学就会的tensorflow断点续训(原理+代码详解)

Eureka的InstanceInfoReplicator类(服务注册辅助工具)

What actions might cause thread context switching?

Interpreting the technology group in maker Education

深入理解MySQL索引凭什么能让查询效率提高这么多?

Matplotlib | temperature change visualization

报告:在技术领域,男性更有可能获得工作面试的机会
随机推荐
复杂科学在创客教学研究中的应用
Fastcorrect: speech recognition fast error correction model RTC dev Meetup
Mysql+orcle (SQL implements recursive query of all data of child nodes)
Implementation and landing of any to any real-time voice change RTC dev Meetup
Flask blog practice - realize the article list page and details page
steam教育文化传承的必要性
Flask博客实战 - 实现博客的分类管理
Read all files under the folder in the jar package
luogu P4557 [JSOI2018]战争
14 responsibility chain mode
15 命令模式
报告:在技术领域,男性更有可能获得工作面试的机会
I spring and autumn web Penetration Test Engineer (elementary) learning notes (Chapter 1)
Daily learning-01
np.arange与np.linspace细微区别(数据溢出问题)
Email giant exposes serious vulnerability, user data is stolen
19 备忘录模式
Questions 101 to 200 of the national information security grade examination nisp level 1 question bank (1)
Why can MySQL indexes improve query efficiency so much?
Yolov5 reports an error: attributeerror: 'upsample' object has no attribute 'recommend_ scale_ Solution of 'factor'