Java Code Examples for com.sun.tools.javac.code.Flags#BRIDGE

The following examples show how to use com.sun.tools.javac.code.Flags#BRIDGE . 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: T6889255.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
String getExpectedName(VarSymbol v, int i) {
    // special cases:
    // synthetic method
    if (((v.owner.owner.flags() & Flags.ENUM) != 0)
            && v.owner.name.toString().equals("valueOf"))
        return "name";
    // interfaces don't have saved names
    // -- no Code attribute for the LocalVariableTable attribute
    if ((v.owner.owner.flags() & Flags.INTERFACE) != 0)
        return "arg" + (i - 1);
    // abstract methods don't have saved names
    // -- no Code attribute for the LocalVariableTable attribute
    if ((v.owner.flags() & Flags.ABSTRACT) != 0)
        return "arg" + (i - 1);
    // bridge methods use argN. No LVT for them anymore
    if ((v.owner.flags() & Flags.BRIDGE) != 0)
        return "arg" + (i - 1);

    // The rest of this method assumes the local conventions in the test program
    Type t = v.type;
    String s;
    if (t.hasTag(TypeTag.CLASS))
        s = ((ClassType) t).tsym.name.toString();
    else
        s = t.toString();
    return String.valueOf(Character.toLowerCase(s.charAt(0))) + i;
}
 
Example 2
Source File: T6889255.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
String getExpectedName(VarSymbol v, int i) {
    // special cases:
    // synthetic method
    if (((v.owner.owner.flags() & Flags.ENUM) != 0)
            && v.owner.name.toString().equals("valueOf"))
        return "name";
    // interfaces don't have saved names
    // -- no Code attribute for the LocalVariableTable attribute
    if ((v.owner.owner.flags() & Flags.INTERFACE) != 0)
        return "arg" + (i - 1);
    // abstract methods don't have saved names
    // -- no Code attribute for the LocalVariableTable attribute
    if ((v.owner.flags() & Flags.ABSTRACT) != 0)
        return "arg" + (i - 1);
    // bridge methods use argN. No LVT for them anymore
    if ((v.owner.flags() & Flags.BRIDGE) != 0)
        return "arg" + (i - 1);

    // The rest of this method assumes the local conventions in the test program
    Type t = v.type;
    String s;
    if (t.hasTag(TypeTag.CLASS))
        s = ((ClassType) t).tsym.name.toString();
    else
        s = t.toString();
    return String.valueOf(Character.toLowerCase(s.charAt(0))) + i;
}
 
Example 3
Source File: T6889255.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
String getExpectedName(VarSymbol v, int i) {
    // special cases:
    // synthetic method
    if (((v.owner.owner.flags() & Flags.ENUM) != 0)
            && v.owner.name.toString().equals("valueOf"))
        return "name";
    // interfaces don't have saved names
    // -- no Code attribute for the LocalVariableTable attribute
    if ((v.owner.owner.flags() & Flags.INTERFACE) != 0)
        return "arg" + (i - 1);
    // abstract methods don't have saved names
    // -- no Code attribute for the LocalVariableTable attribute
    if ((v.owner.flags() & Flags.ABSTRACT) != 0)
        return "arg" + (i - 1);
    // bridge methods use argN. No LVT for them anymore
    if ((v.owner.flags() & Flags.BRIDGE) != 0)
        return "arg" + (i - 1);

    // The rest of this method assumes the local conventions in the test program
    Type t = v.type;
    String s;
    if (t.hasTag(TypeTag.CLASS))
        s = ((ClassType) t).tsym.name.toString();
    else
        s = t.toString();
    return String.valueOf(Character.toLowerCase(s.charAt(0))) + i;
}
 
Example 4
Source File: T6889255.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
String getExpectedName(VarSymbol v, int i) {
    // special cases:
    // synthetic method
    if (((v.owner.owner.flags() & Flags.ENUM) != 0)
            && v.owner.name.toString().equals("valueOf"))
        return "name";
    // interfaces don't have saved names
    // -- no Code attribute for the LocalVariableTable attribute
    if ((v.owner.owner.flags() & Flags.INTERFACE) != 0)
        return "arg" + (i - 1);
    // abstract methods don't have saved names
    // -- no Code attribute for the LocalVariableTable attribute
    if ((v.owner.flags() & Flags.ABSTRACT) != 0)
        return "arg" + (i - 1);
    // bridge methods use argN. No LVT for them anymore
    if ((v.owner.flags() & Flags.BRIDGE) != 0)
        return "arg" + (i - 1);

    // The rest of this method assumes the local conventions in the test program
    Type t = v.type;
    String s;
    if (t.hasTag(TypeTag.CLASS))
        s = ((ClassType) t).tsym.name.toString();
    else
        s = t.toString();
    return String.valueOf(Character.toLowerCase(s.charAt(0))) + i;
}
 
Example 5
Source File: T6889255.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
String getExpectedName(VarSymbol v, int i) {
    // special cases:
    // synthetic method
    if (((v.owner.owner.flags() & Flags.ENUM) != 0)
            && v.owner.name.toString().equals("valueOf"))
        return "name";
    // interfaces don't have saved names
    // -- no Code attribute for the LocalVariableTable attribute
    if ((v.owner.owner.flags() & Flags.INTERFACE) != 0)
        return "arg" + (i - 1);
    // abstract methods don't have saved names
    // -- no Code attribute for the LocalVariableTable attribute
    if ((v.owner.flags() & Flags.ABSTRACT) != 0)
        return "arg" + (i - 1);
    // bridge methods use argN. No LVT for them anymore
    if ((v.owner.flags() & Flags.BRIDGE) != 0)
        return "arg" + (i - 1);

    // The rest of this method assumes the local conventions in the test program
    Type t = v.type;
    String s;
    if (t.hasTag(TypeTag.CLASS))
        s = ((ClassType) t).tsym.name.toString();
    else
        s = t.toString();
    return String.valueOf(Character.toLowerCase(s.charAt(0))) + i;
}
 
Example 6
Source File: T6889255.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
String getExpectedName(VarSymbol v, int i) {
    // special cases:
    // synthetic method
    if (((v.owner.owner.flags() & Flags.ENUM) != 0)
            && v.owner.name.toString().equals("valueOf"))
        return "name";
    // interfaces don't have saved names
    // -- no Code attribute for the LocalVariableTable attribute
    if ((v.owner.owner.flags() & Flags.INTERFACE) != 0)
        return "arg" + (i - 1);
    // abstract methods don't have saved names
    // -- no Code attribute for the LocalVariableTable attribute
    if ((v.owner.flags() & Flags.ABSTRACT) != 0)
        return "arg" + (i - 1);
    // bridge methods use argN. No LVT for them anymore
    if ((v.owner.flags() & Flags.BRIDGE) != 0)
        return "arg" + (i - 1);

    // The rest of this method assumes the local conventions in the test program
    Type t = v.type;
    String s;
    if (t.hasTag(TypeTag.CLASS))
        s = ((ClassType) t).tsym.name.toString();
    else
        s = t.toString();
    return String.valueOf(Character.toLowerCase(s.charAt(0))) + i;
}
 
Example 7
Source File: T6889255.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
String getExpectedName(VarSymbol v, int i) {
    // special cases:
    // synthetic method
    if (((v.owner.owner.flags() & Flags.ENUM) != 0)
            && v.owner.name.toString().equals("valueOf"))
        return "name";
    // interfaces don't have saved names
    // -- no Code attribute for the LocalVariableTable attribute
    if ((v.owner.owner.flags() & Flags.INTERFACE) != 0)
        return "arg" + (i - 1);
    // abstract methods don't have saved names
    // -- no Code attribute for the LocalVariableTable attribute
    if ((v.owner.flags() & Flags.ABSTRACT) != 0)
        return "arg" + (i - 1);
    // bridge methods use argN. No LVT for them anymore
    if ((v.owner.flags() & Flags.BRIDGE) != 0)
        return "arg" + (i - 1);

    // The rest of this method assumes the local conventions in the test program
    Type t = v.type;
    String s;
    if (t.hasTag(TypeTag.CLASS))
        s = ((ClassType) t).tsym.name.toString();
    else
        s = t.toString();
    return String.valueOf(Character.toLowerCase(s.charAt(0))) + i;
}
 
Example 8
Source File: T6889255.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
String getExpectedName(VarSymbol v, int i) {
    // special cases:
    // synthetic method
    if (((v.owner.owner.flags() & Flags.ENUM) != 0)
            && v.owner.name.toString().equals("valueOf"))
        return "name";
    // interfaces don't have saved names
    // -- no Code attribute for the LocalVariableTable attribute
    if ((v.owner.owner.flags() & Flags.INTERFACE) != 0)
        return "arg" + (i - 1);
    // abstract methods don't have saved names
    // -- no Code attribute for the LocalVariableTable attribute
    if ((v.owner.flags() & Flags.ABSTRACT) != 0)
        return "arg" + (i - 1);
    // bridge methods use argN. No LVT for them anymore
    if ((v.owner.flags() & Flags.BRIDGE) != 0)
        return "arg" + (i - 1);

    // The rest of this method assumes the local conventions in the test program
    Type t = v.type;
    String s;
    if (t.hasTag(TypeTag.CLASS))
        s = ((ClassType) t).tsym.name.toString();
    else
        s = t.toString();
    return String.valueOf(Character.toLowerCase(s.charAt(0))) + i;
}
 
Example 9
Source File: ExtensionTransformer.java    From manifold with Apache License 2.0 4 votes vote down vote up
private boolean isBridgeMethod( JCTree.JCMethodDecl tree )
{
  long modifiers = tree.getModifiers().flags;
  return (Flags.BRIDGE & modifiers) != 0;
}
 
Example 10
Source File: ManAttr.java    From manifold with Apache License 2.0 4 votes vote down vote up
static boolean isSynthetic( Symbol.MethodSymbol m )
{
  return (m.flags() & Flags.SYNTHETIC) != 0 ||
         (m.flags() & Flags.BRIDGE) != 0;
}