-
Notifications
You must be signed in to change notification settings - Fork 38.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure all packages declare package-info.java with null-safety annota…
…tions 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
- Loading branch information
Showing
22 changed files
with
165 additions
and
50 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
spring-aop/src/main/java/org/springframework/aop/target/dynamic/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* Support for dynamic, refreshable {@link org.springframework.aop.TargetSource} | ||
* implementations for use with Spring AOP. | ||
*/ | ||
@NonNullApi | ||
@NonNullFields | ||
package org.springframework.aop.target.dynamic; | ||
|
||
import org.springframework.lang.NonNullApi; | ||
import org.springframework.lang.NonNullFields; |
10 changes: 10 additions & 0 deletions
10
spring-aop/src/main/java/org/springframework/aop/target/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* Various {@link org.springframework.aop.TargetSource} implementations for use | ||
* with Spring AOP. | ||
*/ | ||
@NonNullApi | ||
@NonNullFields | ||
package org.springframework.aop.target; | ||
|
||
import org.springframework.lang.NonNullApi; | ||
import org.springframework.lang.NonNullFields; |
9 changes: 9 additions & 0 deletions
9
spring-aspects/src/main/java/org/springframework/beans/factory/aspectj/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 changes: 9 additions & 0 deletions
9
spring-aspects/src/main/java/org/springframework/cache/aspectj/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
11 changes: 11 additions & 0 deletions
11
...ng-aspects/src/main/java/org/springframework/context/annotation/aspectj/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
9 changes: 9 additions & 0 deletions
9
spring-aspects/src/main/java/org/springframework/scheduling/aspectj/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
9 changes: 9 additions & 0 deletions
9
spring-aspects/src/main/java/org/springframework/transaction/aspectj/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
5 changes: 5 additions & 0 deletions
5
spring-beans/src/main/java/org/springframework/beans/factory/groovy/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
/** | ||
* Support package for Groovy-based bean definitions. | ||
*/ | ||
@NonNullApi | ||
@NonNullFields | ||
package org.springframework.beans.factory.groovy; | ||
|
||
import org.springframework.lang.NonNullApi; | ||
import org.springframework.lang.NonNullFields; |
4 changes: 4 additions & 0 deletions
4
...ntext-indexer/src/main/java/org/springframework/context/index/processor/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/** | ||
* Core package for Spring Framework's scanned component index. | ||
*/ | ||
package org.springframework.context.index.processor; |
4 changes: 4 additions & 0 deletions
4
spring-instrument/src/main/java/org/springframework/instrument/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/** | ||
* Core package for byte code instrumentation. | ||
*/ | ||
package org.springframework.instrument; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 5 additions & 2 deletions
7
spring-r2dbc/src/main/java/org/springframework/r2dbc/connection/init/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
/** | ||
* Provides extensible support for initializing databases through scripts. | ||
*/ | ||
@org.springframework.lang.NonNullApi | ||
@org.springframework.lang.NonNullFields | ||
@NonNullApi | ||
@NonNullFields | ||
package org.springframework.r2dbc.connection.init; | ||
|
||
import org.springframework.lang.NonNullApi; | ||
import org.springframework.lang.NonNullFields; |
7 changes: 5 additions & 2 deletions
7
spring-r2dbc/src/main/java/org/springframework/r2dbc/core/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
/** | ||
* Core domain types around DatabaseClient. | ||
*/ | ||
@org.springframework.lang.NonNullApi | ||
@org.springframework.lang.NonNullFields | ||
@NonNullApi | ||
@NonNullFields | ||
package org.springframework.r2dbc.core; | ||
|
||
import org.springframework.lang.NonNullApi; | ||
import org.springframework.lang.NonNullFields; |
5 changes: 5 additions & 0 deletions
5
...ng-test/src/main/java/org/springframework/test/context/event/annotation/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
/** | ||
* Test execution event annotations for the <em>Spring TestContext Framework</em>. | ||
*/ | ||
@NonNullApi | ||
@NonNullFields | ||
package org.springframework.test.context.event.annotation; | ||
|
||
import org.springframework.lang.NonNullApi; | ||
import org.springframework.lang.NonNullFields; |
5 changes: 5 additions & 0 deletions
5
spring-test/src/main/java/org/springframework/test/context/event/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
/** | ||
* Test event support classes for the <em>Spring TestContext Framework</em>. | ||
*/ | ||
@NonNullApi | ||
@NonNullFields | ||
package org.springframework.test.context.event; | ||
|
||
import org.springframework.lang.NonNullApi; | ||
import org.springframework.lang.NonNullFields; |
6 changes: 0 additions & 6 deletions
6
spring-test/src/main/java/org/springframework/test/package-info.java
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
spring-test/src/main/java/org/springframework/test/web/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
/** | ||
* Helper classes for unit tests based on Spring's web support. | ||
*/ | ||
@NonNullApi | ||
@NonNullFields | ||
package org.springframework.test.web; | ||
|
||
import org.springframework.lang.NonNullApi; | ||
import org.springframework.lang.NonNullFields; |
9 changes: 9 additions & 0 deletions
9
spring-web/src/main/java/org/springframework/http/codec/cbor/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/** | ||
* CBOR encoder and decoder support. | ||
*/ | ||
@NonNullApi | ||
@NonNullFields | ||
package org.springframework.http.codec.cbor; | ||
|
||
import org.springframework.lang.NonNullApi; | ||
import org.springframework.lang.NonNullFields; |
5 changes: 5 additions & 0 deletions
5
spring-web/src/main/java/org/springframework/web/context/request/async/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
/** | ||
* Support for asynchronous request processing. | ||
*/ | ||
@NonNullApi | ||
@NonNullFields | ||
package org.springframework.web.context.request.async; | ||
|
||
import org.springframework.lang.NonNullApi; | ||
import org.springframework.lang.NonNullFields; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters