Commit fcae5a7d authored by Eddú Meléndez's avatar Eddú Meléndez Committed by Stephane Nicoll

Add missing type check on EhCacheCacheConfiguration

Previously, EhCacheCacheConfiguration could be triggered even if the
ehcache library is not present. This commit adds the missing
`ConditionalOnType` that now guards the configuration properly.

See gh-2633
parent 22b1ffd9
......@@ -16,6 +16,8 @@
package org.springframework.boot.autoconfigure.cache;
import net.sf.ehcache.Cache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
......@@ -35,7 +37,7 @@ import org.springframework.core.io.Resource;
* @since 1.3.0
*/
@Configuration
@ConditionalOnClass(EhCacheCacheManager.class)
@ConditionalOnClass({Cache.class, EhCacheCacheManager.class})
@ConditionalOnMissingBean(CacheManager.class)
@Conditional({ CacheCondition.class,
EhCacheCacheConfiguration.ConfigAvailableCondition.class })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment