• Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: P4 P4
    • repo-valhalla
    • repo-valhalla
    • core-libs
    • None

      Unit tests this JEP covers should verify the following functionalities.

      1. Discoverability

      - A hidden class cannot be found by any class loader e.g. Class::forName with the name of a hidden class will throw CNFE.
      - A hidden class cannot self reference from a descriptor for example method parameter or declaring type of its field
      - A hidden class can access its member via `this_class` item.

      2. Name of a hidden class

      - Class::getName returns a string which is not a binary name, containing `/` character as specified in `Lookup::defineHiddenClass`
      - JVMTI GetClassSignature returns a string containing `.` character as specified in `Lookup::defineHiddenClass`

      3. Test Verification to resolve itself if IsAssignable test with self's class name.

      4. Test a hidden class calling `Lookup::defineHiddenClass` to create another hidden class with and without NESTMATE to verify the access.

      5. Test a hidden class with and without STRONG to verify if it will have the same lifecycle as the class loader or not.

      6. If a classfile that can be defined and linked as a normal class and it does not reference itself as any descriptor, it should be created as a hidden class and linked successfully including the following cases:
        - it can be an abstract class
        - it can be an interface
        - the classfile contains `InnerClasses` attribute (i.e. if it's defined as a normal class, it represents an enclosing class, or outer class or inner class). The reflection API may fail when resolving a named class listed in `InnerClasses` attribute if it's a hidden class.

      7. A hidden class is hidden from the stack trace, same behavior as `@Hidden`

      8. Identify the regression tests added for VM anonymous class and determine if a similar test should be added for hidden classes.

            mchung Mandy Chung (Inactive)
            mchung Mandy Chung (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: