EhCache 2.10 incompatible types
Answered
My project uses a cache registry with a typical StatisticsGateway stats = cache.getStatistics(); method. However compiling within IntelliJ results in an incompatible types error. It compiles fine from the command line and from Eclipse. The nearest I can figure, IntelliJ is thinking cache is an Ehcache interface rather than a Cache object? How do I get IntelliJ to recognize the proper method return?
import net.sf.ehcache.Cache;
import net.sf.ehcache.CacheManager;
import net.sf.ehcache.Ehcache;
import net.sf.ehcache.Element;
import net.sf.ehcache.statistics.StatisticsGateway;
public class CacheRegistry implements InitializingBean, DisposableBean {
private CacheManager cacheManager;
...
for(String cacheName : this.cacheManager.getCacheNames()) {
Cache cache = this.cacheManager.getCache(cacheName);
...

Please sign in to leave a comment.
Compilation error comes from the compiler (javac), not IntelliJ IDEA.
You probably use different compilers, JDK versions or language level versions, or there is some different dependency version used in IntelliJ IDEA project.