< prev index next >

src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java

Print this page

        

*** 43,53 **** import java.util.concurrent.ConcurrentMap; import java.util.function.Function; import static java.lang.invoke.MethodHandles.lookup; import static java.lang.invoke.MethodType.methodType; ! import static java.lang.invoke.MethodHandleNatives.Constants.*; import static jdk.internal.org.objectweb.asm.Opcodes.*; /** * <p>Methods to facilitate the creation of String concatenation methods, that * can be used to efficiently concatenate a known number of arguments of known --- 43,53 ---- import java.util.concurrent.ConcurrentMap; import java.util.function.Function; import static java.lang.invoke.MethodHandles.lookup; import static java.lang.invoke.MethodType.methodType; ! import static java.lang.invoke.MethodHandles.Lookup.ClassOption.*; import static jdk.internal.org.objectweb.asm.Opcodes.*; /** * <p>Methods to facilitate the creation of String concatenation methods, that * can be used to efficiently concatenate a known number of arguments of known
*** 1140,1150 **** mv.visitEnd(); cw.visitEnd(); byte[] classBytes = cw.toByteArray(); try { ! Class<?> innerClass = lookup.defineHiddenClass(classBytes,true).lookupClass(); dumpIfEnabled(className, classBytes); return lookup.findStatic(innerClass, METHOD_NAME, args); } catch (Exception e) { dumpIfEnabled(className + "$$FAILED", classBytes); throw new StringConcatException("Exception while spinning the class", e); --- 1140,1150 ---- mv.visitEnd(); cw.visitEnd(); byte[] classBytes = cw.toByteArray(); try { ! Class<?> innerClass = lookup.defineHiddenClass(classBytes, true, STRONG).lookupClass(); dumpIfEnabled(className, classBytes); return lookup.findStatic(innerClass, METHOD_NAME, args); } catch (Exception e) { dumpIfEnabled(className + "$$FAILED", classBytes); throw new StringConcatException("Exception while spinning the class", e);
< prev index next >