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

JDI: TypeComponent.isSynthetic() lies about synthetic field

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      generic, x86
    • OS:
      generic, windows_2000

      Backports

        Description



        Name: elR10090 Date: 02/14/2001



        Java HotSpot server and client VMs (build 1.4.0-beta-b51, build 1.3.1-beta-b15)
        fail to pass the test

            nsk/jdi/TypeComponent/isSynthetic/issynthetic001
            
        This test checks if TypeComponent.isSynthetic() method returns true
        for synthetic fields and returns false otherwise.

        However, we did not find any problem with TypeComponent.isSynthetic()
        being applied to methods.

        Please note, that the method VirtualMachine.canGetSyntheticAttribute()
        returns true, so checking isSynthetic() method is legal.

        There are the classes ClassToCheck and NestedClass (declared within
        ClassToCheck) loaded by the debugee VM, and 87 fields are declared
        in the NestedClass.

        Debugger finds 88 fields returned by the method ReferenceType.fields() for
        the class NestedClass -- 87 fields declared explicitely in the Java source
        for the class NestedClass, and the field named 'this$0' that is not declared
        in the source code. Therefore, this field must be marked as synthetic; but
        isSynthetic() returns false for the field 'this$0'.

        See log:

        ##>
        ##> WARNING: switching to verbose mode because
        ##> the test complains an error
        ##>
        #VirtualMachineManager: version 1.4
        #LaunchingConnector:
        # name: com.sun.jdi.CommandLineLaunch
        # description: Launches target using Sun Java VM command line and attaches to it
        # transport: dt_socket
        #Arguments: {home=home=/export/ld50/java/dest/jdk1.4.0beta-b51/solsparc, vmexec=vmexec=java,
        options=options=, main=main=nsk.jdi.TypeComponent.isSynthetic.issynthetic001a, quote=quote=",
        suspend=suspend=true}
        #debuger> Value of canGetSyntheticAttribute in current VM is true
        #debuger> 87 field this$0 with synthetic value false read without UnsupportedOperationException.
        ## ERROR: debuger FAILURE 3> Field's this$0 synthetic is false, but expected is true
        ## ERROR: debuger FAILURE 4> Synthetic fields not found.
        ## ERROR: debuger FAILURE> TEST FAILED

        The test will appear in the next testbase_nsk release located at:

            /net/sqesvr.eng/export/vsn/VM/testbase/merlin/testbase_nsk

        To reproduce the failure, please use 'doit.sh' script found
        in the directory:

            /net/sqesvr.eng/export/vsn/GammaBase/Bugs/<this bug number>

        Use:
            doit.sh $JAVA_HOME
            
        ======================================================================

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                dcubed Daniel Daugherty
                Reporter:
                latkinsunw Latkin Latkin (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: