Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8177155 Examine @CS methods when called from attached thread with no caller
  3. JDK-8281006

Module::getResourceAsStream should check if the resource is open unconditionally when caller is null

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: P4 P4
    • 19
    • 9
    • core-libs
    • None

      Need a test to verify if Module::getResourceAsStream handles properly with null caller. Same verification is needed for Class::getResourceAsStream.

              if (isNamed() && Resources.canEncapsulate(name)) {
                  Module caller = getCallerModule(Reflection.getCallerClass());
                  if (caller != this && caller != Object.class.getModule()) {
                      String pn = Resources.toPackageName(name);
                      if (getPackages().contains(pn)) {
                          if (caller == null && !isOpen(pn)) {
                              // no caller, package not open
                              return null;
                          }
                          if (!isOpen(pn, caller)) {
                              // package not open to caller
                              return null;
                          }
                      }
                  }
              }

            tprinzing Tim Prinzing (Inactive)
            mchung Mandy Chung (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: