public A peek() { return first(); } }
public A peek() { return first(); }
public A peek() { return first(); }
private <T extends Attribute.Compound> T replaceOne(Placeholder<T> placeholder, Annotate.AnnotateRepeatedContext<T> ctx) { Log log = ctx.log; // Process repeated annotations T validRepeated = ctx.processRepeatedAnnotations(placeholder.getPlaceholderFor(), sym); if (validRepeated != null) { // Check that the container isn't manually // present along with repeated instances of // its contained annotation. ListBuffer<T> manualContainer = ctx.annotated.get(validRepeated.type.tsym); if (manualContainer != null) { log.error(ctx.pos.get(manualContainer.first()), "invalid.repeatable.annotation.repeated.and.container.present", manualContainer.first().type.tsym); } } // A null return will delete the Placeholder return validRepeated; }
private <T extends Attribute.Compound> T replaceOne(Placeholder<T> placeholder, Annotate.AnnotateRepeatedContext<T> ctx) { Log log = ctx.log; // Process repeated annotations T validRepeated = ctx.processRepeatedAnnotations(placeholder.getPlaceholderFor(), sym); if (validRepeated != null) { // Check that the container isn't manually // present along with repeated instances of // its contained annotation. ListBuffer<T> manualContainer = ctx.annotated.get(validRepeated.type.tsym); if (manualContainer != null) { log.error(ctx.pos.get(manualContainer.first()), "invalid.repeatable.annotation.repeated.and.container.present", manualContainer.first().type.tsym); } } // A null return will delete the Placeholder return validRepeated; }
boolean merge(ListBuffer<JCLiteral> litBuf, ListBuffer<JCExpression> opStack) { if (litBuf.isEmpty()) { return false; } else if (litBuf.size() == 1) { opStack.prepend(litBuf.first()); return false; } else { StringBuilder sb = new StringBuilder(); for (JCLiteral lit : litBuf) { sb.append(lit.getValue()); } JCExpression t = F.at(litBuf.first().getStartPosition()).Literal(TypeTag.CLASS, sb.toString()); storeEnd(t, litBuf.last().getEndPosition(endPosTable)); opStack.prepend(t); return true; } }
deps2.put(dk, depsByKind); if (data.contains(d.data.first())) { depsByKind.add(this); } else {
deps2.put(dk, depsByKind); if (data.contains(d.data.first())) { depsByKind.add(this); } else {
for (ListBuffer<T> lb : annotated.values()) { if (lb.size() == 1) { buf = buf.prepend(lb.first()); } else { // repeated
for (ListBuffer<T> lb : annotated.values()) { if (lb.size() == 1) { buf = buf.prepend(lb.first()); } else { // repeated
Type mtype = memberType(origin.type, sym); if (abstracts.isEmpty() || (sym.name == abstracts.first().name && overrideEquivalent(mtype, memberType(origin.type, abstracts.first())))) { abstracts.append(sym); } else { diags.fragment("no.abstracts", Kinds.kindName(origin), origin)); } else if (abstracts.size() == 1) { return new FunctionDescriptor(abstracts.first()); } else { // size > 1 FunctionDescriptor descRes = mergeDescriptors(origin, abstracts.toList());
/** * Lambda body to use for a 'new'. */ private JCExpression expressionNew() { if (tree.kind == ReferenceKind.ARRAY_CTOR) { //create the array creation expression JCNewArray newArr = make.NewArray( make.Type(types.elemtype(tree.getQualifierExpression().type)), List.of(make.Ident(params.first())), null); newArr.type = tree.getQualifierExpression().type; return newArr; } else { //create the instance creation expression //note that method reference syntax does not allow an explicit //enclosing class (so the enclosing class is null) JCNewClass newClass = make.NewClass(null, List.<JCExpression>nil(), make.Type(tree.getQualifierExpression().type), convertArgs(tree.sym, args.toList(), tree.varargsElement), null); newClass.constructor = tree.sym; newClass.constructorType = tree.sym.erasure(types); newClass.type = tree.getQualifierExpression().type; setVarargsIfNeeded(newClass, tree.varargsElement); return newClass; } }
Type mtype = memberType(origin.type, sym); if (abstracts.isEmpty() || (sym.name == abstracts.first().name && overrideEquivalent(mtype, memberType(origin.type, abstracts.first())))) { abstracts.append(sym); } else { diags.fragment("no.abstracts", Kinds.kindName(origin), origin)); } else if (abstracts.size() == 1) { return new FunctionDescriptor(abstracts.first()); } else { // size > 1 FunctionDescriptor descRes = mergeDescriptors(origin, abstracts.toList());