@Override public JCWildcard inline(Inliner inliner) throws CouldNotResolveImportException { return inliner .maker() .Wildcard( inliner.maker().TypeBoundKind(BOUND_KINDS.get(getKind())), (getBound() == null) ? null : getBound().inline(inliner)); }
public WildcardTree Wildcard(Kind kind, Tree type) { final BoundKind boundKind; switch (kind) { case UNBOUNDED_WILDCARD: boundKind = BoundKind.UNBOUND; break; case EXTENDS_WILDCARD: boundKind = BoundKind.EXTENDS; break; case SUPER_WILDCARD: boundKind = BoundKind.SUPER; break; default: throw new IllegalArgumentException("Unknown wildcard bound " + kind); } TypeBoundKind tbk = make.at(NOPOS).TypeBoundKind(boundKind); return make.at(NOPOS).Wildcard(tbk, (JCExpression)type); }
public JCTree visitWildcard(WildcardTree node, P p) { JCWildcard t = (JCWildcard) node; TypeBoundKind kind = M.at(t.kind.pos).TypeBoundKind(t.kind.kind); JCTree inner = copy(t.inner, p); return M.at(t.pos).Wildcard(kind, inner); }
public JCTree visitWildcard(WildcardTree node, P p) { JCWildcard t = (JCWildcard) node; TypeBoundKind kind = M.at(t.kind.pos).TypeBoundKind(t.kind.kind); JCTree inner = copy(t.inner, p); return M.at(t.pos).Wildcard(kind, inner); }
private JCExpression addWildcards(Node node, JCExpression type, WildcardKind wildcardKind) { TypeBoundKind typeBoundKind; switch (wildcardKind) { case NONE: return type; case EXTENDS: typeBoundKind = treeMaker.TypeBoundKind(BoundKind.EXTENDS); Position jcExtendsPos = getConversionPositionInfo(node, "extends"); if (jcExtendsPos == null) { setPos(posOfStructure(node, "extends", true), posOfStructure(node, "extends", false), typeBoundKind); } else { setPos(jcExtendsPos.getStart(), jcExtendsPos.getEnd(), typeBoundKind); } return setPos(type.pos, endPosTable.get(type), treeMaker.Wildcard(typeBoundKind, type)); case SUPER: typeBoundKind = treeMaker.TypeBoundKind(BoundKind.SUPER); Position jcSuperPos = getConversionPositionInfo(node, "super"); if (jcSuperPos == null) { setPos(posOfStructure(node, "super", true), posOfStructure(node, "super", false), typeBoundKind); } else { setPos(jcSuperPos.getStart(), jcSuperPos.getEnd(), typeBoundKind); } return setPos(type.pos, endPosTable.get(type), treeMaker.Wildcard(typeBoundKind, type)); default: throw new IllegalStateException("Unexpected unbound wildcard: " + wildcardKind); } }
public JCTree visitWildcard(WildcardTree node, P p) { JCWildcard t = (JCWildcard) node; TypeBoundKind kind = M.at(t.kind.pos).TypeBoundKind(t.kind.kind); JCTree inner = copy(t.inner, p); return M.at(t.pos).Wildcard(kind, inner); }
public JCTree visitWildcard(WildcardTree node, P p) { JCWildcard t = (JCWildcard) node; TypeBoundKind kind = M.at(t.kind.pos).TypeBoundKind(t.kind.kind); JCTree inner = copy(t.inner, p); return M.at(t.pos).Wildcard(kind, inner); }
private JCExpression addWildcards(Node node, JCExpression type, WildcardKind wildcardKind) { TypeBoundKind typeBoundKind; switch (wildcardKind) { case NONE: return type; case EXTENDS: typeBoundKind = treeMaker.TypeBoundKind(BoundKind.EXTENDS); Position jcExtendsPos = getConversionPositionInfo(node, "extends"); if (jcExtendsPos == null) { setPos(posOfStructure(node, "extends", true), posOfStructure(node, "extends", false), typeBoundKind); } else { setPos(jcExtendsPos.getStart(), jcExtendsPos.getEnd(), typeBoundKind); } return setPos(type.pos, endPosTable.get(type), treeMaker.Wildcard(typeBoundKind, type)); case SUPER: typeBoundKind = treeMaker.TypeBoundKind(BoundKind.SUPER); Position jcSuperPos = getConversionPositionInfo(node, "super"); if (jcSuperPos == null) { setPos(posOfStructure(node, "super", true), posOfStructure(node, "super", false), typeBoundKind); } else { setPos(jcSuperPos.getStart(), jcSuperPos.getEnd(), typeBoundKind); } return setPos(type.pos, endPosTable.get(type), treeMaker.Wildcard(typeBoundKind, type)); default: throw new IllegalStateException("Unexpected unbound wildcard: " + wildcardKind); } }
private JCExpression addWildcards(Node node, JCExpression type, WildcardKind wildcardKind) { TypeBoundKind typeBoundKind; switch (wildcardKind) { case NONE: return type; case EXTENDS: typeBoundKind = treeMaker.TypeBoundKind(BoundKind.EXTENDS); Position jcExtendsPos = getConversionPositionInfo(node, "extends"); if (jcExtendsPos == null) { setPos(posOfStructure(node, "extends", true), posOfStructure(node, "extends", false), typeBoundKind); } else { setPos(jcExtendsPos.getStart(), jcExtendsPos.getEnd(), typeBoundKind); } return setPos(type.pos, endPosTable.get(type), treeMaker.Wildcard(typeBoundKind, type)); case SUPER: typeBoundKind = treeMaker.TypeBoundKind(BoundKind.SUPER); Position jcSuperPos = getConversionPositionInfo(node, "super"); if (jcSuperPos == null) { setPos(posOfStructure(node, "super", true), posOfStructure(node, "super", false), typeBoundKind); } else { setPos(jcSuperPos.getStart(), jcSuperPos.getEnd(), typeBoundKind); } return setPos(type.pos, endPosTable.get(type), treeMaker.Wildcard(typeBoundKind, type)); default: throw new IllegalStateException("Unexpected unbound wildcard: " + wildcardKind); } }
@Override public JCWildcard inline(Inliner inliner) throws CouldNotResolveImportException { return inliner .maker() .Wildcard( inliner.maker().TypeBoundKind(BOUND_KINDS.get(getKind())), (getBound() == null) ? null : getBound().inline(inliner)); }
@Override public boolean visitTypeReference(TypeReference node) { WildcardKind wildcard = node.astWildcard(); if (wildcard == WildcardKind.UNBOUND) { return posSet(node, treeMaker.Wildcard(treeMaker.TypeBoundKind(BoundKind.UNBOUND), null)); } JCExpression result = plainTypeReference(node); result = addWildcards(node, result, wildcard); result = addDimensions(node, result, node.astArrayDimensions()); return set(node, result); }
@Override public boolean visitTypeReference(TypeReference node) { WildcardKind wildcard = node.astWildcard(); if (wildcard == WildcardKind.UNBOUND) { return posSet(node, treeMaker.Wildcard(treeMaker.TypeBoundKind(BoundKind.UNBOUND), null)); } JCExpression result = plainTypeReference(node); result = addWildcards(node, result, wildcard); result = addDimensions(node, result, node.astArrayDimensions()); return set(node, result); }
@Override public boolean visitTypeReference(TypeReference node) { WildcardKind wildcard = node.astWildcard(); if (wildcard == WildcardKind.UNBOUND) { return posSet(node, treeMaker.Wildcard(treeMaker.TypeBoundKind(BoundKind.UNBOUND), null)); } JCExpression result = plainTypeReference(node); result = addWildcards(node, result, wildcard); result = addDimensions(node, result, node.astArrayDimensions()); return set(node, result); }
nextToken(); JCExpression bound = parseType(); result = F.at(pos).Wildcard(t, bound); } else if (token.kind == SUPER) { TypeBoundKind t = to(F.at(pos).TypeBoundKind(BoundKind.SUPER)); nextToken(); JCExpression bound = parseType(); result = F.at(pos).Wildcard(t, bound); } else if (LAX_IDENTIFIER.accepts(token.kind)) { JCExpression wc = toP(F.at(pos).Wildcard(t, null)); JCIdent id = toP(F.at(token.pos).Ident(ident())); JCErroneous err = F.at(pos).Erroneous(List.<JCTree>of(wc, id)); } else { TypeBoundKind t = toP(F.at(pos).TypeBoundKind(BoundKind.UNBOUND)); result = toP(F.at(pos).Wildcard(t, null));
TypeBoundKind t = to(F.at(S.pos()).TypeBoundKind(BoundKind.EXTENDS)); S.nextToken(); return F.at(pos).Wildcard(t, type()); } else if (S.token() == SUPER) { TypeBoundKind t = to(F.at(S.pos()).TypeBoundKind(BoundKind.SUPER)); S.nextToken(); return F.at(pos).Wildcard(t, type()); } else if (S.token() == IDENTIFIER) { keywords.token2string(SUPER)); TypeBoundKind t = F.at(Position.NOPOS).TypeBoundKind(BoundKind.UNBOUND); JCExpression wc = toP(F.at(pos).Wildcard(t, null)); JCIdent id = toP(F.at(S.pos()).Ident(ident())); return F.at(pos).Erroneous(List.<JCTree>of(wc, id)); } else { TypeBoundKind t = F.at(Position.NOPOS).TypeBoundKind(BoundKind.UNBOUND); return toP(F.at(pos).Wildcard(t, null));
nextToken(); JCExpression bound = parseType(); result = F.at(pos).Wildcard(t, bound); } else if (token.kind == SUPER) { TypeBoundKind t = to(F.at(pos).TypeBoundKind(BoundKind.SUPER)); nextToken(); JCExpression bound = parseType(); result = F.at(pos).Wildcard(t, bound); } else if (LAX_IDENTIFIER.accepts(token.kind)) { JCExpression wc = toP(F.at(pos).Wildcard(t, null)); JCIdent id = toP(F.at(token.pos).Ident(ident())); JCErroneous err = F.at(pos).Erroneous(List.<JCTree>of(wc, id)); } else { TypeBoundKind t = toP(F.at(pos).TypeBoundKind(BoundKind.UNBOUND)); result = toP(F.at(pos).Wildcard(t, null));
TypeBoundKind t = to(F.at(S.pos()).TypeBoundKind(BoundKind.EXTENDS)); S.nextToken(); return F.at(pos).Wildcard(t, type()); } else if (S.token() == SUPER) { TypeBoundKind t = to(F.at(S.pos()).TypeBoundKind(BoundKind.SUPER)); S.nextToken(); return F.at(pos).Wildcard(t, type()); } else if (S.token() == IDENTIFIER) { keywords.token2string(SUPER)); TypeBoundKind t = F.at(Position.NOPOS).TypeBoundKind(BoundKind.UNBOUND); JCExpression wc = toP(F.at(pos).Wildcard(t, null)); JCIdent id = toP(F.at(S.pos()).Ident(ident())); return F.at(pos).Erroneous(List.<JCTree>of(wc, id)); } else { TypeBoundKind t = F.at(Position.NOPOS).TypeBoundKind(BoundKind.UNBOUND); return toP(F.at(pos).Wildcard(t, null));
case WILDCARD: { WildcardType a = ((WildcardType) type); tp = make.at(NOPOS).Wildcard(make.at(NOPOS).TypeBoundKind(a.kind), (JCExpression) Type(a.type)); break;
case WILDCARD: { WildcardType a = ((WildcardType) t); tp = Wildcard(TypeBoundKind(a.kind), Type(a.type)); break;
case WILDCARD: { WildcardType a = ((WildcardType) t); tp = Wildcard(TypeBoundKind(a.kind), Type(a.type)); break;