mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-10-07 15:39:29 +00:00
Remove unnecessary @Nullable annotations
* `DefaultPersistenceUnitManager.java` `dataSourceLookup` is initialized with a non-null `DataSourceLookup`, so `getDataSourceLookup()` does not return `null`. * `TestContextTransactionUtils.java` The transaction attribute name is stored as a non-null value, so `getName()` does not return `null`. * `RequestContext.java` The model is represented by a `Map` rather than a nullable value, so `getModel()` can return a non-null `Map`. Closes gh-37379 Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
This commit is contained in:
+1
-1
@@ -344,7 +344,7 @@ public class DefaultPersistenceUnitManager
|
||||
* persistence provider, resolving data source names in {@code persistence.xml}
|
||||
* against Spring-managed DataSource instances.
|
||||
*/
|
||||
public @Nullable DataSourceLookup getDataSourceLookup() {
|
||||
public DataSourceLookup getDataSourceLookup() {
|
||||
return this.dataSourceLookup;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -275,7 +275,7 @@ public abstract class TestContextTransactionUtils {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable String getName() {
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -112,9 +112,9 @@ public class RequestContext {
|
||||
|
||||
/**
|
||||
* Return the model Map that this RequestContext encapsulates, if any.
|
||||
* @return the populated model Map, or {@code null} if none available
|
||||
* @return the populated model Map
|
||||
*/
|
||||
public @Nullable Map<String, Object> getModel() {
|
||||
public Map<String, Object> getModel() {
|
||||
return this.model;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user