File tree Expand file tree Collapse file tree 5 files changed +19
-14
lines changed
spring-context-support/src/main/java/org/springframework/cache/jcache
spring-context/src/main/java/org/springframework/cache/annotation
spring-core/src/main/java/org/springframework/util/function Expand file tree Collapse file tree 5 files changed +19
-14
lines changed Original file line number Diff line number Diff line change 41
41
@ Configuration (proxyBeanMethods = false )
42
42
public abstract class AbstractJCacheConfiguration extends AbstractCachingConfiguration {
43
43
44
- protected @ Nullable Supplier <@ Nullable CacheResolver > exceptionCacheResolver ;
44
+ @ SuppressWarnings ("NullAway.Init" )
45
+ protected Supplier <@ Nullable CacheResolver > exceptionCacheResolver ;
45
46
46
47
47
48
@ Override
48
- @ SuppressWarnings ("NullAway" ) // https://github.com/uber/NullAway/issues/1128
49
+ @ SuppressWarnings ("NullAway" ) // See https://github.com/uber/NullAway/issues/1290
49
50
protected void useCachingConfigurer (CachingConfigurerSupplier cachingConfigurerSupplier ) {
50
51
super .useCachingConfigurer (cachingConfigurerSupplier );
51
52
this .exceptionCacheResolver = cachingConfigurerSupplier .adapt (config -> {
Original file line number Diff line number Diff line change 50
50
public class DefaultJCacheOperationSource extends AnnotationJCacheOperationSource
51
51
implements BeanFactoryAware , SmartInitializingSingleton {
52
52
53
- private @ Nullable SingletonSupplier <CacheManager > cacheManager ;
53
+ private @ Nullable SingletonSupplier <@ Nullable CacheManager > cacheManager ;
54
54
55
- private @ Nullable SingletonSupplier <CacheResolver > cacheResolver ;
55
+ private @ Nullable SingletonSupplier <@ Nullable CacheResolver > cacheResolver ;
56
56
57
- private @ Nullable SingletonSupplier <CacheResolver > exceptionCacheResolver ;
57
+ private @ Nullable SingletonSupplier <@ Nullable CacheResolver > exceptionCacheResolver ;
58
58
59
59
private SingletonSupplier <KeyGenerator > keyGenerator ;
60
60
Original file line number Diff line number Diff line change @@ -50,13 +50,17 @@ public abstract class AbstractCachingConfiguration implements ImportAware {
50
50
51
51
protected @ Nullable AnnotationAttributes enableCaching ;
52
52
53
- protected @ Nullable Supplier <@ Nullable CacheManager > cacheManager ;
53
+ @ SuppressWarnings ("NullAway.Init" )
54
+ protected Supplier <@ Nullable CacheManager > cacheManager ;
54
55
55
- protected @ Nullable Supplier <@ Nullable CacheResolver > cacheResolver ;
56
+ @ SuppressWarnings ("NullAway.Init" )
57
+ protected Supplier <@ Nullable CacheResolver > cacheResolver ;
56
58
57
- protected @ Nullable Supplier <@ Nullable KeyGenerator > keyGenerator ;
59
+ @ SuppressWarnings ("NullAway.Init" )
60
+ protected Supplier <@ Nullable KeyGenerator > keyGenerator ;
58
61
59
- protected @ Nullable Supplier <@ Nullable CacheErrorHandler > errorHandler ;
62
+ @ SuppressWarnings ("NullAway.Init" )
63
+ protected Supplier <@ Nullable CacheErrorHandler > errorHandler ;
60
64
61
65
62
66
@ Override
@@ -101,7 +105,7 @@ protected void useCachingConfigurer(CachingConfigurerSupplier cachingConfigurerS
101
105
102
106
protected static class CachingConfigurerSupplier {
103
107
104
- private final SingletonSupplier <CachingConfigurer > supplier ;
108
+ private final SingletonSupplier <@ Nullable CachingConfigurer > supplier ;
105
109
106
110
public CachingConfigurerSupplier (Supplier <@ Nullable CachingConfigurer > supplier ) {
107
111
this .supplier = SingletonSupplier .ofNullable (supplier );
Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ public static <T> SingletonSupplier<T> of(T instance) {
143
143
* @return the singleton supplier, or {@code null} if the instance was {@code null}
144
144
*/
145
145
@ Contract ("null -> null; !null -> !null" )
146
- public static <T > @ Nullable SingletonSupplier <T > ofNullable (@ Nullable T instance ) {
146
+ public static <T extends @ Nullable Object > @ Nullable SingletonSupplier <T > ofNullable (T instance ) {
147
147
return (instance != null ? new SingletonSupplier <>(instance ) : null );
148
148
}
149
149
@@ -152,7 +152,7 @@ public static <T> SingletonSupplier<T> of(T instance) {
152
152
* @param supplier the instance supplier (never {@code null})
153
153
* @return the singleton supplier (never {@code null})
154
154
*/
155
- public static <T > SingletonSupplier <T > of (Supplier <T > supplier ) {
155
+ public static <T extends @ Nullable Object > SingletonSupplier <T > of (Supplier <T > supplier ) {
156
156
return new SingletonSupplier <>(supplier );
157
157
}
158
158
@@ -162,7 +162,7 @@ public static <T> SingletonSupplier<T> of(Supplier<T> supplier) {
162
162
* @return the singleton supplier, or {@code null} if the instance supplier was {@code null}
163
163
*/
164
164
@ Contract ("null -> null; !null -> !null" )
165
- public static <T > @ Nullable SingletonSupplier <T > ofNullable (@ Nullable Supplier <@ Nullable T > supplier ) {
165
+ public static <T extends @ Nullable Object > @ Nullable SingletonSupplier <T > ofNullable (@ Nullable Supplier <T > supplier ) {
166
166
return (supplier != null ? new SingletonSupplier <>(supplier ) : null );
167
167
}
168
168
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ public abstract class SupplierUtils {
38
38
* @return the supplier's result, or {@code null} if none
39
39
*/
40
40
@ Contract ("null -> null" )
41
- public static <T > @ Nullable T resolve (@ Nullable Supplier <T > supplier ) {
41
+ public static <T extends @ Nullable Object > @ Nullable T resolve (@ Nullable Supplier <T > supplier ) {
42
42
return (supplier != null ? supplier .get () : null );
43
43
}
44
44
You can’t perform that action at this time.
0 commit comments