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

ResourcePoolManager.findEntry has a bug in startsWith call

    XMLWordPrintable

Details

    • b131
    • generic
    • generic
    • Verified

    Description


              @Override
              public Optional<ResourcePoolEntry> findEntry(String path) {
                  if (!path.startsWith("/")) {
                      path = "/" + path;
                  }
                  if (!path.startsWith("/" + name)) {
                      path = "/" + name + path;
                  }
                  return Optional.ofNullable(moduleContent.get(path));
              }

      For findEntry("module-info.class") and module name "m" it will first change path to "/module-info.class" and then see that path.startsWith("/m") is true and not append "/m".

                  if (!path.startsWith("/" + name + "/")) {
                      path = "/" + name + path; // path must start with "/" already
                  }

      Attachments

        Activity

          People

            sundar Sundararajan Athijegannathan
            sundar Sundararajan Athijegannathan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: