当前位置:网站首页>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
边栏推荐
- Machine learning -- - theory of support vector machine (SVM)
- HCIP BGP综合实验 建立对等体、路由反射器、联邦、路由宣告及聚合
- Alluxio为Presto赋能跨云的自助服务能力
- 深入剖析成员变量和局部变量的初始化问题
- Contents of encoding-indexes.js file printed with Bluetooth:
- 秒杀系统小demo
- pytorch basic operations: classification tasks using neural networks
- Tips for programmers to write PPT
- How to install the specified version package with NPM and view the version number
- ATM系统
猜你喜欢

How to install the specified version package with NPM and view the version number

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

点云旋转到参考坐标系方向(最小方向包围盒方法)

Nacos数据库配置

51 microcontroller peripherals article: dot-matrix LCD

使用jOOQ 3.14合成外键在视图上写隐式连接

npm does not recognize the "npm" item as the name of a cmdlet, function, script file, or runnable program.Please check the spelling of the name, and if the path is included, make sure the path is corr

HCIP BGP综合实验 建立对等体、路由反射器、联邦、路由宣告及聚合

Point Density-Aware Voxels for LiDAR 3D Object Detection 论文笔记

About the directory structure of the web application
随机推荐
OAuth 授权协议 | 都云原生时代了,我们应该多懂一点OAuth ?
Introduction to coredns
Redis(十二) - Redis消息队列
目标检测重要概念——IOU、感受野、空洞卷积、mAP
虚拟现实房产展示系统提前预见未来装修效果
反向解析dns服务器
A list of 300+ learning resources compiled by senior engineers of the Tao Department (the latest version in 2021)
C# 编码规范手册
An advanced method for solving palindromes
触发器简单解释
npm 和 yarn的区别
APP Bluetooth connection test of test technology
Shuttle + Alluxio 加速内存Shuffle起飞
跨桌面端Web容器演进
Not annotated parameter overrides @NonNullApi parameter
leetcode solves the linked list merge problem in one step
如何优化OpenSumi终端性能?
H5 access payment process - WeChat payment & Alipay payment
深入剖析成员变量和局部变量的初始化问题
程序员最重要的能力是什么?