当前位置:网站首页>Not annotated parameter overrides @NonNullApi parameter
Not annotated parameter overrides @NonNullApi parameter
2022-08-02 06:44:00 【m0_67392931】
phenomenon
idea warning, just like this
Not annotated parameter overrides @NonNullApi parameter

Similar to this:
Not annotated parameter overrides @NotNull parameter
This warning looks very unfriendly, it seems to make you add the @NotNull annotation or @NonNullApi, but it is useless!!!
Although it's just a warning, OCD is hard!!!
Problem description
The error message is
Not annotated parameter overrides @NonNullApi parameter
Literal translation: @NonNullApi parameters are rewritten by parameters that are not annotated
This hint means that because the package of the overridden method is annotated with this @NonNullApi, the method parameters also need to be annotated
Prompt NotAnnotated parameter means that the parameter is not annotated. As for the annotation prompt, it is not mentioned.
Solutions (two)
Use "javax.annotation.Nonnull" annotation to solve
Add @Nonnull annotation directly to the parameter
import javax.annotation.Nonnull;@[email protected] class ScheduledConfigurer implements SchedulingConfigurer {@Overridepublic void configureTasks(@Nonnull ScheduledTaskRegistrar taskRegistrar) {taskRegistrar.setScheduler(taskExecutor());}}can be solved by using "org.springframework.lang.NonNullApi" annotation
Add @NonNullApi annotation to the package in the package-info.java file
@NonNullApipackage com.jswdwsx.configurer;import org.springframework.lang.NonNullApi;Let me introduce myself first. The editor graduated from Shanghai Jiaotong University in 2013. I worked in a small company and went to big factories such as Huawei and OPPO. I joined Alibaba in 2018, until now.I know that most junior and intermediate java engineers want to upgrade their skills, they often need to explore their own growth or sign up to study, but for training institutions, the tuition fee is nearly 10,000 yuan, which is really stressful.Self-learning that is not systematic is very inefficient and lengthy, and it is easy to hit the ceiling and the technology stops.Therefore, I collected a "full set of learning materials for java development" for everyone. The original intention is also very simple. I hope to help friends who want to learn by themselves but don't know where to start, and at the same time reduce everyone's burden.Add the business card below to get a full set of learning materials
边栏推荐
- 触发器简单解释
- 国际顶会OSDI首度收录淘宝系统论文,端云协同智能获大会主旨演讲推荐
- flex布局(弹性布局)
- DNS的解析流程
- Cyber Security Learning - Intranet Penetration 4
- 点云旋转到参考坐标系方向(最小方向包围盒方法)
- Analysis of the source code of the JS UI framework of Hongmeng system
- What are the ways to improve software testing capabilities?After reading this article, it will take you up a notch
- 卸载redis
- 金山云团队分享 | 5000字读懂Presto如何与Alluxio搭配
猜你喜欢

制作web3d动态产品展示的优点

跨桌面端Web容器演进

NPM 安装指定版本包的方法及版本号查看

腾讯大咖分享 | 腾讯Alluxio(DOP)在金融场景的落地与优化实践

leetcode-318.最大单词长度乘积

C语言操作符详解(2)

A list of 300+ learning resources compiled by senior engineers of the Tao Department (the latest version in 2021)

Home NAS server (4) | MergerFS and SnapRaid data backup

MarkDown Formula Instruction Manual

机器学习——支持向量机原理
随机推荐
5款经典代码阅读器的使用方案对比
C 竞赛——捕鱼
C# 编码规范手册
Difference and analysis of CPU usage and load
Not annotated parameter overrides @NonNullApi parameter
Nacos注册中心的部署与用法详细介绍
Redis(十二) - Redis消息队列
Guarantee WIFI security in home and enterprise-with AC and AP networking experiment
使用jOOQ 3.14合成外键在视图上写隐式连接
Analysis of port 9848 error at startup of Nacos client (non-version upgrade problem)
Kingdee International: Lost in half a year and last year, how does the business model of frantically burning money continue
Features and installation of non-relational database MongoDB
代码编世界 科技创未来
淘系资深工程师整理的300+项学习资源清单(2021最新版)
国际顶会OSDI首度收录淘宝系统论文,端云协同智能获大会主旨演讲推荐
物联网如何改变城市运行效率
OAuth 授权协议 | 都云原生时代了,我们应该多懂一点OAuth ?
The virtual reality real estate display system foresees the future decoration effect in advance
APT + Transform 实现多模块应用Application生命周期分发
flex layout (flexible layout)