< prev index next >

test/hotspot/jtreg/runtime/HiddenClasses/GCHiddenClass.java

Print this page

        

*** 52,62 **** // A private method is great to keep hidden Class reference local to make it // GCed on the next cycle private PhantomReference<Class<?>> createClass(ReferenceQueue<Class<?>> refQueue) throws Exception { Lookup lookup = MethodHandles.lookup(); ! Class<?> cl = lookup.defineHiddenClass(klassbuf, false, NESTMATE, WEAK).lookupClass(); return new PhantomReference<Class<?>>(cl, refQueue); } public boolean run() throws Exception { ReferenceQueue<Class<?>> refQueue = new ReferenceQueue<Class<?>>(); --- 52,62 ---- // A private method is great to keep hidden Class reference local to make it // GCed on the next cycle private PhantomReference<Class<?>> createClass(ReferenceQueue<Class<?>> refQueue) throws Exception { Lookup lookup = MethodHandles.lookup(); ! Class<?> cl = lookup.defineHiddenClass(klassbuf, false, NESTMATE).lookupClass(); return new PhantomReference<Class<?>>(cl, refQueue); } public boolean run() throws Exception { ReferenceQueue<Class<?>> refQueue = new ReferenceQueue<Class<?>>();
< prev index next >