< prev index next >

src/java.base/share/classes/java/util/concurrent/SynchronousQueue.java

Print this page
8197531: Miscellaneous changes imported from jsr166 CVS 2018-04
Reviewed-by: martin, psandoz

@@ -291,11 +291,11 @@
                 try {
                     MethodHandles.Lookup l = MethodHandles.lookup();
                     SMATCH = l.findVarHandle(SNode.class, "match", SNode.class);
                     SNEXT = l.findVarHandle(SNode.class, "next", SNode.class);
                 } catch (ReflectiveOperationException e) {
-                    throw new Error(e);
+                    throw new ExceptionInInitializerError(e);
                 }
             }
         }
 
         /** The head (top) of the stack */

@@ -514,11 +514,11 @@
         static {
             try {
                 MethodHandles.Lookup l = MethodHandles.lookup();
                 SHEAD = l.findVarHandle(TransferStack.class, "head", SNode.class);
             } catch (ReflectiveOperationException e) {
-                throw new Error(e);
+                throw new ExceptionInInitializerError(e);
             }
         }
     }
 
     /** Dual Queue */

@@ -581,11 +581,11 @@
                 try {
                     MethodHandles.Lookup l = MethodHandles.lookup();
                     QITEM = l.findVarHandle(QNode.class, "item", Object.class);
                     QNEXT = l.findVarHandle(QNode.class, "next", QNode.class);
                 } catch (ReflectiveOperationException e) {
-                    throw new Error(e);
+                    throw new ExceptionInInitializerError(e);
                 }
             }
         }
 
         /** Head of queue */

@@ -828,11 +828,11 @@
                 QTAIL = l.findVarHandle(TransferQueue.class, "tail",
                                         QNode.class);
                 QCLEANME = l.findVarHandle(TransferQueue.class, "cleanMe",
                                            QNode.class);
             } catch (ReflectiveOperationException e) {
-                throw new Error(e);
+                throw new ExceptionInInitializerError(e);
             }
         }
     }
 
     /**
< prev index next >