blossom-project / blossom

Blossom is a Java framework based on Spring-Boot which enables you to realize your projects quickly and smoothly. It comes with several modules and tools made to ease and speed up your development process.
http://blossom-project.com
Apache License 2.0
21 stars 21 forks source link

Disabled caches throw an exception on null return value #216

Closed RLejolivet closed 5 years ago

RLejolivet commented 5 years ago

When com.blossomproject.core.common.dao.GenericReadOnlyDaoImpl#getOne returns "null" and its cache is disabled, the method fails with:

java.lang.ClassCastException: class org.springframework.cache.support.NullValue cannot be cast to class com.blossomproject.core.common.entity.AbstractEntity

At https://github.com/blossom-project/blossom/blob/master/blossom-core/blossom-core-cache/src/main/java/com/blossomproject/core/cache/BlossomCache.java#L43