From 59c26f65ba5bd5a20438d52f7dc44b498e89b4e9 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Wed, 5 Jul 2017 17:55:11 +0200 Subject: [PATCH] AbstractValueAdaptingCache subclasses may reuse NullValue.INSTANCE Issue: SPR-15693 --- .../org/springframework/cache/support/NullValue.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/cache/support/NullValue.java b/spring-context/src/main/java/org/springframework/cache/support/NullValue.java index 7b3f4678064..3e8337991e1 100644 --- a/spring-context/src/main/java/org/springframework/cache/support/NullValue.java +++ b/spring-context/src/main/java/org/springframework/cache/support/NullValue.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,13 @@ import java.io.Serializable; */ public final class NullValue implements Serializable { - static final Object INSTANCE = new NullValue(); + /** + * The canonical representation of a {@code null} replacement, as used by the + * default implementation of {@link AbstractValueAdaptingCache#toStoreValue}/ + * {@link AbstractValueAdaptingCache#fromStoreValue}. + * @since 4.3.10 + */ + public static final Object INSTANCE = new NullValue(); private static final long serialVersionUID = 1L;