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

SA-JDI: ReferenceType.nestedTypes() returns inherited nested class

XMLWordPrintable

    • beta2
    • generic
    • generic
    • Verified



      Name: ipR10196 Date: 03/01/2004


      -----------------------------------------------------
      Test : nsk/sajdi/ReferenceType/nestedTypes/nestedtypes001
      VM : ClientVM, ServerVM
      Mode : all
      Platform : generic
      OS : generic
      JDK : since 1.5.0-beta2-b40
      ------------------------------------------------------

      After fixing in Tiger-b40 the following bug:

        4990374 SA-JDI: nestedTypes() returns classes/interfaces with wrong modifiers

      ReferenceType.nestedTypes() starts to return unexpected nested
      class declared in implemented interface of TestedClass, not in
      TestedClass itself:

          interface BaseInterface {
              public interface InheritedPublicInterface1 {...}
              public class InheritedPublicClass1 {...}
          }

          class BaseClass {
              ...
          }

          class TestedClass extends BaseClass implements BaseInterface {
              ...
          }

      Here is test output:

      # ERROR: ReferenceType.nestedTypes() returned unexpected type:
      # ERROR: type nom: 20
      # ERROR: type name: nsk.sajdi.ReferenceType.nestedTypes.nestedtypes001aBaseInterface$InheritedPublicClass1
      # ERROR: signature: Lnsk/sajdi/ReferenceType/nestedTypes/nestedtypes001aBaseInterface$InheritedPublicClass1;
      # ERROR: isSynthetic: false

      Nested interface declared in BaseInterface as well as nested
      classes and interfaces declared in superclass BaseClass are not
      returned as expected. With legacy JDI connectors also no inherited
      nested classes and interfaces are returned.

      JDI spec for ReferenceType.nestedTypes() requires it to return
      only nested types declared within this ReferenceType, so inherited
      nested types should not be returned:

          List nestedTypes()

          Returns a List containing ReferenceType objects that are declared
          within this type and are currently loaded into Virtual Machine,
          Both static nested types and non-static nested types (that is, inner types)
          are included. Local inner types (declared within a code block somewhere
          in this reference type) are also included in the returned list.

      To reproduce this failure:
        cd /net/jano.sfbay/export/disk20/GammaBase/Bugs/<this bug number>
        sh build.sh $JAVA_HOME
        sh run.sh [-pid | -core | -socket] [-g] [-v] $JAVA_HOME [JAVA_OPTS]
      where:
          -pid - run test with SA-JDI pid attaching connector (default)
          -core - run test with SA-JDI core attaching connector
          -socket - run test with JDI socket attaching connector
          -g - run test with java_g binaries
          -v - run test in verbose mode

      This test will appear in the next r27 testbase release.
      Running on Linux this test may fail due to known bug:
      4996081 SA-JDI: SAPIDAttachingConnector.attach() throws IOEception on RH AS2.1

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

            sundar Sundararajan Athijegannathan
            popovsunw Popov Popov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: