From 57616e2a5600acfbea258e353fecf1c2607df140 Mon Sep 17 00:00:00 2001 From: Volker Berlin Date: Mon, 1 May 2023 14:07:47 +0200 Subject: [PATCH] replace Java 11 forName() with Module parameter --- .../module/nativecode/ReplacementForClass.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/de/inetsoftware/jwebassembly/module/nativecode/ReplacementForClass.java b/src/de/inetsoftware/jwebassembly/module/nativecode/ReplacementForClass.java index 6df3c9e..87459f3 100644 --- a/src/de/inetsoftware/jwebassembly/module/nativecode/ReplacementForClass.java +++ b/src/de/inetsoftware/jwebassembly/module/nativecode/ReplacementForClass.java @@ -1,5 +1,5 @@ /* - Copyright 2020 - 2022 Volker Berlin (i-net software) + Copyright 2020 - 2023 Volker Berlin (i-net software) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -205,6 +205,20 @@ class ReplacementForClass { return forName( name ); } + /** + * Replacement of the Java 9 method forName(Module,String) + * + * @param module + * the module + * @param name + * the fully qualified name of the desired class. + * @return the {@code Class} object for the class with the specified name. + */ + @Replace( "java/lang/Class.forName(Ljava/lang/Module;Ljava/lang/String;)Ljava/lang/Class;" ) + public static Class forName( Object module, String name ) { + return null; + } + /** * Replacement of the Java method newInstance() *