docs: private static @CheckForNull String codeSource(@Nonnull Class<?> c) {
          CodeSource cs = c.getProtectionDomain().getCodeSource();
          if (cs == null) {
              return null;
          }
          URL loc = cs.getLocation();
          if (loc == null) {
              return null;
          }
          String r = loc.toString();
          if (r.endsWith(".class")) {
              // JENKINS-49147: Tomcat bug. Now do the more expensive check…
              String suffix = c.getName().replace('.', '/') + ".class";
              if (r.endsWith(suffix)) {
                  r = r.substring(0, r.length() - suffix.length());
              }
          }
          if (r.startsWith("jar:file:/") && r.endsWith(".jar!/")) {
              // JENKINS-49543: also an old behavior of Tomcat. Legal enough, but unexpected by isLocationWhitelisted.
              r = r.substring(4, r.length() - 2);
          }
          return r;
      }