java参数不知道类型_java–类型参数不在其范围内我在这个类上运⾏maven编译时遇到错误但是在执⾏时似乎⼯作得很好.我在同⼀主题上看了很多其他帖⼦,但却⽆法为⾃⼰⼯作.
助学活动编辑 – 删除原始代码⽚段并替换
编辑 – 提供MCVE – ⾮常简单
顺便说⼀下,这是在Java 6上运⾏的百思不得其姐
public class MainTester {
@SuppressWarnings("rawtypes")
public static void main(String[] args) {
桥的英文
ProtocolHandler mappingProtocolHandler = new MappingProtocolHandler();
Map> protocols = Protocols();
System.out.println(protocols);
}
}
ProtocolHandler和Child类:
public abstract class ProtocolHandler> {
public Map> getProtocols() {
return getProtocolsForRequest();
}婚假有工资吗
protected abstract Map> getProtocolsForRequest();
}
@SuppressWarnings("rawtypes")
public class MappingProtocolHandler extends ProtocolHandler{
@Override
protected Map> getProtocolsForRequest() {
return new HashMap>();
}
}
家电行业报告规则类:
public interface Rule {
public void execute(F object, T object2);查拳
}
public abstract class BaRule implements Rule, Comparable> {
}
public abstract class MappingRule extends BaRule implements CustomAttributes{
油箱漏油>正阳步行街}
public abstract class InputRule extends MappingRule> {
}
public abstract class OutputRule extends MappingRule, Object> {
}
public interface CustomAttributes {
}
处理程序类:
public abstract class ProtocolHandler> {
public Map> getProtocols() {
return getProtocolsForRequest();
}
protected abstract Map> getProtocolsForRequest();
}
@SuppressWarnings("rawtypes")
public class MappingProtocolHandler extends ProtocolHandler{
@Override
protected Map> getProtocolsForRequest() {
return new HashMap>();
}
}
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile
(default-compile) on project Test: Compilation failure: Compilation
failure:
[ERROR]…\src\main\java\common\main\MainTester.java:[14,18]
type parameter common.mapping.rule.MappingRule is not within its bound [ERROR]…\src\main\java\common\handler\MappingProtocolHandler.java:[10,60] type parameter common.mapping.rule.MappingRule is not within its bound