当前位置:网站首页>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
边栏推荐
- 为什么4个字节的float要比8个字节的long大呢?
- zabbix邮件报警和微信报警
- npm 无法将“npm”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
- 科技赋能拉萨之“肺”,华为助力拉鲁湿地智慧管理守护绿水青山
- 字节面试题:如何保证缓存和数据库的一致性
- HCIP BGP综合实验 建立对等体、路由反射器、联邦、路由宣告及聚合
- selenium + robotframework的运行原理
- Integrate ssm (1)
- APT + Transform 实现多模块应用Application生命周期分发
- 在腾讯做外包测试的那些日子.....
猜你喜欢
随机推荐
5款经典代码阅读器的使用方案对比
Point Density-Aware Voxels for LiDAR 3D Object Detection Paper Notes
pytorch基本操作:使用神经网络进行分类任务
eggjs controller层调用controller层解决方案
点云旋转到参考坐标系方向(最小方向包围盒方法)
C 竞赛——捕鱼
在腾讯做外包测试的那些日子.....
leetcode一步解决链表反转问题
Leetcode parentheses matching problem -- 32. The longest parentheses effectively
程序员写PPT的小技巧
[OpenCV from entry to practice] image processing technology [pixel] (the most detailed in the whole network)
Features and installation of non-relational database MongoDB
上海交大牵手淘宝成立媒体计算实验室:推动视频超分等关键技术发展
npm、cnpm的安装
leetcode-338.比特位计数
【解决】RESP.app 连接不上redis
Node installation and configuration of environment variables
使用jOOQ 3.14合成外键在视图上写隐式连接
5年在职经验之谈:2年功能测试、3年自动化测试,从入门到不可自拔...
Nacos客户端启动出现9848端口错误分析(非版本升级问题)








