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

Consolidate duplicated classpath parsing code in classLoader.cpp

    Details

    • Subcomponent:
    • Resolved In Build:
      b12

      Description

      This pattern of code is duplicated 3 times and should be consolidated

      http://hg.openjdk.java.net/jdk/jdk/file/8c73d2a46ba9/src/hotspot/share/classfile/classLoader.cpp#l567

        Thread* THREAD = Thread::current();
        int len = (int)strlen(class_path);
        int end = 0;

        // Iterate over class path entries
        for (int start = 0; start < len; start = end) {
          while (class_path[end] && class_path[end] != os::path_separator()[0]) {
            end++;
          }
          EXCEPTION_MARK;
          ResourceMark rm(THREAD);
          char* path = NEW_RESOURCE_ARRAY(char, end - start + 1);
          strncpy(path, &class_path[start], end - start);
          path[end - start] = '\0';

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                iklam Ioi Lam
                Reporter:
                iklam Ioi Lam
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: