当前位置:网站首页>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
边栏推荐
- 【合集- 行业解决方案】如何搭建高性能的数据加速与数据编排平台
- flex布局(弹性布局)
- 排雷小游戏(C语言)
- Important concepts of target detection - IOU, receptive field, hole convolution, mAP
- How to perform concurrent calculation (stability test and stress test)?
- C language entry combat (13): decimal number to binary
- BGP experiment (route reflector, federation, route optimization)
- zabbix自动发现和自动注册
- A list of 300+ learning resources compiled by senior engineers of the Tao Department (the latest version in 2021)
- node安装和配置(node-v12.20.2-x64 ) 以及node版本切换介绍
猜你喜欢
随机推荐
C language entry combat (13): decimal number to binary
An advanced method for solving palindromes
Meta公司内部项目-RaptorX:将Presto性能提升10倍
无代码生产新模式探索
Mysql数据库 | 基于Docker搭建Mysql-8.0以上版本主从实例实战
nacos registry
线程基础(一)
MySQL数据表的基本操作和基于 MySQL数据表的基本操作的综合实例项目
leetcode一步解决链表合并问题
Nacos数据库配置
【合集- 行业解决方案】如何搭建高性能的数据加速与数据编排平台
Important concepts of target detection - IOU, receptive field, hole convolution, mAP
直播系统聊天技术(八):vivo直播系统中IM消息模块的架构实践
About the directory structure of the web application
C竞赛训练
Linux CentOS8安装Redis6
[OpenCV from entry to practice] image processing technology [pixel] (the most detailed in the whole network)
蚂蚁三面:MQ 消息丢失、重复、积压问题,有哪些解决方案?
oracle 远程连接数据库
[C language] LeetCode26. Delete duplicates in an ordered array && LeetCode88. Merge two ordered arrays









