code: static URL getSharedClassCacheURL(URL resourceURL, String resourceName) {
          URL sharedClassCacheURL;
          if (resourceURL == null) {
              sharedClassCacheURL = null;
          } else {
              String protocol = resourceURL.getProtocol();
              if ("jar".equals(protocol)) {
                  sharedClassCacheURL = resourceURL;
              } else if ("wsjar".equals(protocol)) {
                  try {
                      sharedClassCacheURL = new URL(resourceURL.toExternalForm().substring(2));
                  } catch (MalformedURLException e) {
                      sharedClassCacheURL = null;
                  }
              } else if (!"file".equals(protocol)) {
                  sharedClassCacheURL = null;
              } else {
                  String externalForm = resourceURL.toExternalForm();
                  if (externalForm.endsWith(resourceName)) {
                      try {
                          sharedClassCacheURL = new URL(externalForm.substring(0, externalForm.length() - resourceName.length()));
                      } catch (MalformedURLException e) {
                          sharedClassCacheURL = null;
                      }
                  } else {
                      sharedClassCacheURL = null;
                  }
              }
          }
          return sharedClassCacheURL;
      }
docs: Computes the shared class cache URL from the resource URL.
  
  If the URL is a jar protocol URL, then use it as is.
  If it is a wsjar protocol URL, then change it to a jar protocol URL.
  If it is a file protocol URL, confirm that the URL ends with the
  class file name, and return the directory before the package
  qualified class file name.
  
  @param resourceURL The URL of the location of the class file.
  @param resourceName The resource path of the class file. i.e. package/sub/MyClass.class
  @return the URL to pass to the shared class cache, or null if protocol is wrong,
  or path doesn't include resourceName.