On Thu, 18 Apr 2024 13:53:34 GMT, Oussama Louati <d...@openjdk.org> wrote:

> An indify tool in j.l.i tests (also in vmTestBase) convert some source-code 
> private static methods with MT_ MH_, and INDY_ prefixes into MethodHandle, 
> MethodType, and CallSite constants.
> It currently uses ad-hoc code to process class files and intends to migrate 
> to ASM; but since we have the Classfile API, we can migrate to Classfile API 
> instead.

test/jdk/java/lang/invoke/indify/Indify.java line 197:

> 195:                 if (err == null) {
> 196:                     err = ex;
> 197:                 }

Maybe use [Throwable​::addSuppressed​(Throwable)]:
Suggestion:

                } else if (ex != err) {
                    err.addSuppressed(ex);
                }


[Throwable​::addSuppressed​(Throwable)]: 
https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/lang/Throwable.html#addSuppressed(java.lang.Throwable)

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/18841#discussion_r1606111439

Reply via email to