< prev index next > src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeMaker.java
Print this page
JCWhileLoop tree = new JCWhileLoop(cond, body);
tree.pos = pos;
return tree;
}
+ public JCWithField WithField(JCExpression field, JCExpression value) {
+ JCWithField tree = new JCWithField(field, value);
+ tree.pos = pos;
+ return tree;
+ }
+
public JCForLoop ForLoop(List<JCStatement> init,
JCExpression cond,
List<JCExpressionStatement> step,
JCStatement body)
{
JCCase tree = new JCCase(caseKind, labels, guard, stats, body);
tree.pos = pos;
return tree;
}
+ public JCDefaultValue DefaultValue(JCExpression type) {
+ JCDefaultValue tree = new JCDefaultValue(type);
+ tree.pos = pos;
+ return tree;
+ }
+
public JCSwitchExpression SwitchExpression(JCExpression selector, List<JCCase> cases) {
JCSwitchExpression tree = new JCSwitchExpression(selector, cases);
tree.pos = pos;
return tree;
}
}
tp = TypeIntersection(la.toList());
break;
}
default: {
! Type outer = t.getEnclosingType();
! JCExpression clazz = outer.hasTag(CLASS) && t.tsym.owner.kind == TYP
! ? Select(Type(outer), t.tsym)
! : QualIdent(t.tsym);
! tp = t.getTypeArguments().isEmpty()
! ? clazz
! : TypeApply(clazz, Types(t.getTypeArguments()));
break;
}
}
break;
case ARRAY:
}
tp = TypeIntersection(la.toList());
break;
}
default: {
! if (t.isReferenceProjection()) {
! // For parameterized types, we want V.ref<A1 ... An> not V<A1 ... An>.ref
! JCExpression vp = Type(t.valueProjection());
! if (vp.hasTag(Tag.TYPEAPPLY)) {
! // vp now is V<A1 ... An>, build V.ref<A1 ... An>
! JCFieldAccess f = Select(((JCTypeApply) vp).clazz, t.tsym);
! f.name = names.ref;
+ tp = TypeApply(f, ((JCTypeApply) vp).arguments);
+ } else {
+ JCFieldAccess f = Select(vp, t.tsym);
+ f.name = names.ref;
+ tp = f;
+ }
+ } else {
+ Type outer = t.getEnclosingType();
+ JCExpression clazz = outer.hasTag(CLASS) && t.tsym.owner.kind == TYP
+ ? Select(Type(outer), t.tsym)
+ : QualIdent(t.tsym);
+ tp = t.getTypeArguments().isEmpty()
+ ? clazz
+ : TypeApply(clazz, Types(t.getTypeArguments()));
+ }
break;
}
}
break;
case ARRAY:
< prev index next >