hotspot/src/share/vm/classfile/sharedPathsMiscInfo.cpp
changeset 42876 ff8ff9dcccec
parent 41281 e1dc38ba642f
child 46365 d79745f72ae6
equal deleted inserted replaced
42875:bac62054c0b6 42876:ff8ff9dcccec
    84     out->print("Expecting that %s does not exist", path);
    84     out->print("Expecting that %s does not exist", path);
    85     break;
    85     break;
    86   case REQUIRED:
    86   case REQUIRED:
    87     out->print("Expecting that file %s must exist and is not altered", path);
    87     out->print("Expecting that file %s must exist and is not altered", path);
    88     break;
    88     break;
    89   case PATCH_MOD:
       
    90     out->print("Expecting --patch-module=%s", path);
       
    91     break;
       
    92   default:
    89   default:
    93     ShouldNotReachHere();
    90     ShouldNotReachHere();
    94   }
    91   }
    95 }
    92 }
    96 
    93 
   165           return fail("File size mismatch");
   162           return fail("File size mismatch");
   166         }
   163         }
   167       }
   164       }
   168     }
   165     }
   169     break;
   166     break;
   170   case PATCH_MOD:
       
   171     {
       
   172       GrowableArray<ModulePatchPath*>* patch_mod_args = Arguments::get_patch_mod_prefix();
       
   173       if (patch_mod_args != NULL) {
       
   174         int num_of_entries = patch_mod_args->length();
       
   175         for (int i = 0; i < num_of_entries; i++) {
       
   176           const char* module_name = (patch_mod_args->at(i))->module_name();
       
   177           const char* path_string = (patch_mod_args->at(i))->path_string();
       
   178           size_t n = strlen(module_name);
       
   179           // path contains the module name, followed by '=', and one or more entries.
       
   180           // E.g.: "java.base=foo" or "java.naming=dir1:dir2:dir3"
       
   181           if ((strncmp(module_name, path, n) != 0) ||
       
   182               (path[n] != '=') ||
       
   183               (strcmp(path + n + 1, path_string) != 0)) {
       
   184             return fail("--patch-module mismatch, path not found in run time: ", path);
       
   185           }
       
   186         }
       
   187       }
       
   188     }
       
   189     break;
       
   190   default:
   167   default:
   191     return fail("Corrupted archive file header");
   168     return fail("Corrupted archive file header");
   192   }
   169   }
   193 
   170 
   194   return true;
   171   return true;