有人有java注释“java.lang.Synthetic”的背景吗?

有人有java注释“java.lang.Synthetic”的背景吗?,java,annotations,Java,Annotations,有没有人有java注释java.lang.Synthetic的背景。我在列出JavaEE企业应用程序中出现的注释时遇到了这个问题。注释发生在包com.sun.xml中的几个类上。我找不到此注释的文档。它是不是一个官方的注释,比如说,由java编译器生成,用来表示一个合成的访问器,例如,请参见?这似乎不太可能,因为没有可用的文档。但是,包java.lang中的位置使注释看起来有点正式 也许这就是你要找的 仔细阅读ASM会发现这是ASM添加的虚拟参数注释 见: 与: 你确定是用java.lang写的

有没有人有java注释java.lang.Synthetic的背景。我在列出JavaEE企业应用程序中出现的注释时遇到了这个问题。注释发生在包com.sun.xml中的几个类上。我找不到此注释的文档。它是不是一个官方的注释,比如说,由java编译器生成,用来表示一个合成的访问器,例如,请参见?这似乎不太可能,因为没有可用的文档。但是,包java.lang中的位置使注释看起来有点正式

也许这就是你要找的


仔细阅读ASM会发现这是ASM添加的虚拟参数注释

见:

与:


你确定是用java.lang写的吗?嗨。这解释了合成方法,但不是我想要的。我正在寻找java.lang.Synthetic作为注释的含义。这是官方的注解吗?这是一个一次性而且可能不正确的sun工具创建吗?我这样问是因为注释位于java.lang包中,这使它看起来像官方/语言或规范定义的注释。
private void readParameterAnnotations(int v, final String desc,
        final char[] buf, final boolean visible, final MethodVisitor mv) {
    int i;
    int n = b[v++] & 0xFF;
    // workaround for a bug in javac (javac compiler generates a parameter
    // annotation array whose size is equal to the number of parameters in
    // the Java source file, while it should generate an array whose size is
    // equal to the number of parameters in the method descriptor - which
    // includes the synthetic parameters added by the compiler). This work-
    // around supposes that the synthetic parameters are the first ones.
    int synthetics = Type.getArgumentTypes(desc).length - n;
    AnnotationVisitor av;
    for (i = 0; i < synthetics; ++i) {
        // virtual annotation to detect synthetic parameters in MethodWriter
        av = mv.visitParameterAnnotation(i, "Ljava/lang/Synthetic;", false);
        if (av != null) {
            av.visitEnd();
        }
    }
    for (; i < n + synthetics; ++i) {
        int j = readUnsignedShort(v);
        v += 2;
        for (; j > 0; --j) {
            av = mv.visitParameterAnnotation(i, readUTF8(v, buf), visible);
            v = readAnnotationValues(v + 2, buf, true, av);
        }
    }
}