8171042: The 'REQUIRED' type in sharedPathsMiscInfo.hpp is not used and should be removed.
authorjiangli
Wed, 05 Apr 2017 18:15:09 -0400
changeset 46365 d79745f72ae6
parent 46363 b53de34a044c
child 46366 b9a1aa504eb5
8171042: The 'REQUIRED' type in sharedPathsMiscInfo.hpp is not used and should be removed. Summary: Remove unused REQUIRED type. Reviewed-by: dholmes, iklam
hotspot/src/share/vm/classfile/sharedPathsMiscInfo.cpp
hotspot/src/share/vm/classfile/sharedPathsMiscInfo.hpp
--- a/hotspot/src/share/vm/classfile/sharedPathsMiscInfo.cpp	Wed Apr 05 01:11:25 2017 +0000
+++ b/hotspot/src/share/vm/classfile/sharedPathsMiscInfo.cpp	Wed Apr 05 18:15:09 2017 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -83,9 +83,6 @@
   case NON_EXIST:
     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;
   default:
     ShouldNotReachHere();
   }
@@ -130,37 +127,13 @@
       return fail("[BOOT classpath mismatch, actual =", Arguments::get_sysclasspath());
     }
     break;
-  case NON_EXIST: // fall-through
-  case REQUIRED:
+  case NON_EXIST:
     {
       struct stat st;
-      if (os::stat(path, &st) != 0) {
-        // The file does not actually exist
-        if (type == REQUIRED) {
-          // but we require it to exist -> fail
-          return fail("Required file doesn't exist");
-        }
-      } else {
+      if (os::stat(path, &st) == 0) {
         // 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_IFMT) != S_IFREG) {
-          return fail("Did not get a regular file as expected.");
-        }
-        time_t    timestamp;
-        long      filesize;
-
-        if (!read_time(&timestamp) || !read_long(&filesize)) {
-          return fail("Corrupted archive file header");
-        }
-        if (timestamp != st.st_mtime) {
-          return fail("Timestamp mismatch");
-        }
-        if (filesize != st.st_size) {
-          return fail("File size mismatch");
-        }
+        // But we want it to not exist -> fail
+        return fail("File must not exist");
       }
     }
     break;
--- a/hotspot/src/share/vm/classfile/sharedPathsMiscInfo.hpp	Wed Apr 05 01:11:25 2017 +0000
+++ b/hotspot/src/share/vm/classfile/sharedPathsMiscInfo.hpp	Wed Apr 05 18:15:09 2017 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -128,15 +128,13 @@
 
   enum {
     BOOT      = 1,
-    NON_EXIST = 2,
-    REQUIRED  = 3
+    NON_EXIST = 2
   };
 
   virtual const char* type_name(int type) {
     switch (type) {
     case BOOT:      return "BOOT";
     case NON_EXIST: return "NON_EXIST";
-    case REQUIRED:  return "REQUIRED";
     default:        ShouldNotReachHere(); return "?";
     }
   }