ImmutableSet<InferenceVariable> rcvrReferences = findUnannotatedTypeVarRefs(tvs, rcvrtype, fieldAccess.selected); Type restype = fieldAccess.sym.type.asMethodType().restype; findUnannotatedTypeVarRefs(tvs, restype, node) .forEach(
if (methodType == null) { collector.add(methodSymbol); } else if (overrides ? isInvocable(types, methodSymbol.type.asMethodType(), methodType) : isInvocable(types, methodType, methodSymbol.type.asMethodType())) { collector.add(methodSymbol);
public MethodType asMethodType() { return qtype.asMethodType(); }
public MethodType asMethodType() { return qtype.asMethodType(); }
@Override public MethodType asMethodType() { return underlyingType.asMethodType(); }
@Override public MethodType asMethodType() { return underlyingType.asMethodType(); }
/** * Get the receiver type of this executable element. * * @return the receiver type of this executable element. * @since 1.8 */ public com.sun.javadoc.Type receiverType() { Type recvtype = sym.type.asMethodType().recvtype; return (recvtype != null) ? TypeMaker.getType(env, recvtype, false, true) : null; }
public boolean alreadyDefinedIn(CharSequence name, ExecutableType method, TypeElement enclClass) { Type.MethodType meth = ((Type)method).asMethodType(); ClassSymbol clazz = (ClassSymbol)enclClass; Scope scope = clazz.members(); Name n = names.fromString(name.toString()); for (Symbol sym : scope.getSymbolsByName(n, Scope.LookupKind.NON_RECURSIVE)) { if(sym.type instanceof ExecutableType && types.isSubsignature(meth, (ExecutableType)sym.type)) return true; } return false; }
public boolean alreadyDefinedIn(CharSequence name, TypeMirror returnType, List<TypeMirror> paramTypes, TypeElement enclClass) { ClassSymbol clazz = (ClassSymbol)enclClass; Scope scope = clazz.members(); Name n = names.fromString(name.toString()); ListBuffer<Type> buff = new ListBuffer<>(); for (TypeMirror tm : paramTypes) { buff.append((Type)tm); } for (Symbol sym : scope.getSymbolsByName(n, Scope.LookupKind.NON_RECURSIVE)) { if(sym.type instanceof ExecutableType && jctypes.containsTypeEquivalent(sym.type.asMethodType().getParameterTypes(), buff.toList()) && jctypes.isSameType(sym.type.asMethodType().getReturnType(), (Type)returnType)) return true; } return false; }
private MethodSymbol findMethod(NameAndType nt, Scope scope, long flags) { if (nt == null) return null; MethodType type = nt.type.asMethodType(); for (Scope.Entry e = scope.lookup(nt.name); e.scope != null; e = e.next()) if (e.sym.kind == MTH && isSameBinaryType(e.sym.type.asMethodType(), type)) return (MethodSymbol)e.sym; if (nt.name != names.init) // not a constructor return null; if ((flags & INTERFACE) != 0) // no enclosing instance return null; if (nt.type.getParameterTypes().isEmpty()) // no parameters return null; // A constructor of an inner class. // Remove the first argument (the enclosing instance) nt.type = new MethodType(nt.type.getParameterTypes().tail, nt.type.getReturnType(), nt.type.getThrownTypes(), syms.methodClass); // Try searching again return findMethod(nt, scope, flags); }
private MethodSymbol findMethod(NameAndType nt, Scope scope, long flags) { if (nt == null) return null; MethodType type = nt.type.asMethodType(); for (Scope.Entry e = scope.lookup(nt.name); e.scope != null; e = e.next()) if (e.sym.kind == MTH && isSameBinaryType(e.sym.type.asMethodType(), type)) return (MethodSymbol)e.sym; if (nt.name != names.init) // not a constructor return null; if ((flags & INTERFACE) != 0) // no enclosing instance return null; if (nt.type.getParameterTypes().isEmpty()) // no parameters return null; // A constructor of an inner class. // Remove the first argument (the enclosing instance) nt.type = new MethodType(nt.type.getParameterTypes().tail, nt.type.getReturnType(), nt.type.getThrownTypes(), syms.methodClass); // Try searching again return findMethod(nt, scope, flags); }
private MethodSymbol findMethod(NameAndType nt, Scope scope, long flags) { if (nt == null) return null; MethodType type = nt.uniqueType.type.asMethodType(); for (Scope.Entry e = scope.lookup(nt.name); e.scope != null; e = e.next()) if (e.sym.kind == MTH && isSameBinaryType(e.sym.type.asMethodType(), type)) return (MethodSymbol)e.sym; if (nt.name != names.init) // not a constructor return null; if ((flags & INTERFACE) != 0) // no enclosing instance return null; if (nt.uniqueType.type.getParameterTypes().isEmpty()) // no parameters return null; // A constructor of an inner class. // Remove the first argument (the enclosing instance) nt.setType(new MethodType(nt.uniqueType.type.getParameterTypes().tail, nt.uniqueType.type.getReturnType(), nt.uniqueType.type.getThrownTypes(), syms.methodClass)); // Try searching again return findMethod(nt, scope, flags); }
protected void read(Symbol sym, int attrLen) { int nexceptions = nextChar(); List<Type> thrown = List.nil(); for (int j = 0; j < nexceptions; j++) thrown = thrown.prepend(readClassSymbol(nextChar()).type); if (sym.type.getThrownTypes().isEmpty()) sym.type.asMethodType().thrown = thrown.reverse(); } },
private MethodSymbol findMethod(NameAndType nt, Scope scope, long flags) { if (nt == null) return null; MethodType type = nt.uniqueType.type.asMethodType(); for (Scope.Entry e = scope.lookup(nt.name); e.scope != null; e = e.next()) if (e.sym.kind == MTH && isSameBinaryType(e.sym.type.asMethodType(), type)) return (MethodSymbol)e.sym; if (nt.name != names.init) // not a constructor return null; if ((flags & INTERFACE) != 0) // no enclosing instance return null; if (nt.uniqueType.type.getParameterTypes().isEmpty()) // no parameters return null; // A constructor of an inner class. // Remove the first argument (the enclosing instance) nt.setType(new MethodType(nt.uniqueType.type.getParameterTypes().tail, nt.uniqueType.type.getReturnType(), nt.uniqueType.type.getThrownTypes(), syms.methodClass)); // Try searching again return findMethod(nt, scope, flags); }
protected void read(Symbol sym, int attrLen) { int nexceptions = nextChar(); List<Type> thrown = List.nil(); for (int j = 0; j < nexceptions; j++) thrown = thrown.prepend(readClassSymbol(nextChar()).type); if (sym.type.getThrownTypes().isEmpty()) sym.type.asMethodType().thrown = thrown.reverse(); } },
List.<Type>nil(); Type constrType = new ForAll(site.tsym.type.getTypeArguments().appendList(oldParams), types.createMethodTypeWithReturn(sym.type.asMethodType(), site)); MethodSymbol newConstr = new MethodSymbol(sym.flags(), names.init, constrType, site.tsym) { @Override
List.<Type>nil(); Type constrType = new ForAll(site.tsym.type.getTypeArguments().appendList(oldParams), types.createMethodTypeWithReturn(sym.type.asMethodType(), site)); MethodSymbol newConstr = new MethodSymbol(sym.flags(), names.init, constrType, site.tsym) { @Override
protected void read(Symbol sym, int attrLen) { if (sym.kind == TYP) { ClassSymbol c = (ClassSymbol) sym; readingClassAttr = true; try { ClassType ct1 = (ClassType)c.type; Assert.check(c == currentOwner); ct1.typarams_field = readTypeParams(nextChar()); ct1.supertype_field = sigToType(); ListBuffer<Type> is = new ListBuffer<Type>(); while (sigp != siglimit) is.append(sigToType()); ct1.interfaces_field = is.toList(); } finally { readingClassAttr = false; } } else { List<Type> thrown = sym.type.getThrownTypes(); sym.type = readType(nextChar()); //- System.err.println(" # " + sym.type); if (sym.kind == MTH && sym.type.getThrownTypes().isEmpty()) sym.type.asMethodType().thrown = thrown; } } },
protected void read(Symbol sym, int attrLen) { if (sym.kind == TYP) { ClassSymbol c = (ClassSymbol) sym; readingClassAttr = true; try { ClassType ct1 = (ClassType)c.type; Assert.check(c == currentOwner); ct1.typarams_field = readTypeParams(nextChar()); ct1.supertype_field = sigToType(); ListBuffer<Type> is = new ListBuffer<Type>(); while (sigp != siglimit) is.append(sigToType()); ct1.interfaces_field = is.toList(); } finally { readingClassAttr = false; } } else { List<Type> thrown = sym.type.getThrownTypes(); sym.type = readType(nextChar()); //- System.err.println(" # " + sym.type); if (sym.kind == MTH && sym.type.getThrownTypes().isEmpty()) sym.type.asMethodType().thrown = thrown; } } },
MethodType ty = m.externalType(types).asMethodType(); final int allparams = ty.argtypes.size(); if (m.params != null && allparams != 0) {