APIdia Launch Partner
Top Methods
jdk.internal.access

public Interface JavaLangAccess

Imports
java.io.InputStream, .PrintStream, java.lang.annotation.Annotation, java.lang.foreign.MemorySegment, .SymbolLookup, java.lang.invoke.MethodHandle, .MethodType, java.lang.module.ModuleDescriptor, java.lang.reflect.Executable, .Method, java.net.URI, java.nio.charset.CharacterCodingException, .Charset, java.security.ProtectionDomain, java.util.List, .Map, .Set, java.util.concurrent.ConcurrentHashMap, .Executor, .RejectedExecutionException, java.util.stream.Stream, jdk.internal.loader.NativeLibraries, jdk.internal.misc.CarrierThreadLocal, jdk.internal.module.ServicesCatalog, jdk.internal.reflect.ConstantPool, jdk.internal.vm.Continuation, .ContinuationScope, .StackableScope, .ThreadContainer, sun.reflect.annotation.AnnotationType, sun.nio.ch.Interruptible

Method Summary

Modifier and TypeMethod and Description
public void
addEnableFinalMutationToAllUnnamed()

Enable code in all unnamed modules to mutate final instance fields.

public void
addEnableNativeAccess(Module m)

Updates module m to allow access to restricted methods.

public boolean
addEnableNativeAccess(ModuleLayer layer, String name)

Updates module named name in layer layer to allow access to restricted methods.

public void
addEnableNativeAccessToAllUnnamed()

Updates all unnamed modules to allow access to restricted methods.

public void
addExports(Module m1, String pkg)

Updates module m1 to export a package unconditionally.

public void
addExports(Module m1, String pkg, Module m2)

Updates module m1 to export a package to module m2.

public void
addExportsToAllUnnamed(Module m, String pkg)

Updates a module m to export a package to all unnamed modules.

public void
addOpens(Module m1, String pkg, Module m2)

Updates module m1 to open a package to module m2.

public void
addOpensToAllUnnamed(Module m, String pkg)

Updates module m to open a package to all unnamed modules.

public void
addReads(Module m1, Module m2)

Updates the readability so that module m1 reads m2.

public void
addReadsAllUnnamed(Module m)

Updates module m to read all unnamed modules.

public void
addUses(Module m, Class<?> service)

Updates module m to use a service.

public void
bindToLoader(ModuleLayer layer, ClassLoader loader)

Record that this layer has at least one module defined to the given class loader.

public void
blockedOn(Interruptible b)

Set current thread's blocker field.

public boolean
bytesCompatible(String string, Charset charset, int srcIndex, int numChars)

Are the string bytes compatible with the given charset?

public boolean
casAnnotationType(Class<?> klass, AnnotationType oldType, AnnotationType newType)

Compare-And-Set the AnnotationType instance corresponding to this class.

public Object
public int
classFileVersion(Class<?> clazz)

Returns the big-endian packed minor-major version of the class file of this class.

public String
concat(String prefix, Object value, String suffix)

Concatenation of prefix and suffix characters to a String for early bootstrap

public void
copyToSegmentRaw(String string, MemorySegment segment, long offset, int srcIndex, int srcLength)

Copy the string bytes to an existing segment, avoiding intermediate copies.

public int
countNonZeroAscii(String s)

Count the number of leading non-zero ascii chars in the String.

public int
countPositives(byte[] ba, int off, int len)

Count the number of leading positive bytes in the range.

public ConcurrentHashMap<?, ?>
createOrGetClassLoaderValueMap(ClassLoader cl)

Returns the ConcurrentHashMap used as a storage for ClassLoaderValue(s) associated with the given class loader, creating it if it doesn't already exist.

public Thread
currentCarrierThread()

Returns the Thread object for the current platform thread.

public int

Returns:

the number of bytes successfully decoded, at most len
decodeASCII
(byte[] src, int srcOff, char[] dst, int dstOff, int len)

Decodes ASCII from the source byte array into the destination char array.

public Class<?>
defineClass(ClassLoader cl, String name, byte[] b, ProtectionDomain pd, String source)

Defines a class with the given name to a class loader.

public Class<?>
defineClass(ClassLoader cl, Class<?> lookup, String name, byte[] b, ProtectionDomain pd, boolean initialize, int flags, Object classData)

Defines a class with the given name to a class loader with the given flags and class data.

public Module
defineModule(ClassLoader loader, ModuleDescriptor descriptor, URI uri)

Defines a new module to the Java virtual machine.

public Package
definePackage(ClassLoader cl, String name, Module module)

Define a Package of the given name and module by the given class loader.

public Module
defineUnnamedModule(ClassLoader loader)

Defines the unnamed module for the given class loader.

public int

Returns:

the total number of characters successfully encoded
encodeASCII
(char[]
the source character array
sa
,
int
the index of the source array to start reading from
sp
,
byte[]
the target byte array
da
,
int
the index of the target array to start writing to
dp
,
int
the total number of characters to be encoded
len
)

Encodes as many ASCII codepoints as possible from the source character array into the destination byte array, assuming that the encoding is ASCII compatible.

public void
ensureNativeAccess(Module
the module in which native access occurred
m
,
Class<?>
the owner of the restricted method being called (or the JNI method being bound)
owner
,
String
the name of the restricted method being called (or the JNI method being bound)
methodName
,
Class<?>
the class calling the restricted method (for JNI, this is the same as owner)
currentClass
,
boolean
true, if this event is related to a JNI method being bound
jni
)

Ensure that the given module has native access.

public Class<?>
findBootstrapClassOrNull(String name)

Returns a class loaded by the bootstrap class loader.

public Method
findMethod(Class<?> klass, boolean publicOnly, String name, Class<?>... parameterTypes)

Return most specific method that matches name and parameterTypes.

public void
finishInit(StackTraceElement[] stackTrace)

Finish initialization of the StackTraceElement objects in a stack trace.

public Thread[]
getAllThreads()

Returns an array of all platform threads.

public AnnotationType
getAnnotationType(Class<?> klass)

Get the AnnotationType instance corresponding to this class.

public byte[]

Returns:

the sequence of bytes obtained by encoding the given string in UTF-8
getBytesUTF8OrThrow
(String
the string to encode
s
)

Returns the sequence of bytes obtained by encoding the given string in UTF-8.

public <T> T
getCarrierThreadLocal(CarrierThreadLocal<T> local)

Returns the value of the current carrier thread's copy of a thread-local.

public int
getClassFileAccessFlags(Class<?> klass)

Get the int value of the Class's class-file access flags.

public ConstantPool
getConstantPool(Class<?> klass)

Return the constant pool for a class.

public Continuation
getContinuation(Thread thread)

Returns the innermost mounted continuation

public Map<Class<? extends Annotation>, Annotation>
getDeclaredAnnotationMap(Class<?> klass)

Get the declared annotations for a given class, indexed by their types.

public List<Method>
getDeclaredPublicMethods(Class<?> klass, String name, Class<?>... parameterTypes)

Returns the list of Method objects for the declared public methods of this class or interface that have the specified method name and parameter types.

public <E extends Enum<E>> E[]
getEnumConstantsShared(Class<E> klass)

Returns the elements of an enum class or null if the Class object does not represent an enum type; the result is uncloned, cached, and shared by all callers.

public String
getLoaderNameID(ClassLoader loader)

Returns '<loader-name>' @<id> if classloader has a name explicitly set otherwise <qualified-class-name> @<id>

public byte[]
getRawClassAnnotations(Class<?> klass)

Get the array of bytes that is the class-file representation of this Class' annotations.

public byte[]
getRawClassTypeAnnotations(Class<?> klass)

Get the array of bytes that is the class-file representation of this Class' type annotations.

public byte[]
getRawExecutableTypeAnnotations(Executable executable)

Get the array of bytes that is the class-file representation of this Executable's type annotations.

public ServicesCatalog
getServicesCatalog(ModuleLayer layer)

Returns the ServicesCatalog for the given Layer.

public StackableScope
headStackableScope(Thread thread)

Returns the top of the given thread's stackable scope stack.

public void
inflateBytesToChars(byte[] src, int srcOff, char[] dst, int dstOff, int len)

Inflated copy from byte[] to char[], as defined by StringLatin1.inflate.

public PrintStream
initialSystemErr()

Returns the initial value of System.err.

public InputStream
initialSystemIn()

Returns the initial `System.in` to determine if it is replaced with `System.setIn(newIn)` method

public void
invokeFinalize(Object o)

Invokes the finalize method of the given object.

public boolean
isFinalMutationEnabled(Module m)

Return true if code in a given module is allowed to mutate final instance fields.

public boolean
isReflectivelyExported(Module module, String pn, Module other)

Returns true if module m reflectively exports a package to other

public boolean
isReflectivelyOpened(Module module, String pn, Module other)

Returns true if module m reflectively opens a package to other

public boolean
isStaticallyExported(Module module, String pn, Module other)

Return true if a given module has statically exported the given package to a given other module.

public boolean
isStaticallyOpened(Module module, String pn, Module other)

Return true if a given module has statically opened the given package to a given other module.

public String
join(String prefix, String suffix, String delimiter, String[] elements, int size)

Join strings

public Stream<ModuleLayer>
layers(ModuleLayer layer)

Returns an ordered stream of layers.

public Stream<ModuleLayer>
layers(ClassLoader loader)

Returns a stream of the layers that have modules defined to the given class loader.

public NativeLibraries
nativeLibrariesFor(ClassLoader loader)

Returns the NativeLibraries object associated with the provided class loader.

public long
nativeThreadID(Thread thread)

Returns the native thread ID for the given platform thread or 0 if not set.

public StackWalker
newStackWalkerInstance(Set<StackWalker.Option> options, ContinuationScope contScope, Continuation continuation)

Creates a new StackWalker

public void
parkVirtualThread()

Parks the current virtual thread.

public void
parkVirtualThread(long
the maximum number of nanoseconds to wait
nanos
)

Parks the current virtual thread for up to the given waiting time.

public ProtectionDomain
protectionDomain(Class<?> c)

Get protection domain of the given Class

public void
registerShutdownHook(int
the slot in the shutdown hook array, whose element will be invoked in order during shutdown
slot
,
boolean
true to allow the hook to be registered even if the shutdown is in progress.
registerShutdownInProgress
,
Runnable
the hook to be registered
hook
)

Registers a shutdown hook.

public void
removeCarrierThreadLocal(CarrierThreadLocal<?> local)

Removes the value of the current carrier thread's copy of a thread-local.

public Object
scopedValueBindings()

Return the current thread's scoped value bindings.

public Object[]
scopedValueCache()

Returns the current thread's scoped values cache

public <T> void
setCarrierThreadLocal(CarrierThreadLocal<T> local, T value)

Sets the value of the current carrier thread's copy of a thread-local.

public void
setCause(Throwable t, Throwable
set t's cause to new value
cause
)

Set the cause of Throwable

public void
setContinuation(Thread thread, Continuation continuation)

Sets the innermost mounted continuation

public void
setHeadStackableScope(StackableScope scope)

Sets the top of the current thread's stackable scope stack.

public void
setScopedValueCache(Object[] cache)

Sets the current thread's scoped values cache

public void
setThreadNativeID(long id)

Sets the native thread ID for the current platform thread.

public void
start(Thread thread, ThreadContainer container)

Starts a thread in the given ThreadContainer.

public byte
stringCoder(String str)

Get the Coder of String, which is used by StringConcatFactory to calculate the initCoder of constants

public MethodHandle
stringConcatHelper(String name, MethodType methodType)

Get a method handle of string concat helper method

public byte
stringInitCoder()

Get the string initial coder, When COMPACT_STRINGS is on, it returns 0, and when it is off, it returns 1.

public ThreadContainer
threadContainer(Thread thread)

Returns the ThreadContainer for a thread, may be null.

public boolean
tryEnableFinalMutation(Module m)

Enable code in a given module to mutate final instance fields.

public byte[]

Returns:

the sequence of bytes obtained by encoding the given string in the specified Charset
uncheckedGetBytesOrThrow
(String
the string to encode
s
,
Charset
the charset
cs
)

Returns the sequence of bytes obtained by encoding the given string in the specified Charset.

public char

Returns:

the char value
uncheckedGetUTF16Char
(byte[]
the UTF-16 encoded bytes
bytes
,
int
of the char to retrieve, 0 <= index < (bytes.length >> 1)
index
)

Get the char at index in a byte[] in internal UTF-16 representation.

public String

Returns:

the newly created string
uncheckedNewStringOrThrow
(byte[]
the byte array source
bytes
,
Charset
the Charset
cs
)

Constructs a new String by decoding the specified byte array using the specified Charset.

public String

Returns:

the newly created string
uncheckedNewStringWithLatin1Bytes
(byte[]
the byte array source
bytes
)

Constructs a new String with the supplied Latin1 bytes.

public void
uncheckedPutCharUTF16(byte[]
the UTF-16 encoded bytes
bytes
,
int
of the char to retrieve, 0 <= index < (bytes.length >> 1)
index
,
int ch)

Put the ch at index in a byte[] in internal UTF-16 representation.

public Object
uncheckedStringConcat1(String[] constants)

Creates helper for string concatenation.

public void
unparkVirtualThread(Thread
the virtual thread to unpark
thread
)

Re-enables a virtual thread for scheduling.

public ContinuationScope
virtualThreadContinuationScope()

The ContinuationScope of virtual thread continuations

public Executor
virtualThreadDefaultScheduler()

Returns the virtual thread default scheduler.

Method Detail

addEnableFinalMutationToAllUnnamedback to summary
public void addEnableFinalMutationToAllUnnamed()

Enable code in all unnamed modules to mutate final instance fields.

addEnableNativeAccessback to summary
public void addEnableNativeAccess(Module m)

Updates module m to allow access to restricted methods.

addEnableNativeAccessback to summary
public boolean addEnableNativeAccess(ModuleLayer layer, String name)

Updates module named name in layer layer to allow access to restricted methods. Returns true iff the given module exists in the given layer.

addEnableNativeAccessToAllUnnamedback to summary
public void addEnableNativeAccessToAllUnnamed()

Updates all unnamed modules to allow access to restricted methods.

addExportsback to summary
public void addExports(Module m1, String pkg)

Updates module m1 to export a package unconditionally.

addExportsback to summary
public void addExports(Module m1, String pkg, Module m2)

Updates module m1 to export a package to module m2. The export does not result in a strong reference to m2 (m2 can be GC'ed).

addExportsToAllUnnamedback to summary
public void addExportsToAllUnnamed(Module m, String pkg)

Updates a module m to export a package to all unnamed modules.

addOpensback to summary
public void addOpens(Module m1, String pkg, Module m2)

Updates module m1 to open a package to module m2. Opening the package does not result in a strong reference to m2 (m2 can be GC'ed).

addOpensToAllUnnamedback to summary
public void addOpensToAllUnnamed(Module m, String pkg)

Updates module m to open a package to all unnamed modules.

addReadsback to summary
public void addReads(Module m1, Module m2)

Updates the readability so that module m1 reads m2. The new read edge does not result in a strong reference to m2 (m2 can be GC'ed). This method is the same as m1.addReads(m2) but without a caller check.

addReadsAllUnnamedback to summary
public void addReadsAllUnnamed(Module m)

Updates module m to read all unnamed modules.

addUsesback to summary
public void addUses(Module m, Class<?> service)

Updates module m to use a service.

bindToLoaderback to summary
public void bindToLoader(ModuleLayer layer, ClassLoader loader)

Record that this layer has at least one module defined to the given class loader.

blockedOnback to summary
public void blockedOn(Interruptible b)

Set current thread's blocker field.

bytesCompatibleback to summary
public boolean bytesCompatible(String string, Charset charset, int srcIndex, int numChars)

Are the string bytes compatible with the given charset?

casAnnotationTypeback to summary
public boolean casAnnotationType(Class<?> klass, AnnotationType oldType, AnnotationType newType)

Compare-And-Set the AnnotationType instance corresponding to this class. (This method only applies to annotation types.)

classDataback to summary
public Object classData(Class<?> c)
classFileVersionback to summary
public int classFileVersion(Class<?> clazz)

Returns the big-endian packed minor-major version of the class file of this class.

concatback to summary
public String concat(String prefix, Object value, String suffix)

Concatenation of prefix and suffix characters to a String for early bootstrap

copyToSegmentRawback to summary
public void copyToSegmentRaw(String string, MemorySegment segment, long offset, int srcIndex, int srcLength)

Copy the string bytes to an existing segment, avoiding intermediate copies.

countNonZeroAsciiback to summary
public int countNonZeroAscii(String s)

Count the number of leading non-zero ascii chars in the String.

countPositivesback to summary
public int countPositives(byte[] ba, int off, int len)

Count the number of leading positive bytes in the range.

Implementation Specification

Implementations of this method must perform bounds checks.

createOrGetClassLoaderValueMapback to summary
public ConcurrentHashMap<?, ?> createOrGetClassLoaderValueMap(ClassLoader cl)

Returns the ConcurrentHashMap used as a storage for ClassLoaderValue(s) associated with the given class loader, creating it if it doesn't already exist.

currentCarrierThreadback to summary
public Thread currentCarrierThread()

Returns the Thread object for the current platform thread. If the current thread is a virtual thread then this method returns the carrier.

decodeASCIIback to summary
public int decodeASCII(byte[] src, int srcOff, char[] dst, int dstOff, int len)

Decodes ASCII from the source byte array into the destination char array.

Implementation Specification

Implementations of this method must perform bounds checks.

Returns:int

the number of bytes successfully decoded, at most len

defineClassback to summary
public Class<?> defineClass(ClassLoader cl, String name, byte[] b, ProtectionDomain pd, String source)

Defines a class with the given name to a class loader.

defineClassback to summary
public Class<?> defineClass(ClassLoader cl, Class<?> lookup, String name, byte[] b, ProtectionDomain pd, boolean initialize, int flags, Object classData)

Defines a class with the given name to a class loader with the given flags and class data.

See Also
java.lang.invoke.MethodHandles.Lookup#defineClass
defineModuleback to summary
public Module defineModule(ClassLoader loader, ModuleDescriptor descriptor, URI uri)

Defines a new module to the Java virtual machine. The module is defined to the given class loader. The URI is for information purposes only, it can be null.

definePackageback to summary
public Package definePackage(ClassLoader cl, String name, Module module)

Define a Package of the given name and module by the given class loader.

defineUnnamedModuleback to summary
public Module defineUnnamedModule(ClassLoader loader)

Defines the unnamed module for the given class loader.

encodeASCIIback to summary
public int encodeASCII(char[] sa, int sp, byte[] da, int dp, int len)

Encodes as many ASCII codepoints as possible from the source character array into the destination byte array, assuming that the encoding is ASCII compatible.

Parameters
sa:char[]

the source character array

sp:int

the index of the source array to start reading from

da:byte[]

the target byte array

dp:int

the index of the target array to start writing to

len:int

the total number of characters to be encoded

Returns:int

the total number of characters successfully encoded

Exceptions
NullPointerException:
if any of the provided arrays is null
ensureNativeAccessback to summary
public void ensureNativeAccess(Module m, Class<?> owner, String methodName, Class<?> currentClass, boolean jni)

Ensure that the given module has native access. If not, warn or throw exception depending on the configuration.

Parameters
m:Module

the module in which native access occurred

owner:Class<?>

the owner of the restricted method being called (or the JNI method being bound)

methodName:String

the name of the restricted method being called (or the JNI method being bound)

currentClass:Class<?>

the class calling the restricted method (for JNI, this is the same as owner)

jni:boolean

true, if this event is related to a JNI method being bound

findBootstrapClassOrNullback to summary
public Class<?> findBootstrapClassOrNull(String name)

Returns a class loaded by the bootstrap class loader.

findMethodback to summary
public Method findMethod(Class<?> klass, boolean publicOnly, String name, Class<?>... parameterTypes)

Return most specific method that matches name and parameterTypes.

finishInitback to summary
public void finishInit(StackTraceElement[] stackTrace)

Finish initialization of the StackTraceElement objects in a stack trace.

getAllThreadsback to summary
public Thread[] getAllThreads()

Returns an array of all platform threads.

getAnnotationTypeback to summary
public AnnotationType getAnnotationType(Class<?> klass)

Get the AnnotationType instance corresponding to this class. (This method only applies to annotation types.)

getBytesUTF8OrThrowback to summary
public byte[] getBytesUTF8OrThrow(String s) throws CharacterCodingException

Returns the sequence of bytes obtained by encoding the given string in UTF-8.

Parameters
s:String

the string to encode

Returns:byte[]

the sequence of bytes obtained by encoding the given string in UTF-8

Exceptions
CharacterCodingException:
For malformed input or unmappable characters
NullPointerException:
If s is null
getCarrierThreadLocalback to summary
public <T> T getCarrierThreadLocal(CarrierThreadLocal<T> local)

Returns the value of the current carrier thread's copy of a thread-local.

getClassFileAccessFlagsback to summary
public int getClassFileAccessFlags(Class<?> klass)

Get the int value of the Class's class-file access flags.

getConstantPoolback to summary
public ConstantPool getConstantPool(Class<?> klass)

Return the constant pool for a class.

getContinuationback to summary
public Continuation getContinuation(Thread thread)

Returns the innermost mounted continuation

getDeclaredAnnotationMapback to summary
public Map<Class<? extends Annotation>, Annotation> getDeclaredAnnotationMap(Class<?> klass)

Get the declared annotations for a given class, indexed by their types.

getDeclaredPublicMethodsback to summary
public List<Method> getDeclaredPublicMethods(Class<?> klass, String name, Class<?>... parameterTypes)

Returns the list of Method objects for the declared public methods of this class or interface that have the specified method name and parameter types.

getEnumConstantsSharedback to summary
public <E extends Enum<E>> E[] getEnumConstantsShared(Class<E> klass)

Returns the elements of an enum class or null if the Class object does not represent an enum type; the result is uncloned, cached, and shared by all callers.

getLoaderNameIDback to summary
public String getLoaderNameID(ClassLoader loader)

Returns '' @ if classloader has a name explicitly set otherwise @

getRawClassAnnotationsback to summary
public byte[] getRawClassAnnotations(Class<?> klass)

Get the array of bytes that is the class-file representation of this Class' annotations.

getRawClassTypeAnnotationsback to summary
public byte[] getRawClassTypeAnnotations(Class<?> klass)

Get the array of bytes that is the class-file representation of this Class' type annotations.

getRawExecutableTypeAnnotationsback to summary
public byte[] getRawExecutableTypeAnnotations(Executable executable)

Get the array of bytes that is the class-file representation of this Executable's type annotations.

getServicesCatalogback to summary
public ServicesCatalog getServicesCatalog(ModuleLayer layer)

Returns the ServicesCatalog for the given Layer.

headStackableScopeback to summary
public StackableScope headStackableScope(Thread thread)

Returns the top of the given thread's stackable scope stack.

inflateBytesToCharsback to summary
public void inflateBytesToChars(byte[] src, int srcOff, char[] dst, int dstOff, int len)

Inflated copy from byte[] to char[], as defined by StringLatin1.inflate.

Implementation Specification

Implementations of this method must perform bounds checks.

initialSystemErrback to summary
public PrintStream initialSystemErr()

Returns the initial value of System.err.

initialSystemInback to summary
public InputStream initialSystemIn()

Returns the initial `System.in` to determine if it is replaced with `System.setIn(newIn)` method

invokeFinalizeback to summary
public void invokeFinalize(Object o) throws Throwable

Invokes the finalize method of the given object.

isFinalMutationEnabledback to summary
public boolean isFinalMutationEnabled(Module m)

Return true if code in a given module is allowed to mutate final instance fields.

isReflectivelyExportedback to summary
public boolean isReflectivelyExported(Module module, String pn, Module other)

Returns true if module m reflectively exports a package to other

isReflectivelyOpenedback to summary
public boolean isReflectivelyOpened(Module module, String pn, Module other)

Returns true if module m reflectively opens a package to other

isStaticallyExportedback to summary
public boolean isStaticallyExported(Module module, String pn, Module other)

Return true if a given module has statically exported the given package to a given other module.

isStaticallyOpenedback to summary
public boolean isStaticallyOpened(Module module, String pn, Module other)

Return true if a given module has statically opened the given package to a given other module.

joinback to summary
public String join(String prefix, String suffix, String delimiter, String[] elements, int size)

Join strings

layersback to summary
public Stream<ModuleLayer> layers(ModuleLayer layer)

Returns an ordered stream of layers. The first element is the given layer, the remaining elements are its parents, in DFS order.

layersback to summary
public Stream<ModuleLayer> layers(ClassLoader loader)

Returns a stream of the layers that have modules defined to the given class loader.

nativeLibrariesForback to summary
public NativeLibraries nativeLibrariesFor(ClassLoader loader)

Returns the NativeLibraries object associated with the provided class loader. This is used by SymbolLookup#loaderLookup().

nativeThreadIDback to summary
public long nativeThreadID(Thread thread)

Returns the native thread ID for the given platform thread or 0 if not set.

newStackWalkerInstanceback to summary
public StackWalker newStackWalkerInstance(Set<StackWalker.Option> options, ContinuationScope contScope, Continuation continuation)

Creates a new StackWalker

parkVirtualThreadback to summary
public void parkVirtualThread()

Parks the current virtual thread.

Exceptions
WrongThreadException:
if the current thread is not a virtual thread
parkVirtualThreadback to summary
public void parkVirtualThread(long nanos)

Parks the current virtual thread for up to the given waiting time.

Parameters
nanos:long

the maximum number of nanoseconds to wait

Exceptions
WrongThreadException:
if the current thread is not a virtual thread
protectionDomainback to summary
public ProtectionDomain protectionDomain(Class<?> c)

Get protection domain of the given Class

registerShutdownHookback to summary
public void registerShutdownHook(int slot, boolean registerShutdownInProgress, Runnable hook)

Registers a shutdown hook. It is expected that this method with registerShutdownInProgress=true is only used to register DeleteOnExitHook since the first file may be added to the delete on exit list by the application shutdown hooks.

Parameters
slot:int

the slot in the shutdown hook array, whose element will be invoked in order during shutdown

registerShutdownInProgress:boolean

true to allow the hook to be registered even if the shutdown is in progress.

hook:Runnable

the hook to be registered

Exceptions
IllegalStateException:
if shutdown is in progress and the slot is not valid to register.
removeCarrierThreadLocalback to summary
public void removeCarrierThreadLocal(CarrierThreadLocal<?> local)

Removes the value of the current carrier thread's copy of a thread-local.

scopedValueBindingsback to summary
public Object scopedValueBindings()

Return the current thread's scoped value bindings.

scopedValueCacheback to summary
public Object[] scopedValueCache()

Returns the current thread's scoped values cache

setCarrierThreadLocalback to summary
public <T> void setCarrierThreadLocal(CarrierThreadLocal<T> local, T value)

Sets the value of the current carrier thread's copy of a thread-local.

setCauseback to summary
public void setCause(Throwable t, Throwable cause)

Set the cause of Throwable

Parameters
cause:Throwable

set t's cause to new value

setContinuationback to summary
public void setContinuation(Thread thread, Continuation continuation)

Sets the innermost mounted continuation

setHeadStackableScopeback to summary
public void setHeadStackableScope(StackableScope scope)

Sets the top of the current thread's stackable scope stack.

setScopedValueCacheback to summary
public void setScopedValueCache(Object[] cache)

Sets the current thread's scoped values cache

setThreadNativeIDback to summary
public void setThreadNativeID(long id)

Sets the native thread ID for the current platform thread.

startback to summary
public void start(Thread thread, ThreadContainer container)

Starts a thread in the given ThreadContainer.

stringCoderback to summary
public byte stringCoder(String str)

Get the Coder of String, which is used by StringConcatFactory to calculate the initCoder of constants

stringConcatHelperback to summary
public MethodHandle stringConcatHelper(String name, MethodType methodType)

Get a method handle of string concat helper method

stringInitCoderback to summary
public byte stringInitCoder()

Get the string initial coder, When COMPACT_STRINGS is on, it returns 0, and when it is off, it returns 1.

threadContainerback to summary
public ThreadContainer threadContainer(Thread thread)

Returns the ThreadContainer for a thread, may be null.

tryEnableFinalMutationback to summary
public boolean tryEnableFinalMutation(Module m)

Enable code in a given module to mutate final instance fields.

uncheckedGetBytesOrThrowback to summary
public byte[] uncheckedGetBytesOrThrow(String s, Charset cs) throws CharacterCodingException

Returns the sequence of bytes obtained by encoding the given string in the specified Charset.

Warning

This method returns the byte[] backing the provided String, if the input is ASCII. Hence, the returned byte array must not be modified.

Parameters
s:String

the string to encode

cs:Charset

the charset

Returns:byte[]

the sequence of bytes obtained by encoding the given string in the specified Charset

Exceptions
CharacterCodingException:
for malformed input or unmappable characters
NullPointerException:
If s or cs is null
uncheckedGetUTF16Charback to summary
public char uncheckedGetUTF16Char(byte[] bytes, int index)

Get the char at index in a byte[] in internal UTF-16 representation.

Warning

This method does not perform any bound checks.

Parameters
bytes:byte[]

the UTF-16 encoded bytes

index:int

of the char to retrieve, 0 <= index < (bytes.length >> 1)

Returns:char

the char value

uncheckedNewStringOrThrowback to summary
public String uncheckedNewStringOrThrow(byte[] bytes, Charset cs) throws CharacterCodingException

Constructs a new String by decoding the specified byte array using the specified Charset.

WARNING: The caller of this method shall relinquish and transfer the ownership of the byte array to the callee, since the latter will not make a copy.

Parameters
bytes:byte[]

the byte array source

cs:Charset

the Charset

Returns:String

the newly created string

Exceptions
CharacterCodingException:
for malformed or unmappable bytes
NullPointerException:
If bytes or cs is null
uncheckedNewStringWithLatin1Bytesback to summary
public String uncheckedNewStringWithLatin1Bytes(byte[] bytes)

Constructs a new String with the supplied Latin1 bytes.

WARNING: The caller of this method shall relinquish and transfer the ownership of the byte array to the callee, since the latter will not make a copy.

Parameters
bytes:byte[]

the byte array source

Returns:String

the newly created string

uncheckedPutCharUTF16back to summary
public void uncheckedPutCharUTF16(byte[] bytes, int index, int ch)

Put the ch at index in a byte[] in internal UTF-16 representation.

Warning

This method does not perform any bound checks.

Parameters
bytes:byte[]

the UTF-16 encoded bytes

index:int

of the char to retrieve, 0 <= index < (bytes.length >> 1)

uncheckedStringConcat1back to summary
public Object uncheckedStringConcat1(String[] constants)

Creates helper for string concatenation.

WARNING: The caller of this method shall relinquish and transfer the ownership of the string array to the callee, since the latter will not make a copy.

unparkVirtualThreadback to summary
public void unparkVirtualThread(Thread thread)

Re-enables a virtual thread for scheduling. If the thread was parked then it will be unblocked, otherwise its next attempt to park will not block

Parameters
thread:Thread

the virtual thread to unpark

Exceptions
IllegalArgumentException:
if the thread is not a virtual thread
RejectedExecutionException:
if the scheduler cannot accept a task
virtualThreadContinuationScopeback to summary
public ContinuationScope virtualThreadContinuationScope()

The ContinuationScope of virtual thread continuations

virtualThreadDefaultSchedulerback to summary
public Executor virtualThreadDefaultScheduler()

Returns the virtual thread default scheduler.