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

Redundant CLCs for classes resolved in both loaders

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 10
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b21

      Description

      The code for SD::add_loader_constraint() doesn't check whether the class is already present in both loaders:

      diff --git a/src/share/vm/classfile/loaderConstraints.cpp b/src/share/vm/classfile/loaderConstraints.cpp
      --- a/src/share/vm/classfile/loaderConstraints.cpp
      +++ b/src/share/vm/classfile/loaderConstraints.cpp
      @@ -186,8 +186,9 @@
                                              Klass* klass2, Handle class_loader2) {
          int failure_code = 0; // encode different reasons for failing

      - if (klass1 != NULL && klass2 != NULL && klass1 != klass2) {
      - failure_code = 1;
      + if (klass1 != NULL && klass2 != NULL) {
      + // Same type already loaded in both places. There is no need for any constraint.
      + failure_code = (klass1 == klass2) ? 0 : 1;
          } else {
            Klass* klass = klass1 != NULL ? klass1 : klass2;

        Attachments

          Activity

            People

            Assignee:
            hseigel Harold Seigel
            Reporter:
            vlivanov Vladimir Ivanov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: