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

Details

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

    Description

      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;
                          }
                      }
                  }
              }

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: