new MethodType(expectedArgTypes, returnType, List.<Type>nil(), symtab.methodClass); if (!freeTypeVariables.isEmpty()) { methodType = new ForAll(freeTypeVariables, methodType);
private KlassInfo(JCClassDecl clazz) { this.clazz = clazz; appendedMethodList = new ListBuffer<>(); deserializeCases = new HashMap<String, ListBuffer<JCStatement>>(); MethodType type = new MethodType(List.of(syms.serializedLambdaType), syms.objectType, List.<Type>nil(), syms.methodClass); deserMethodSym = makePrivateSyntheticMethod(STATIC, names.deserializeLambda, type, clazz.sym); deserParamSym = new VarSymbol(FINAL, names.fromString("lambda"), syms.serializedLambdaType, deserMethodSym); }
public Type visitMethodType(MethodType t, Type newReturn) { return new MethodType(t.argtypes, newReturn, t.thrown, t.tsym); } public Type visitForAll(ForAll t, Type newReturn) {
public Type visitMethodType(MethodType t, List<Type> newThrown) { return new MethodType(t.argtypes, t.restype, newThrown, t.tsym); } public Type visitForAll(ForAll t, List<Type> newThrown) {
@Override public Type visitMethodType(MethodType t, Void ignored) { List<Type> argtypes = subst(t.argtypes); Type restype = subst(t.restype); List<Type> thrown = subst(t.thrown); if (argtypes == t.argtypes && restype == t.restype && thrown == t.thrown) return t; else return new MethodType(argtypes, restype, thrown, t.tsym); }
@Override protected Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) { Scope sc = new Scope(syms.arrayClass); MethodSymbol arrayConstr = new MethodSymbol(PUBLIC, name, null, site.tsym); arrayConstr.type = new MethodType(List.<Type>of(syms.intType), site, List.<Type>nil(), syms.methodClass); sc.enter(arrayConstr); return findMethodInScope(env, site, name, argtypes, typeargtypes, sc, methodNotFound, phase.isBoxingRequired(), phase.isVarargsRequired(), false, false); }
public Type map(Mapping f) { List<Type> argtypes1 = map(argtypes, f); Type restype1 = f.apply(restype); List<Type> thrown1 = map(thrown, f); if (argtypes1 == argtypes && restype1 == restype && thrown1 == thrown) return this; else return new MethodType(argtypes1, restype1, thrown1, tsym); }
private MethodType typeToMethodType(Type mt) { Type type = types.erasure(mt); return new MethodType(type.getParameterTypes(), type.getReturnType(), type.getThrownTypes(), syms.methodClass); }
private JCExpression deserGetter(String func, Type type, List<Type> argTypes, List<JCExpression> args) { MethodType getmt = new MethodType(argTypes, type, List.<Type>nil(), syms.methodClass); Symbol getsym = rs.resolveQualifiedMethod(null, attrEnv, syms.serializedLambdaType, names.fromString(func), argTypes, List.<Type>nil()); return make.Apply( List.<JCExpression>nil(), make.Select(make.Ident(kInfo.deserParamSym).setType(syms.serializedLambdaType), getsym).setType(getmt), args).setType(type); }
private MethodType typeToMethodType(Type mt) { Type type = types.erasure(mt); return new MethodType(type.getParameterTypes(), type.getReturnType(), type.getThrownTypes(), syms.methodClass); }
@Override public Type visitMethodType(MethodType t, Void ignored) { List<Type> argtypes = subst(t.argtypes); Type restype = subst(t.restype); List<Type> thrown = subst(t.thrown); if (argtypes == t.argtypes && restype == t.restype && thrown == t.thrown) return t; else return new MethodType(argtypes, restype, thrown, t.tsym); }
@Override public MethodType inline(Inliner inliner) throws CouldNotResolveImportException { return new MethodType( inliner.<Type>inlineList(getParameterTypes()), getReturnType().inline(inliner), com.sun.tools.javac.util.List.<Type>nil(), inliner.symtab().methodClass); } }
/** Obtain a method type with given argument types. */ Type newMethodTemplate(Type restype, List<Type> argtypes, List<Type> typeargtypes) { MethodType mt = new MethodType(argtypes, restype, List.<Type>nil(), syms.methodClass); return (typeargtypes == null) ? mt : (Type)new ForAll(typeargtypes, mt); }
private JCExpression deserGetter(String func, Type type, List<Type> argTypes, List<JCExpression> args) { MethodType getmt = new MethodType(argTypes, type, List.<Type>nil(), syms.methodClass); Symbol getsym = rs.resolveQualifiedMethod(null, attrEnv, syms.serializedLambdaType, names.fromString(func), argTypes, List.<Type>nil()); return make.Apply( List.<JCExpression>nil(), make.Select(make.Ident(kInfo.deserParamSym).setType(syms.serializedLambdaType), getsym).setType(getmt), args).setType(type); }
private Type newMethodTemplate( Type restype, List<Type> argtypes, List<Type> typeargtypes ) { Type.MethodType mt = new Type.MethodType( argtypes, restype, List.nil(), _syms.methodClass ); return (typeargtypes == null) ? mt : new Type.ForAll( typeargtypes, mt ); }
@Override protected Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) { Scope sc = new Scope(syms.arrayClass); MethodSymbol arrayConstr = new MethodSymbol(PUBLIC, name, null, site.tsym); arrayConstr.type = new MethodType(List.<Type>of(syms.intType), site, List.<Type>nil(), syms.methodClass); sc.enter(arrayConstr); return findMethodInScope(env, site, name, argtypes, typeargtypes, sc, methodNotFound, phase.isBoxingRequired(), phase.isVarargsRequired(), false, false); }
/** Obtain a method type with given argument types. */ Type newMethTemplate(List<Type> argtypes, List<Type> typeargtypes) { MethodType mt = new MethodType(argtypes, null, null, syms.methodClass); return (typeargtypes == null) ? mt : (Type)new ForAll(typeargtypes, mt); }
public Type map(Mapping f) { List<Type> argtypes1 = map(argtypes, f); Type restype1 = f.apply(restype); List<Type> thrown1 = map(thrown, f); if (argtypes1 == argtypes && restype1 == restype && thrown1 == thrown) return this; else return new MethodType(argtypes1, restype1, thrown1, tsym); }
public Type map(Mapping f) { List<Type> argtypes1 = map(argtypes, f); Type restype1 = f.apply(restype); List<Type> thrown1 = map(thrown, f); if (argtypes1 == argtypes && restype1 == restype && thrown1 == thrown) return this; else return new MethodType(argtypes1, restype1, thrown1, tsym); }
@Override public MethodType inline(Inliner inliner) throws CouldNotResolveImportException { return new MethodType( inliner.<Type>inlineList(getParameterTypes()), getReturnType().inline(inliner), com.sun.tools.javac.util.List.<Type>nil(), inliner.symtab().methodClass); } }