Ensure all packages declare package-info.java with null-safety annotations
This commit picks up where the two previous commits left off. Specifically, this commit: - Removes the "severity=warning" configuration to ensure that violations actually fail the build. - Fixes regular expressions for suppressions by matching forward slashes using `[\\/]` instead of `\/`. - Moves the configuration for newly introduced checks to locations in checkstyle.xml that align with the existing organization of that file. - Renames the IDs for RegexpSinglelineJava checks from javaDocPackageNonNullApiAnnotation/javaDocPackageNonNullFieldsAnnotation to packageLevelNonNullApiAnnotation/packageLevelNonNullFieldsAnnotation, respectively, since these checks are not related to Javadoc. - Simplifies the null-safety annotation checks to match against imported annotation types, which enforces consistency across package-info.java files for the annotation declarations. - Simplifies the RegEx for JavadocPackage suppressions to only exclude packages not under src/main/java (vs src/main) and those in the framework-docs module. - Consistently suppresses all checks for the `asm`, `cglib`, `objenesis`, and `javapoet` packages in spring-core. - Adds explicit suppressions for null-safety annotations for the `lang` package in spring-core. - Adds explicit suppressions for null-safety annotations for the `org.aopalliance` package in spring-aop. - Revises the RegEx for null-safety annotation suppressions to only exclude package-info.java files not under src/main/java and additionally to exclude package-info.java files in the framework-docs module as well as those in the spring-context-indexer, spring-instrument, and spring-jcl modules. - Adds all missing package-info.java files. - Adds null-safety annotations to package-info.java files where appropriate. Closes gh-30069
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* AspectJ-based dependency injection support.
|
||||
*/
|
||||
@NonNullApi
|
||||
@NonNullFields
|
||||
package org.springframework.beans.factory.aspectj;
|
||||
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.lang.NonNullFields;
|
||||
9
spring-aspects/src/main/java/org/springframework/cache/aspectj/package-info.java
vendored
Normal file
9
spring-aspects/src/main/java/org/springframework/cache/aspectj/package-info.java
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* AspectJ-based caching support.
|
||||
*/
|
||||
@NonNullApi
|
||||
@NonNullFields
|
||||
package org.springframework.cache.aspectj;
|
||||
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.lang.NonNullFields;
|
||||
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* AspectJ-based dependency injection support driven by the
|
||||
* {@link org.springframework.beans.factory.annotation.Configurable @Configurable}
|
||||
* annotation.
|
||||
*/
|
||||
@NonNullApi
|
||||
@NonNullFields
|
||||
package org.springframework.context.annotation.aspectj;
|
||||
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.lang.NonNullFields;
|
||||
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* AspectJ-based scheduling support.
|
||||
*/
|
||||
@NonNullApi
|
||||
@NonNullFields
|
||||
package org.springframework.scheduling.aspectj;
|
||||
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.lang.NonNullFields;
|
||||
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* AspectJ-based transaction management support.
|
||||
*/
|
||||
@NonNullApi
|
||||
@NonNullFields
|
||||
package org.springframework.transaction.aspectj;
|
||||
|
||||
import org.springframework.lang.NonNullApi;
|
||||
import org.springframework.lang.NonNullFields;
|
||||
Reference in New Issue
Block a user