• Stack Overflow Public questions & answers
  • Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers
  • Talent Build your employer brand
  • Advertising Reach developers & technologists worldwide
  • About the company

Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Not annotated parameter overrides @??? parameter

While overriding code:

from: org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader

I receive an IntelliJ warning:

Not annotated parameter overrides @??? parameter less... (Strg+F1) Inspection info: Reports problems related to @Nullable and @NotNull annotations usage configured in Constant conditions & exceptions inspection.

What can I do to avoid that?

DerBenniAusA's user avatar

Explanation

Although I can't reproduce this on AbstractItemCountingItemStreamItemReader from this artifact

, this annotation means that the parent method has some @NotNull / @NonNull annotation on the parameter, while the overriding method has no.

To fix it, you need to put the same annotation on the overriding method.

As I wrote, there is no such annotation in the version I've downloaded, but check your sources and copy the parameter annotation from there.

This warning sometimes gets buggy, so it can help to restart the IDEA. Restarting helped when I tried to write a trivial example to reproduce the warning.

A trivial reproducible example

Parent class:

Child class:

Cofigure non-null and nullable annotations for IDEA inspections

Dmitriy Popov's user avatar

Your Answer

Sign up or log in, post as a guest.

Required, but never shown

By clicking “Post Your Answer”, you agree to our terms of service , privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged spring intellij-idea warnings nullable notnull or ask your own question .

Hot Network Questions

non annotated parameter overrides

Your privacy

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy .

[Solved]-Not annotated parameter overrides @NonNullApi parameter-Springboot

https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/lang/NonNullApi.html :

A common Spring annotation to declare that parameters and return values are to be considered as non-nullable by default for a given package.

Here's the org/springframework/core/convert/converter/package-info.java :

@NonNullApi can be overridden at the method level with the @Nullable annotation to prevent the warning for a method that might return null, and that's what you see in org.springframework.core.convert.converter.Converter :

On you overriding method you don't specify the @Nullable annotation and thus the warning.

non annotated parameter overrides

Related Query

More Query from same tag

Ezoic

Copyright 2023 www.appsloveworld.com . All rights reserved.

Not annotated parameter overrides @NonNullApi parameter

non annotated parameter overrides

idea警告,就下面这样

Not annotated parameter overrides @NonNullApi parameter

你好! 这是你第一次使用 **Markdown编辑器** 所展示的欢迎页。如果你想学习如何使用Markdown编辑器, 可以仔细阅读这篇文章,了解一下Markdown的基本语法知识。

Not annotated parameter overrides @NotNull parameter

这个警告看起来很不友好,看起来是让你加上@NotNull注解或者@NonNullApi ,但是加了根本没用!!! 虽然只是警告 但是强迫症很难受!!!

直译:没有被注解的参数重写了@NonNullApi参数 这个提示是说因为被重写的方法的包被这个@NonNullApi注解了,所以方法参数也需要被注解 提示Not annotated parameter是说没有给参数加注解,至于加啥注解提示里没说。

解决方式(两种)

使用“javax.annotation.nonnull”注解可以解决.

直接给参数添加@Nonnull注解

使用“org.springframework.lang.NonNullApi”注解可以解决

注意是package-info文件

“相关推荐”对你有帮助么?

non annotated parameter overrides

请填写红包祝福语或标题

non annotated parameter overrides

你的鼓励将是我创作的最大动力

non annotated parameter overrides

您的余额不足,请更换扫码支付或 充值

non annotated parameter overrides

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。 2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

non annotated parameter overrides

IDE extension that lets you fix coding issues before they exist!

Setup is effortless and analysis is automatic for most languages

Self-Hosted

Fast, accurate analysis; enterprise scalability

When using null-related annotations at global scope level, for instance using javax.annotation.ParametersAreNonnullByDefault (from JSR-305) at package level, it means that all the parameters to all the methods included in the package will, or should, be considered Non- null . It is equivalent to annotating every parameter in every method with non-null annotations (such as @Nonnull ).

The rule raises an issue every time a parameter could be null for a method invocation, where the method is annotated as forbidding null parameters.

Noncompliant Code Example

Compliant solution.

Two solutions are possible:

IMAGES

  1. spring

    non annotated parameter overrides

  2. java

    non annotated parameter overrides

  3. java

    non annotated parameter overrides

  4. Generate test case parameter overrides table

    non annotated parameter overrides

  5. Override Model Parameters in a Test Case

    non annotated parameter overrides

  6. (PDF) Global relaxed non-stationary multisplitting multi-parameter methods

    non annotated parameter overrides

VIDEO

  1. Mind Control Headband (Second Life)

  2. java Class 08 || java predefined and user defined Classes and methods definations and program

  3. what is sampling errors in research l category of sampling error l formula of sampling error

  4. किस्मत ? Probability

  5. EME Lecture No 3 #Error Sources of Error Types of Error

  6. SSC CGL MAINS

COMMENTS

  1. Not annotated parameter overrides @??? parameter

    , this annotation means that the parent method has some @NotNull / @NonNull annotation on the parameter, while the overriding method has no. To

  2. External annotations: Not annotated parameter overrides @NotNull

    The bug is that this warning appears when "@NonNull" should be used to annotate an overridden parameter, but the warning text indicates that

  3. Warning "Not annotated parameter overrides ...

    What steps will reproduce the issue? ... What is the expected result? Smth like "Not annotated parameter overrides NotNull parameter", or no warnings. What

  4. Not annotated parameter overrides @NonNullApi parameter

    @NonNullApi can be overridden at the method level with the @Nullable annotation to prevent the warning for a method that might return null, and that's what you

  5. Meaning of Android Studio error: Not annotated parameter overrides

    Android : Meaning of Android Studio error: Not annotated parameter overrides @NonNull parameter [ Beautify Your Computer

  6. Not annotated parameter overrides @NotNull parameter

    Not annotated parameter overrides @NotNull parameter ... The purpose is to allow the compiler to warn when certain assumptions are being violated

  7. Not Annotated Parameter Overrides Parameter

    parameter is annotated, the analyzer reports an error if the pointer is null., Optional pointer parameters When a pointer parameter annotation, This annotation

  8. Not annotated parameter overrides @NonNullApi parameter__古井

    现象:idea报错,就下面这样Not annotated parameter overrides @NonNullApi parameter类似的还有这个:Not annotated parameter overrides @NotNull

  9. Java static code analysis: Nullness of parameters should be

    The signature of the method is not coherent and should be annotated to allow null values being passed as parameter. @javax.annotation.

  10. 1.15.2

    ... parameters for onCommand, over commandsender, command and st, with the message "Not annotated parameter overrides @NotNull parameter"