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

JDI spec: ReferenceType.equals() does not throw any Exception for unloaded class

XMLWordPrintable

    • sparc
    • solaris_7



      Name: abR10010 Date: 12/04/2000




      The Java Debug Interface specification for ReferenceType.equals()
      method says:
      "...
      Throws:
             ObjectCollectedException - if this reference type has been
             unloaded and garbage collected.
      ..."

      But the nsk/jdi/ReferenceType/equals/equals002 test
      shows that this assertion is violated.

      The test loads a class, gets a ReferenceType instance for this
      class, then enforces the class to be unloaded and calls the
      equals() method - the com.sun.jdi.ObjectCollectedException
      should be thrown in this case.
      In fact, there is no Exception thrown.

      In order to be convinced that the checked class has been unloaded
      really before the equals() method call the test try to get
      a ReferenceType instance for the class again and only if
      this ReferenceType instance could not be got the test consideres
      that the checked class has been unloaded and executes the check
      of the equals() method.

      This happens on both Solaris-Sparc and Win32.

      To reproduce the bug on Solaris run doit.sh in
      /net/sqesvr/export/vsn/GammaBase/Bugs/<this bug number>.

      The first parameter for doit.sh should be JDK root directory
      (e.g. /java/jdk1.4/solsparc) and the other parameter(s) -
      VM option(s) (optional).
        
      See log:

      % doit.sh /export/java/dest/jdk1.4.0beta-b43/solsparc
      java version "1.4.0beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0beta-b43)
      Java HotSpot(TM) Client VM (build 1.4beta-B43, mixed mode)
      ==> nsk/jdi/ReferenceType/equals/equals002 test LOG:
      --> test checks equals() method of ReferenceType interface
          of the com.sun.jdi package for UNLOADED class

      --> equals002: check ReferenceType.equals() method for unloaded class...
      ##> equals002: FAILED: NO any Exception thrown!
      ##> expected Exception - com.sun.jdi.ObjectCollectedException

      ==> nsk/jdi/ReferenceType/equals/equals002 test FAILED


      ======================================================================

            rfield Robert Field (Inactive)
            bondsunw Bond Bond (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: