我正在使用番石榴18。
group: 'com.google.guava', name: 'guava', version: '18.0'
我正在使用loadingCache:
CacheBuilder.newBuilder()
.expireAfterWrite(EXPIRE_PRODUCT_AFTER_1_DAY, TimeUnit.DAYS)
.refreshAfterWrite(REFRESH_PRODUCT_AFTER_5_SECONDS, TimeUnit.SECONDS)
.build(new CacheLoader<String, OptionMap>() {
@Override
public OptionMap load(String productId) throws Exception {
return loadCache(productId);
}
}
);
编译时我得到了:
error: cannot find symbol
.refreshAfterWrite(REFRESH_PRODUCT_AFTER_5_SECONDS, TimeUnit.SECONDS)
^
symbol: method refreshAfterWrite(Integer,TimeUnit)
location: class CacheBuilder<Object,Object>
依赖洞察力 gradle -q dependencyInsight --configuration runtime --dependency guava
com.google.guava:guava:18.0
我正在使用intellij,并且在工作时没有显示任何错误