Top


定義場所(file name)

hotspot/src/share/vm/classfile/classLoader.cpp

名前(function name)

void ClassLoader::setup_bootstrap_search_path() {

本体部(body)

  {- -------------------------------------------
  (1) (assert)
      ---------------------------------------- -}

      assert(_first_entry == NULL, "should not setup bootstrap class search path twice");

  {- -------------------------------------------
  (1) (変数宣言など)
      ---------------------------------------- -}

      char* sys_class_path = os::strdup(Arguments::get_sysclasspath());

  {- -------------------------------------------
  (1) (トレース出力)
      ---------------------------------------- -}

      if (TraceClassLoading && Verbose) {
        tty->print_cr("[Bootstrap loader class path=%s]", sys_class_path);
      }

  {- -------------------------------------------
  (1) (変数宣言など)
      ---------------------------------------- -}

      int len = (int)strlen(sys_class_path);
      int end = 0;

  {- -------------------------------------------
  (1) Arguments::get_sysclasspath() に格納されている
      system class path 情報 (boot class path 情報) に対し, 
      その中の各ディレクトリ名に対して ClassLoader::update_class_path_entry_list() を呼び出すことで
      対応する ClassPathEntry を作成しておく.
      ---------------------------------------- -}

      // Iterate over class path entries
      for (int start = 0; start < len; start = end) {
        while (sys_class_path[end] && sys_class_path[end] != os::path_separator()[0]) {
          end++;
        }
        char* path = NEW_C_HEAP_ARRAY(char, end-start+1);
        strncpy(path, &sys_class_path[start], end-start);
        path[end-start] = '\0';
        update_class_path_entry_list(path, false);
        FREE_C_HEAP_ARRAY(char, path);
        while (sys_class_path[end] == os::path_separator()[0]) {
          end++;
        }
      }
    }

This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.