private JMethod createSyntheticMethodFromBinding(SourceInfo info, MethodBinding binding, String[] paramNames) { JMethod method = typeMap.createMethod(info, binding, paramNames); assert !method.isExternal(); method.setBody(new JMethodBody(info)); typeMap.setMethod(binding, method); return method; }
private JMethod createSyntheticMethod(SourceInfo info, String name, JDeclaredType enclosingType, JType returnType, boolean isAbstract, boolean isStatic, boolean isFinal, AccessModifier access) { JMethod method = new JMethod(info, name, enclosingType, returnType, isAbstract, isStatic, isFinal, access); method.freezeParamTypes(); method.setSynthetic(); method.setBody(new JMethodBody(info)); enclosingType.addMethod(method); return method; }
@Override public boolean visit(MethodDeclaration x, ClassScope scope) { try { JMethod method = typeMap.get(x.binding); assert !method.isExternal(); JMethodBody body = null; if (!method.isNative()) { body = new JMethodBody(method.getSourceInfo()); method.setBody(body); } pushMethodInfo(new MethodInfo(method, body, x.scope)); // Map user arguments. Iterator<JParameter> it = method.getParams().iterator(); if (x.arguments != null) { for (Argument argument : x.arguments) { curMethod.locals.put(argument.binding, it.next()); } } x.statements = reduceToReachable(x.statements); return true; } catch (Throwable e) { throw translateException(x, e); } }
private void processNativeMethod(MethodDeclaration x) { JMethod method = curMethod.method; JsniMethod jsniMethod = jsniMethods.get(x); assert jsniMethod != null; SourceInfo info = method.getSourceInfo(); JsFunction jsFunction = jsniMethod.function(); JsniMethodBody body = new JsniMethodBody(info); method.setBody(body); jsFunction.setFromJava(true); body.setFunc(jsFunction); // Resolve locals, params, and JSNI. JsParameterResolver localResolver = new JsParameterResolver(jsFunction); localResolver.accept(jsFunction); JsniResolver jsniResolver = new JsniResolver(body); jsniResolver.accept(jsFunction); }
clinit.setBody(new JMethodBody(SourceOrigin.UNKNOWN));
getSingleton.setBody(body); getSingleton.freezeParamTypes(); getSingleton.setSynthetic();
newMethod.setBody(body); JBlock block = body.getBlock(); for (Entry<JClassType,ReflectionStrategy> type : retained.entrySet()) {
.getTarget().getOriginalParamTypes()); final JMethodBody body = new JMethodBody(methodSource); newMethod.setBody(body); final JBlock block = body.getBlock(); for (final Entry<JClassType, ReflectionStrategy> type : retained.entrySet()) {
.getAccess()); typeMap.setMethod(jdtBridgeMethod, bridgeMethod); bridgeMethod.setBody(new JMethodBody(info)); curClass.type.addMethod(bridgeMethod); bridgeMethod.setSynthetic();