Fix broken build

This commit fixes the direct use of Java8 API

Issue: SPR-14853
This commit is contained in:
Stephane Nicoll
2016-10-27 10:30:54 +02:00
parent 4e3a6b9404
commit 2c2c6f8e02

View File

@@ -424,9 +424,9 @@ public abstract class CacheAspectSupport extends AbstractCacheInvoker
}
private Object wrapCacheValue(Method method, Object cacheValue) {
if (method.getReturnType() == Optional.class &&
(cacheValue == null || cacheValue.getClass() != Optional.class)) {
return Optional.ofNullable(cacheValue);
if (method.getReturnType() == javaUtilOptionalClass &&
(cacheValue == null || cacheValue.getClass() != javaUtilOptionalClass)) {
return OptionalUnwrapper.wrap(cacheValue);
}
return cacheValue;
}