本文整理了Java中com.sun.tools.javac.code.Types.merge()
方法的一些代码示例,展示了Types.merge()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Types.merge()
方法的具体详情如下:
包路径:com.sun.tools.javac.code.Types
类名称:Types
方法名:merge
暂无
代码示例来源:origin: org.jvnet.sorcerer/sorcerer-javac
/**
* Intersect two closures
*/
public List<Type> intersect(List<Type> cl1, List<Type> cl2) {
if (cl1 == cl2)
return cl1;
if (cl1.isEmpty() || cl2.isEmpty())
return List.nil();
if (cl1.head.tsym.precedes(cl2.head.tsym, this))
return intersect(cl1.tail, cl2);
if (cl2.head.tsym.precedes(cl1.head.tsym, this))
return intersect(cl1, cl2.tail);
if (isSameType(cl1.head, cl2.head))
return intersect(cl1.tail, cl2.tail).prepend(cl1.head);
if (cl1.head.tsym == cl2.head.tsym &&
cl1.head.tag == CLASS && cl2.head.tag == CLASS) {
if (cl1.head.isParameterized() && cl2.head.isParameterized()) {
Type merge = merge(cl1.head,cl2.head);
return intersect(cl1.tail, cl2.tail).prepend(merge);
}
if (cl1.head.isRaw() || cl2.head.isRaw())
return intersect(cl1.tail, cl2.tail).prepend(erasure(cl1.head));
}
return intersect(cl1.tail, cl2.tail);
}
// where
代码示例来源:origin: sc.fiji/javac
/**
* Intersect two closures
*/
public List<Type> intersect(List<Type> cl1, List<Type> cl2) {
if (cl1 == cl2)
return cl1;
if (cl1.isEmpty() || cl2.isEmpty())
return List.nil();
if (cl1.head.tsym.precedes(cl2.head.tsym, this))
return intersect(cl1.tail, cl2);
if (cl2.head.tsym.precedes(cl1.head.tsym, this))
return intersect(cl1, cl2.tail);
if (isSameType(cl1.head, cl2.head))
return intersect(cl1.tail, cl2.tail).prepend(cl1.head);
if (cl1.head.tsym == cl2.head.tsym &&
cl1.head.tag == CLASS && cl2.head.tag == CLASS) {
if (cl1.head.isParameterized() && cl2.head.isParameterized()) {
Type merge = merge(cl1.head,cl2.head);
return intersect(cl1.tail, cl2.tail).prepend(merge);
}
if (cl1.head.isRaw() || cl2.head.isRaw())
return intersect(cl1.tail, cl2.tail).prepend(erasure(cl1.head));
}
return intersect(cl1.tail, cl2.tail);
}
// where
代码示例来源:origin: org.kohsuke.sorcerer/sorcerer-javac
/**
* Intersect two closures
*/
public List<Type> intersect(List<Type> cl1, List<Type> cl2) {
if (cl1 == cl2)
return cl1;
if (cl1.isEmpty() || cl2.isEmpty())
return List.nil();
if (cl1.head.tsym.precedes(cl2.head.tsym, this))
return intersect(cl1.tail, cl2);
if (cl2.head.tsym.precedes(cl1.head.tsym, this))
return intersect(cl1, cl2.tail);
if (isSameType(cl1.head, cl2.head))
return intersect(cl1.tail, cl2.tail).prepend(cl1.head);
if (cl1.head.tsym == cl2.head.tsym &&
cl1.head.hasTag(CLASS) && cl2.head.hasTag(CLASS)) {
if (cl1.head.isParameterized() && cl2.head.isParameterized()) {
Type merge = merge(cl1.head,cl2.head);
return intersect(cl1.tail, cl2.tail).prepend(merge);
}
if (cl1.head.isRaw() || cl2.head.isRaw())
return intersect(cl1.tail, cl2.tail).prepend(erasure(cl1.head));
}
return intersect(cl1.tail, cl2.tail);
}
// where
代码示例来源:origin: konsoletyper/teavm-javac
/**
* Intersect two closures
*/
public List<Type> intersect(List<Type> cl1, List<Type> cl2) {
if (cl1 == cl2)
return cl1;
if (cl1.isEmpty() || cl2.isEmpty())
return List.nil();
if (cl1.head.tsym.precedes(cl2.head.tsym, this))
return intersect(cl1.tail, cl2);
if (cl2.head.tsym.precedes(cl1.head.tsym, this))
return intersect(cl1, cl2.tail);
if (isSameType(cl1.head, cl2.head))
return intersect(cl1.tail, cl2.tail).prepend(cl1.head);
if (cl1.head.tsym == cl2.head.tsym &&
cl1.head.hasTag(CLASS) && cl2.head.hasTag(CLASS)) {
if (cl1.head.isParameterized() && cl2.head.isParameterized()) {
Type merge = merge(cl1.head,cl2.head);
return intersect(cl1.tail, cl2.tail).prepend(merge);
}
if (cl1.head.isRaw() || cl2.head.isRaw())
return intersect(cl1.tail, cl2.tail).prepend(erasure(cl1.head));
}
return intersect(cl1.tail, cl2.tail);
}
// where
内容来源于网络,如有侵权,请联系作者删除!