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

5.3.4: assert reflexive loader constraints

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 23
    • 16
    • specification
    • vm

      If a class loader L derives a class C, as described in 5.3.5, L will be recorded as an initiating loader of C.

      If that loader then discards C and returns some other class with the same name C' (which must have been derived by a different class loader), L will also be recorded as an initiating loader of C' (5.3.2).

      HotSpot responds to this situation with a LinkageError when it checks loader constraints.

      The rule being violated is specified as:

      ---

      A loading constraint is violated if, and only if, all the following four conditions hold:

      • There exists a loader L such that L has been recorded by the Java Virtual Machine as an initiating loader of a class C named N.

      • There exists a loader L' such that L' has been recorded by the Java Virtual Machine as an initiating loader of a class C' named N.

      • The equivalence relation defined by the (transitive closure of the) set of imposed constraints implies N^L = N^L'.

      • C ≠ C'.

      ---

      This almost addresses the scenario above, except that we need a *reflexive* closure to infer that N^L = N^L from a possibly-empty constraint relation. (The closure is presumably over the domain of all class loaders.) Reflexive closure is implied by "equivalence relation", but we should spell it out:

      ---

      • The equivalence relation defined by the (**reflexive,** transitive closure of the) set of imposed constraints implies N^L = N^L'.

      ---

            dlsmith Dan Smith
            dlsmith Dan Smith
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: