java参数不知道类型_java–类型参数不在其范围内我在这个类上运⾏maven编译时遇到错误但是在执⾏时似乎⼯作得很好.我在同⼀主题上看了很多其他帖⼦,但却⽆法为⾃⼰⼯作.
编辑 – 删除原始代码⽚段并替换
臃肿的反义词编辑 – 提供MCVE – ⾮常简单
顺便说⼀下,这是在Java 6上运⾏的
public class MainTester {
@SuppressWarnings("rawtypes")
nagapublic 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 {formulated
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 {
高中英语必修1
}
处理程序类:
public abstract class ProtocolHandler> {
public Map> getProtocols() {
return getProtocolsForRequest();
记忆法
}
protected abstract Map> getProtocolsForRequest();
懦夫是什么意思}
@SuppressWarnings("rawtypes")
繁杂
public class MappingProtocolHandler extends ProtocolHandler{
@Override
flawprotected Map> getProtocolsForRequest() {
return new HashMap>();
}
}
[ERROR] Failed to execute goalvictory是什么意思
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