src/share/vm/classfile/sharedPathsMiscInfo.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File
*** old/src/share/vm/classfile/sharedPathsMiscInfo.cpp	Wed Sep 14 11:20:35 2016
--- new/src/share/vm/classfile/sharedPathsMiscInfo.cpp	Wed Sep 14 11:20:35 2016

*** 84,93 **** --- 84,96 ---- out->print("Expecting that %s does not exist", path); break; case REQUIRED: out->print("Expecting that file %s must exist and is not altered", path); break; + case PATCH_MOD: + out->print("Expecting --patch-module=%s", path); + break; default: ShouldNotReachHere(); } }
*** 144,153 **** --- 147,159 ---- // The file actually exists if (type == NON_EXIST) { // But we want it to not exist -> fail return fail("File must not exist"); } + if ((st.st_mode & S_IFREG) != S_IFREG) { + return fail("Wanted a file but it has become a directory"); + } time_t timestamp; long filesize; if (!read_time(&timestamp) || !read_long(&filesize)) { return fail("Corrupted archive file header");
*** 159,169 **** --- 165,194 ---- return fail("File size mismatch"); } } } break; + case PATCH_MOD: + { + GrowableArray<ModulePatchPath*>* patch_mod_args = Arguments::get_patch_mod_prefix(); + if (patch_mod_args != NULL) { + int num_of_entries = patch_mod_args->length(); + for (int i = 0; i < num_of_entries; i++) { + const char* module_name = (patch_mod_args->at(i))->module_name(); + const char* path_string = (patch_mod_args->at(i))->path_string(); + size_t n = strlen(module_name); + // path contains the module name, followed by '=', and one or more entries. + // E.g.: "java.base=foo" or "java.naming=dir1:dir2:dir3" + if ((strncmp(module_name, path, n) != 0 ) || + (path[n] != '=') || + (strcmp(path + n + 1, path_string) != 0)) { + return fail("--patch-module mismatch, path not found in run time: ", path); + } + } + } + } + break; default: return fail("Corrupted archive file header"); } return true;

src/share/vm/classfile/sharedPathsMiscInfo.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File