From d80f69718233c484e3c1536ffb793116c1adc058 Mon Sep 17 00:00:00 2001
From: Andrey Turbanov <aturbanov@openjdk.org>
Date: Wed, 2 Mar 2022 13:05:12 +0000
Subject: [PATCH] 8282523: Fix 'hierachy' typo

Reviewed-by: jiefu, kbarrett, dholmes
---
 src/hotspot/share/classfile/systemDictionary.cpp     | 10 +++++-----
 src/hotspot/share/utilities/exceptions.hpp           |  4 ++--
 .../AbstractMethodError/AbstractMethodErrorTest.java | 12 ++++++------
 .../IncompatibleClassChangeErrorTest.java            |  8 ++++----
 .../methodPrinting/TestPrintingMethods.java          |  4 ++--
 5 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/src/hotspot/share/classfile/systemDictionary.cpp b/src/hotspot/share/classfile/systemDictionary.cpp
index ac4ad4dfbe3..c3b9b010443 100644
--- a/src/hotspot/share/classfile/systemDictionary.cpp
+++ b/src/hotspot/share/classfile/systemDictionary.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2022, 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
@@ -1559,8 +1559,8 @@ InstanceKlass* SystemDictionary::find_or_define_instance_class(Symbol* class_nam
 
 
 // ----------------------------------------------------------------------------
-// Update hierachy. This is done before the new klass has been added to the SystemDictionary. The Compile_lock
-// is held, to ensure that the compiler is not using the class hierachy, and that deoptimization will kick in
+// Update hierarchy. This is done before the new klass has been added to the SystemDictionary. The Compile_lock
+// is held, to ensure that the compiler is not using the class hierarchy, and that deoptimization will kick in
 // before a new class is used.
 
 void SystemDictionary::add_to_hierarchy(InstanceKlass* k) {
@@ -1574,7 +1574,7 @@ void SystemDictionary::add_to_hierarchy(InstanceKlass* k) {
   // The compiler reads the hierarchy outside of the Compile_lock.
   // Access ordering is used to add to hierarchy.
 
-  // Link into hierachy.
+  // Link into hierarchy.
   k->append_to_sibling_list();                    // add to superklass/sibling list
   k->process_interfaces();                        // handle all "implements" declarations
 
@@ -1724,7 +1724,7 @@ void SystemDictionary::check_constraints(unsigned int name_hash,
   }
 }
 
-// Update class loader data dictionary - done after check_constraint and add_to_hierachy
+// Update class loader data dictionary - done after check_constraint and add_to_hierarchy
 // have been called.
 void SystemDictionary::update_dictionary(unsigned int hash,
                                          InstanceKlass* k,
diff --git a/src/hotspot/share/utilities/exceptions.hpp b/src/hotspot/share/utilities/exceptions.hpp
index 1ff750c103a..a599682e25b 100644
--- a/src/hotspot/share/utilities/exceptions.hpp
+++ b/src/hotspot/share/utilities/exceptions.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2022, 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
@@ -56,7 +56,7 @@ class methodHandle;
 
 // The ThreadShadow class is a helper class to access the _pending_exception
 // field of the Thread class w/o having access to the Thread's interface (for
-// include hierachy reasons).
+// include hierarchy reasons).
 
 class ThreadShadow: public CHeapObj<mtThread> {
   friend class VMStructs;
diff --git a/test/hotspot/jtreg/runtime/exceptionMsgs/AbstractMethodError/AbstractMethodErrorTest.java b/test/hotspot/jtreg/runtime/exceptionMsgs/AbstractMethodError/AbstractMethodErrorTest.java
index 1f37ff1b830..5c88f1722f5 100644
--- a/test/hotspot/jtreg/runtime/exceptionMsgs/AbstractMethodError/AbstractMethodErrorTest.java
+++ b/test/hotspot/jtreg/runtime/exceptionMsgs/AbstractMethodError/AbstractMethodErrorTest.java
@@ -503,7 +503,7 @@ public class AbstractMethodErrorTest {
 // -------------------------------------------------------------------------
 // This error should be detected interpreted.
 //
-// Class hierachy:
+// Class hierarchy:
 //
 //            C     // interface, defines aFunctionOfMyInterface()
 //            |
@@ -619,7 +619,7 @@ class AME1_E extends AME1_B implements AME1_C {
 // -------------------------------------------------------------------------
 // This error should be detected interpreted.
 //
-// Class hierachy:
+// Class hierarchy:
 //
 //      A   // an interface declaring aFunctionOfMyInterface()
 //      |
@@ -665,7 +665,7 @@ class AME2_C extends AME2_B {
 // -----------------------------------------------------------------------
 // Test AbstractMethod error shadowing existing implementation.
 //
-// Class hierachy:
+// Class hierarchy:
 //
 //           A           // a class implementing m()
 //           |
@@ -694,7 +694,7 @@ class AME3_C extends AME3_B {
 // Test AbstractMethod error shadowing existing implementation. In
 // this test there are several subclasses of the abstract class.
 //
-// Class hierachy:
+// Class hierarchy:
 //
 //           A           // A: a class implementing ma()
 //           |
@@ -734,7 +734,7 @@ class AME4_E extends AME4_B {
 // -------------------------------------------------------------------------
 // This error should be detected while processing the vtable stub.
 //
-// Class hierachy:
+// Class hierarchy:
 //
 //              A__     // abstract
 //             /|\ \
@@ -812,7 +812,7 @@ class AME5_E extends AME5_A {
 // Test AbstractMethod error detected while processing
 // the itable stub.
 //
-// Class hierachy:
+// Class hierarchy:
 //
 //           A__   (interface)
 //          /|\ \
diff --git a/test/hotspot/jtreg/runtime/exceptionMsgs/IncompatibleClassChangeError/IncompatibleClassChangeErrorTest.java b/test/hotspot/jtreg/runtime/exceptionMsgs/IncompatibleClassChangeError/IncompatibleClassChangeErrorTest.java
index dbeae9efce2..179d7164241 100644
--- a/test/hotspot/jtreg/runtime/exceptionMsgs/IncompatibleClassChangeError/IncompatibleClassChangeErrorTest.java
+++ b/test/hotspot/jtreg/runtime/exceptionMsgs/IncompatibleClassChangeError/IncompatibleClassChangeErrorTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2018 SAP SE. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -345,7 +345,7 @@ class ImplementsSomeInterfaces extends
 
 // Helper classes to test incompatible class change in itable stub.
 //
-// Class hierachy:
+// Class hierarchy:
 //
 //          iA,iB   (interfaces)
 //          /|\ \
@@ -407,7 +407,7 @@ class ICC2_E implements ICC2_iA, ICC2_iB {
 
 // Helper classes to test error where class appears in implements statement.
 //
-// Class hierachy:
+// Class hierarchy:
 //
 //       A  Some Class.
 //       |
@@ -421,7 +421,7 @@ class ICC3_B extends ICC3_A {
 
 // Helper classes to test error where interface appears in extends statement.
 //
-// Class hierachy:
+// Class hierarchy:
 //
 //       A  Some Interface.
 //       |
diff --git a/test/hotspot/jtreg/runtime/exceptionMsgs/methodPrinting/TestPrintingMethods.java b/test/hotspot/jtreg/runtime/exceptionMsgs/methodPrinting/TestPrintingMethods.java
index 5c413b07a69..dbd089c5dc0 100644
--- a/test/hotspot/jtreg/runtime/exceptionMsgs/methodPrinting/TestPrintingMethods.java
+++ b/test/hotspot/jtreg/runtime/exceptionMsgs/methodPrinting/TestPrintingMethods.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2019 SAP SE. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -101,7 +101,7 @@ public class TestPrintingMethods {
 // -----------------------------------------------------------------------
 // Test AbstractMethod error shadowing existing implementation.
 //
-// Class hierachy:
+// Class hierarchy:
 //
 //           A           // A class implementing m() and similar.
 //           |