src/share/vm/classfile/sharedPathsMiscInfo.cpp

Print this page




  93     if (TraceClassPaths) {
  94       tty->print("[type=%s ", type_name(type));
  95       print_path(tty, type, path);
  96       tty->print_cr("]");
  97     }
  98     if (!check(type, path)) {
  99       if (!PrintSharedArchiveAndExit) {
 100         return false;
 101       }
 102     } else {
 103       trace_class_path("[ok");
 104     }
 105   }
 106 
 107   return true;
 108 }
 109 
 110 bool SharedPathsMiscInfo::check(jint type, const char* path) {
 111   switch (type) {
 112   case BOOT:
 113     if (strcmp(path, Arguments::get_sysclasspath()) != 0) {
 114       return fail("[BOOT classpath mismatch, actual: -Dsun.boot.class.path=", Arguments::get_sysclasspath());
 115     }
 116     break;
 117   case NON_EXIST: // fall-through
 118   case REQUIRED:
 119     {
 120       struct stat st;
 121       if (os::stat(path, &st) != 0) {
 122         // The file does not actually exist
 123         if (type == REQUIRED) {
 124           // but we require it to exist -> fail
 125           return fail("Required file doesn't exist");
 126         }
 127       } else {
 128         // The file actually exists
 129         if (type == NON_EXIST) {
 130           // But we want it to not exist -> fail
 131           return fail("File must not exist");
 132         }
 133         time_t    timestamp;




  93     if (TraceClassPaths) {
  94       tty->print("[type=%s ", type_name(type));
  95       print_path(tty, type, path);
  96       tty->print_cr("]");
  97     }
  98     if (!check(type, path)) {
  99       if (!PrintSharedArchiveAndExit) {
 100         return false;
 101       }
 102     } else {
 103       trace_class_path("[ok");
 104     }
 105   }
 106 
 107   return true;
 108 }
 109 
 110 bool SharedPathsMiscInfo::check(jint type, const char* path) {
 111   switch (type) {
 112   case BOOT:
 113     if (os::file_name_strcmp(path, Arguments::get_sysclasspath()) != 0) {
 114       return fail("[BOOT classpath mismatch, actual: -Dsun.boot.class.path=", Arguments::get_sysclasspath());
 115     }
 116     break;
 117   case NON_EXIST: // fall-through
 118   case REQUIRED:
 119     {
 120       struct stat st;
 121       if (os::stat(path, &st) != 0) {
 122         // The file does not actually exist
 123         if (type == REQUIRED) {
 124           // but we require it to exist -> fail
 125           return fail("Required file doesn't exist");
 126         }
 127       } else {
 128         // The file actually exists
 129         if (type == NON_EXIST) {
 130           // But we want it to not exist -> fail
 131           return fail("File must not exist");
 132         }
 133         time_t    timestamp;