Java Code Examples for com.sun.tools.javac.code.Type#getThrownTypes()

The following examples show how to use com.sun.tools.javac.code.Type#getThrownTypes() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LambdaToMethod.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private MethodType typeToMethodType(Type mt) {
    Type type = types.erasure(mt);
    return new MethodType(type.getParameterTypes(),
                    type.getReturnType(),
                    type.getThrownTypes(),
                    syms.methodClass);
}
 
Example 2
Source File: LambdaToMethod.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private MethodType typeToMethodType(Type mt) {
    Type type = types.erasure(mt);
    return new MethodType(type.getParameterTypes(),
                    type.getReturnType(),
                    type.getThrownTypes(),
                    syms.methodClass);
}
 
Example 3
Source File: LambdaToMethod.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private MethodType typeToMethodType(Type mt) {
    Type type = types.erasure(mt);
    return new MethodType(type.getParameterTypes(),
                    type.getReturnType(),
                    type.getThrownTypes(),
                    syms.methodClass);
}
 
Example 4
Source File: Lower.java    From lua-for-android with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public void visitMethodDef(JCMethodDecl tree) {
    if (tree.name == names.init && (currentClass.flags_field&ENUM) != 0) {
        // Add "String $enum$name, int $enum$ordinal" to the beginning of the
        // argument list for each constructor of an enum.
        JCVariableDecl nameParam = make_at(tree.pos()).
            Param(names.fromString(target.syntheticNameChar() +
                                   "enum" + target.syntheticNameChar() + "name"),
                  syms.stringType, tree.sym);
        nameParam.mods.flags |= SYNTHETIC; nameParam.sym.flags_field |= SYNTHETIC;
        JCVariableDecl ordParam = make.
            Param(names.fromString(target.syntheticNameChar() +
                                   "enum" + target.syntheticNameChar() +
                                   "ordinal"),
                  syms.intType, tree.sym);
        ordParam.mods.flags |= SYNTHETIC; ordParam.sym.flags_field |= SYNTHETIC;

        MethodSymbol m = tree.sym;
        tree.params = tree.params.prepend(ordParam).prepend(nameParam);

        m.extraParams = m.extraParams.prepend(ordParam.sym);
        m.extraParams = m.extraParams.prepend(nameParam.sym);
        Type olderasure = m.erasure(types);
        m.erasure_field = new MethodType(
            olderasure.getParameterTypes().prepend(syms.intType).prepend(syms.stringType),
            olderasure.getReturnType(),
            olderasure.getThrownTypes(),
            syms.methodClass);
    }

    JCMethodDecl prevMethodDef = currentMethodDef;
    MethodSymbol prevMethodSym = currentMethodSym;
    try {
        currentMethodDef = tree;
        currentMethodSym = tree.sym;
        visitMethodDefInternal(tree);
    } finally {
        currentMethodDef = prevMethodDef;
        currentMethodSym = prevMethodSym;
    }
}
 
Example 5
Source File: LambdaToMethod.java    From lua-for-android with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private MethodType typeToMethodType(Type mt) {
    Type type = types.erasure(mt);
    return new MethodType(type.getParameterTypes(),
                    type.getReturnType(),
                    type.getThrownTypes(),
                    syms.methodClass);
}
 
Example 6
Source File: LambdaToMethod.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private MethodType typeToMethodType(Type mt) {
    Type type = types.erasure(mt);
    return new MethodType(type.getParameterTypes(),
                    type.getReturnType(),
                    type.getThrownTypes(),
                    syms.methodClass);
}
 
Example 7
Source File: LambdaToMethod.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private MethodType typeToMethodType(Type mt) {
    Type type = types.erasure(mt);
    return new MethodType(type.getParameterTypes(),
                    type.getReturnType(),
                    type.getThrownTypes(),
                    syms.methodClass);
}
 
Example 8
Source File: LambdaToMethod.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private MethodType typeToMethodType(Type mt) {
    Type type = types.erasure(mt);
    return new MethodType(type.getParameterTypes(),
                    type.getReturnType(),
                    type.getThrownTypes(),
                    syms.methodClass);
}
 
Example 9
Source File: LambdaToMethod.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private MethodType typeToMethodType(Type mt) {
    Type type = types.erasure(mt);
    return new MethodType(type.getParameterTypes(),
                    type.getReturnType(),
                    type.getThrownTypes(),
                    syms.methodClass);
}
 
Example 10
Source File: LambdaToMethod.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private MethodType typeToMethodType(Type mt) {
    Type type = types.erasure(mt);
    return new MethodType(type.getParameterTypes(),
                    type.getReturnType(),
                    type.getThrownTypes(),
                    syms.methodClass);
}