gpt4 book ai didi

java - JDK7泛型未编译

转载 作者:行者123 更新时间:2023-12-02 11:10:49 25 4
gpt4 key购买 nike

以下代码在jdk6中编译,但不在jdk7中编译。请提出任何解决方法

public interface LocalCacheMap<K extends Comparable<? super K>, V>  
extends ClearableCache<K>, Iterable<V>{
V get(K key);
}

public class Universe<K extends Comparable<? super K>, V, TSKEY extends Comparable<? super TSKEY>> extends MasterLocalCache<K>
implements Iterable<V>, LocalCacheMap<K, V>, TsDaoInfo<TSKEY, K>, ValueConverter<K, Object, V>{
public V get(K key) {
return get(key, keyFunct);
}
abstract public TSKEY buildTsKey(K key, Date date);

abstract public K getObjKey(TSKEY tsKey);

abstract public Date getDateKey(TSKEY tsKey);

}

public class JdbcTimesSeriesCacheDef<K extends Comparable<? super K>, TSKEY extends Comparable<? super TSKEY>, LC extends Universe<K,?,TSKEY>&DataSourceProvider, T> extends AbstractRawTimeSeriesCacheDef<K, T, LC> {
private final SqlDefs<T> defs;

}

使用jdk7进行编译时,出现以下错误

JdbcTimesSeriesCacheDef错误:Universe中的get(K#1)无法在LocalCacheMap中实现get(K#2)

最佳答案

更改

LC extends Universe<K,?,TSKEY>&DataSourceProvider,


LC extends Universe<K,T,TSKEY>&DataSourceProvider,

关于java - JDK7泛型未编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27804295/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com