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

The following examples show how to use com.sun.tools.javac.code.Flags#SYNTHETIC . 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 openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
void verify(MethodSymbol m, boolean expectNames) {
    if ((m.flags() & Flags.SYNTHETIC) != 0 && !testSyntheticMethods)
        return;

    //System.err.println("verify: " + m.params());
    int i = 1;
    for (VarSymbol v: m.params()) {
        String expectName;
        if (expectNames)
            expectName = getExpectedName(v, i);
        else
            expectName = "arg" + (i - 1);
        checkEqual(expectName, v.name.toString());
        i++;
    }
}
 
Example 2
Source File: JNIWriter.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
private boolean needsHeader(ClassSymbol c, boolean checkNestedClasses) {
    if (c.isLocal() || (c.flags() & Flags.SYNTHETIC) != 0)
        return false;

    for (Scope.Entry i = c.members_field.elems; i != null; i = i.sibling) {
        if (i.sym.kind == Kinds.MTH && (i.sym.flags() & Flags.NATIVE) != 0)
            return true;
        for (Attribute.Compound a: i.sym.getDeclarationAttributes()) {
            if (a.type.tsym == syms.nativeHeaderType.tsym)
                return true;
        }
    }
    if (checkNestedClasses) {
        for (Scope.Entry i = c.members_field.elems; i != null; i = i.sibling) {
            if ((i.sym.kind == Kinds.TYP) && needsHeader(((ClassSymbol) i.sym), true))
                return true;
        }
    }
    return false;
}
 
Example 3
Source File: JNIWriter.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private boolean needsHeader(ClassSymbol c, boolean checkNestedClasses) {
    if (c.isLocal() || (c.flags() & Flags.SYNTHETIC) != 0)
        return false;

    for (Scope.Entry i = c.members_field.elems; i != null; i = i.sibling) {
        if (i.sym.kind == Kinds.MTH && (i.sym.flags() & Flags.NATIVE) != 0)
            return true;
        for (Attribute.Compound a: i.sym.getDeclarationAttributes()) {
            if (a.type.tsym == syms.nativeHeaderType.tsym)
                return true;
        }
    }
    if (checkNestedClasses) {
        for (Scope.Entry i = c.members_field.elems; i != null; i = i.sibling) {
            if ((i.sym.kind == Kinds.TYP) && needsHeader(((ClassSymbol) i.sym), true))
                return true;
        }
    }
    return false;
}
 
Example 4
Source File: JNIWriter.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
private boolean needsHeader(ClassSymbol c, boolean checkNestedClasses) {
    if (c.isLocal() || (c.flags() & Flags.SYNTHETIC) != 0)
        return false;

    for (Scope.Entry i = c.members_field.elems; i != null; i = i.sibling) {
        if (i.sym.kind == Kinds.MTH && (i.sym.flags() & Flags.NATIVE) != 0)
            return true;
        for (Attribute.Compound a: i.sym.getDeclarationAttributes()) {
            if (a.type.tsym == syms.nativeHeaderType.tsym)
                return true;
        }
    }
    if (checkNestedClasses) {
        for (Scope.Entry i = c.members_field.elems; i != null; i = i.sibling) {
            if ((i.sym.kind == Kinds.TYP) && needsHeader(((ClassSymbol) i.sym), true))
                return true;
        }
    }
    return false;
}
 
Example 5
Source File: T6889255.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
void verify(MethodSymbol m, boolean expectNames) {
    if ((m.flags() & Flags.SYNTHETIC) != 0 && !testSyntheticMethods)
        return;

    //System.err.println("verify: " + m.params());
    int i = 1;
    for (VarSymbol v: m.params()) {
        String expectName;
        if (expectNames)
            expectName = getExpectedName(v, i);
        else
            expectName = "arg" + (i - 1);
        checkEqual(expectName, v.name.toString());
        i++;
    }
}
 
Example 6
Source File: T6889255.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
void verify(MethodSymbol m, boolean expectNames) {
    if ((m.flags() & Flags.SYNTHETIC) != 0 && !testSyntheticMethods)
        return;

    //System.err.println("verify: " + m.params());
    int i = 1;
    for (VarSymbol v: m.params()) {
        String expectName;
        if (expectNames)
            expectName = getExpectedName(v, i);
        else
            expectName = "arg" + (i - 1);
        checkEqual(expectName, v.name.toString());
        i++;
    }
}
 
Example 7
Source File: T6889255.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
void verify(MethodSymbol m, boolean expectNames) {
    if ((m.flags() & Flags.SYNTHETIC) != 0 && !testSyntheticMethods)
        return;

    //System.err.println("verify: " + m.params());
    int i = 1;
    for (VarSymbol v: m.params()) {
        String expectName;
        if (expectNames)
            expectName = getExpectedName(v, i);
        else
            expectName = "arg" + (i - 1);
        checkEqual(expectName, v.name.toString());
        i++;
    }
}
 
Example 8
Source File: JNIWriter.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public boolean needsHeader(ClassSymbol c) {
    if (c.isLocal() || (c.flags() & Flags.SYNTHETIC) != 0)
        return false;

    if (checkAll)
        return needsHeader(c.outermostClass(), true);
    else
        return needsHeader(c, false);
}
 
Example 9
Source File: FieldDocImpl.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Returns true if this field was synthesized by the compiler.
 */
public boolean isSynthetic() {
    return (getFlags() & Flags.SYNTHETIC) != 0;
}
 
Example 10
Source File: JavaEnvironment.java    From j2cl with Apache License 2.0 4 votes vote down vote up
private static boolean isSynthetic(Element element) {
  return element instanceof Symbol && (((Symbol) element).flags() & Flags.SYNTHETIC) != 0;
}
 
Example 11
Source File: ExecutableMemberDocImpl.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Returns true if this field was synthesized by the compiler.
 */
public boolean isSynthetic() {
    return ((sym.flags() & Flags.SYNTHETIC) != 0);
}
 
Example 12
Source File: ClassDocImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Returns true if this class was synthesized by the compiler.
 */
public boolean isSynthetic() {
    return (getFlags() & Flags.SYNTHETIC) != 0;
}
 
Example 13
Source File: ExecutableMemberDocImpl.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Returns true if this field was synthesized by the compiler.
 */
public boolean isSynthetic() {
    return ((sym.flags() & Flags.SYNTHETIC) != 0);
}
 
Example 14
Source File: ClassDocImpl.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Returns true if this class was synthesized by the compiler.
 */
public boolean isSynthetic() {
    return (getFlags() & Flags.SYNTHETIC) != 0;
}
 
Example 15
Source File: FieldDocImpl.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Returns true if this field was synthesized by the compiler.
 */
public boolean isSynthetic() {
    return (getFlags() & Flags.SYNTHETIC) != 0;
}
 
Example 16
Source File: ExecutableMemberDocImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Returns true if this field was synthesized by the compiler.
 */
public boolean isSynthetic() {
    return ((sym.flags() & Flags.SYNTHETIC) != 0);
}
 
Example 17
Source File: ClassDocImpl.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Returns true if this class was synthesized by the compiler.
 */
public boolean isSynthetic() {
    return (getFlags() & Flags.SYNTHETIC) != 0;
}
 
Example 18
Source File: ClassDocImpl.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Returns true if this class was synthesized by the compiler.
 */
public boolean isSynthetic() {
    return (getFlags() & Flags.SYNTHETIC) != 0;
}
 
Example 19
Source File: ClassDocImpl.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Returns true if this class was synthesized by the compiler.
 */
public boolean isSynthetic() {
    return (getFlags() & Flags.SYNTHETIC) != 0;
}
 
Example 20
Source File: ElementUtilities.java    From netbeans with Apache License 2.0 2 votes vote down vote up
/**Returns true if the given element is synthetic.
 * 
 *  @param element to check
 *  @return true if and only if the given element is synthetic, false otherwise
 */
public boolean isSynthetic(Element element) {
    return (((Symbol) element).flags() & Flags.SYNTHETIC) != 0 || (((Symbol) element).flags() & Flags.GENERATEDCONSTR) != 0;
}