Skip to content

Null-safety error related to superclass and varargs in Spring #1113

@sdeleuze

Description

@sdeleuze

In org.springframework.cache.interceptor null-marked package:

  • KeyGenerator defines a method with a @Nullable Object... params parameter
  • SimpleKeyGenerator overrides this method with the same @Nullable Object... params

This error is reported by NullAway, looks like a bug to me:

  /Users/sdeleuze/workspace/spring-framework/spring-context/src/main/java/org/springframework/cache/interceptor/SimpleKeyGenerator.java:46:
error: [NullAway] parameter params is @NonNull, but parameter in superclass method org.springframework.cache.interceptor.KeyGenerator.generate(java.lang.Object,java.lang.reflect.Method,java.lang.Object...) is @Nullable
        public Object generate(Object target, Method method, @Nullable Object... params) {
                                                                                 ^
      (see http://t.uber.com/nullaway )
  1 error

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugjspecifyRelated to support for jspecify standard (see jspecify.dev)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions