Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8057043

Type annotations not retained during class redefine / retransform

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b40

      Backports

        Description


        SYNOPSIS
        --------
        Type annotations not retained during class retransformation

        OPERATING SYSTEMS
        -----------------
        Tested on Linux, but the problem is believed to be platform independent.

        FULL JDK VERSION(S)
        -------------------
        java version "1.8.0_20-ea"
        Java(TM) SE Runtime Environment (build 1.8.0_20-ea-b23)
        Java HotSpot(TM) 64-Bit Server VM (build 25.20-b22, mixed mode)

        PROBLEM DESCRIPTION
        -------------------
        Type annotations are not retained during class retransformation.

        Observed behaviour:
        --------
        jdk-8u20/jdk1.8.0_20/jre/bin/java -javaagent:agent.jar -cp agent.jar
        TestTypeAnnotationsAgent

        Dump type annotations
        @TestAnn(site=formalParameterAnnotation)
        @TestAnn(site=returnTypeAnnotation)
        @TestAnn(site=throwsAnnotation)
        retransform
        Dumping classfile to :
        /tmp/TestTypeAnnotationsAgent$TypeAnnotatedTestClass.class

        Dump type annotations
        <no output>
        --------

        Expected behaviour:
        Expect to see type annotations in the classfile provided to the transformer.

        Please see documentation for JSR308, also section 4.7.20 of the Java virtual
        machine spec.

        TESTCASE
        --------
        Attached.

        REPRODUCTION INSTRUCTIONS
        -------------------------
        1. java -javaagent:agent.jar -cp agent.jar TestTypeAnnotationsAgent

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                aeriksso Andreas Eriksson (Inactive)
                Reporter:
                shadowbug Shadow Bug
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: