当前位置:网站首页>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
边栏推荐
猜你喜欢
BGP+MPLS综合实验
A list of 300+ learning resources compiled by senior engineers of the Tao Department (the latest version in 2021)
Meta公司内部项目-RaptorX:将Presto性能提升10倍
zabbix邮件报警和微信报警
25K test old bird's 6-year experience in interviews, four types of companies, four types of questions...
Write implicit join on view with jOOQ 3.14 synthetic foreign key
Not annotated parameter overrides @NonNullApi parameter
leetcode solves the linked list merge problem in one step
上海交大牵手淘宝成立媒体计算实验室:推动视频超分等关键技术发展
Machine learning -- - theory of support vector machine (SVM)
随机推荐
H5 access payment process - WeChat payment & Alipay payment
Analysis of the source code of the JS UI framework of Hongmeng system
制作web3d动态产品展示的优点
leetcode每天5题-Day04
关于鸿蒙系统 JS UI 框架源码的分析
Integrate ssm (1)
Differences between i++ and ++i in loops in C language
深度学习——CNN实现MNIST手写数字的识别
Shuttle + Alluxio 加速内存Shuffle起飞
MySql统计函数COUNT详解
Redis(十一) - 异步优化秒杀
BGP实验(路由反射器,联邦,路由优化)
保证家里和企业中的WIFI安全-附AC与AP组网实验
Introduction to coredns
Nacos安装详细过程
TikTok平台的两种账户有什么区别?
Node的安装与环境变量的配置
跨桌面端Web容器演进
Leetcode parentheses matching problem -- 32. The longest parentheses effectively
双重for循环案例(用js打印九九乘法表)