jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java
changeset 32649 2ee9017c7597
parent 31070 d6c79efc10fe
child 32986 ea54ac8672e7
equal deleted inserted replaced
32648:1fa861caf840 32649:2ee9017c7597
   438 
   438 
   439     /**
   439     /**
   440      * Use best possible cause for err.initCause(), substituting the
   440      * Use best possible cause for err.initCause(), substituting the
   441      * cause for err itself if the cause has the same (or better) type.
   441      * cause for err itself if the cause has the same (or better) type.
   442      */
   442      */
   443     static private Error initCauseFrom(Error err, Exception ex) {
   443     private static Error initCauseFrom(Error err, Exception ex) {
   444         Throwable th = ex.getCause();
   444         Throwable th = ex.getCause();
   445         if (err.getClass().isInstance(th))
   445         if (err.getClass().isInstance(th))
   446            return (Error) th;
   446            return (Error) th;
   447         err.initCause(th == null ? ex : th);
   447         err.initCause(th == null ? ex : th);
   448         return err;
   448         return err;