equal
deleted
inserted
replaced
37 import jdk.experimental.bytecode.TypedCodeBuilder; |
37 import jdk.experimental.bytecode.TypedCodeBuilder; |
38 import org.testng.Assert; |
38 import org.testng.Assert; |
39 import org.testng.annotations.BeforeClass; |
39 import org.testng.annotations.BeforeClass; |
40 import org.testng.annotations.Test; |
40 import org.testng.annotations.Test; |
41 |
41 |
42 import java.io.File; |
|
43 import java.io.FileOutputStream; |
|
44 import java.lang.invoke.MethodHandles; |
42 import java.lang.invoke.MethodHandles; |
45 import java.lang.invoke.MethodType; |
43 import java.lang.invoke.MethodType; |
46 import java.lang.reflect.InvocationTargetException; |
44 import java.lang.reflect.InvocationTargetException; |
47 import java.lang.reflect.Method; |
45 import java.lang.reflect.Method; |
48 |
46 |
215 S -> S.add(Integer.MAX_VALUE)) |
213 S -> S.add(Integer.MAX_VALUE)) |
216 .areturn() |
214 .areturn() |
217 )) |
215 )) |
218 .build(); |
216 .build(); |
219 |
217 |
220 // For debugging purposes |
|
221 new FileOutputStream(new File(genClassName + ".class")).write(byteArray); |
|
222 |
|
223 gc = MethodHandles.lookup().defineClass(byteArray); |
218 gc = MethodHandles.lookup().defineClass(byteArray); |
224 } |
219 } |
225 |
220 |
226 @Test |
221 @Test |
227 public void testPrimitives() throws Exception { |
222 public void testPrimitives() throws Exception { |