Package-level declarations

Types

Link copied to clipboard
class AnalysisProfile(val analyzeStdLib: Boolean)

Configures how different code sections should be analyzed. Used to control which classes should be transformed for analysis, what analysis sections should be applied, and which methods should be hidden from trace results.

Link copied to clipboard

Represents different types of analysis sections within the Lincheck framework. These sections provide various analysis guarantees and characteristics.

Link copied to clipboard
data class AtomicMethodAccessInfo(val obj: Any?, val clazz: Class<*>?, val location: ObjectAccessLocation?, val arguments: List<Any?>)
Link copied to clipboard
object ClassCache

Provides a thread-safe caching mechanism for Class lookup by its fully qualified class name.

Link copied to clipboard

Represents a set of Java Development Kit (JDK) major versions since JDK 6.

Link copied to clipboard
object Logger
Link copied to clipboard
Link copied to clipboard
class Spinner

A spinner implements utility functions for spinning in a loop.

Link copied to clipboard

Properties

Link copied to clipboard

Returns all found fields in the hierarchy. Multiple fields with the same name and the same type may be returned if they appear in the subclass and a parent class.

Link copied to clipboard
val ideaPluginEnabled: <Error class: unknown class>

This property on the top level serves as a cache. We will call ideaPluginEnabled method only once and so on the plugin side the callback will be called also only once.

Link copied to clipboard
val isInTraceDebuggerMode: <Error class: unknown class>
Link copied to clipboard
val isInTraceRecorderMode: <Error class: unknown class>
Link copied to clipboard

Indicates whether the current Java Development Kit (JDK) version is JDK 8.

Link copied to clipboard

Determines the current JDK version based on the java.specification.version system property. If the system property indicates an unsupported JDK version, an error is thrown.

Link copied to clipboard

Functions

Link copied to clipboard

Disables analysis for the current thread.

Link copied to clipboard

Enables analysis for the current thread.

Link copied to clipboard
inline fun <T> T.ensure(predicate: (T) -> Boolean): T
inline fun <T> T.ensure(predicate: (T) -> Boolean, lazyMessage: (T?) -> Any): T
Link copied to clipboard
Link copied to clipboard
fun <T> T?.ensureNull(): T?
fun <T> T?.ensureNull(lazyMessage: (T?) -> Any): T?
Link copied to clipboard
Link copied to clipboard

Enters an ignored section for the current thread.

Link copied to clipboard
fun <T> MutableList<T>.expandTo(size: Int, value: T)

Expands the list to the specified size by adding the given value to the end of the list until it reaches the target size. If the current size is already greater than or equal to the specified size, the list remains unchanged.

Link copied to clipboard
fun findFieldNameByOffsetViaUnsafe(targetType: Class<*>, offset: Long): String?
Link copied to clipboard

Finds the field name of this object that directly references the given object obj.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Creates a mutable set backed by an IdentityHashMap. This set uses identity comparisons === to determine equality of elements, rather than the equals method.

fun <T> identityHashSetOf(vararg elements: T): MutableSet<T>

Creates a mutable set backed by an IdentityHashMap, initialized with the provided elements. This set uses identity comparisons (===) to determine equality of elements, rather than the equals method.

Link copied to clipboard
infix fun Boolean.implies(other: Boolean): Boolean
infix inline fun Boolean.implies(other: () -> Boolean): Boolean
Link copied to clipboard
fun <T> List<T>.indexOf(from: Int, predicate: (T) -> Boolean): Int

Finds the index of the first element that matches the given predicate starting from the specified from index.

Link copied to clipboard
fun <T> List<T>.indexOfLast(from: Int, predicate: (T) -> Boolean): Int

Finds the index of the last element in the list that matches the given predicate, starting the search from the specified from index and moving backwards.

Link copied to clipboard
fun isIgnoredMethodHandleMethod(className: String, methodName: String): Boolean

Determines whether the specified MethodHandle method should be ignored.

Link copied to clipboard
Link copied to clipboard

Checks if the given class name belongs to the IntelliJ runtime agents.

Link copied to clipboard
fun isIntellijRuntimeCoverageAgentClass(className: String): <Error class: unknown class>

Checks if the given class name belongs to the IntelliJ runtime coverage agent package.

Link copied to clipboard
fun isIntellijRuntimeDebuggerAgentClass(className: String): <Error class: unknown class>

Checks if the given class name belongs to the IntelliJ runtime debugger agent package.

Link copied to clipboard

Test if the given class name corresponds to a Java lambda class.

Link copied to clipboard

Determines if a given class name represents a method handle related class, that is one of the following classes:

Link copied to clipboard
Link copied to clipboard

Tests if the provided className represents one of jdk internal ThreadContainer classes that use JavaLangAccess.start API to start threads.

Link copied to clipboard
Link copied to clipboard

Leaves an ignored section for the current thread.

Link copied to clipboard
fun <T> MutableList<T>.move(from: Int, to: Int)

Moves an element within the mutable list from one index to another. If the from and to indices are the same, no operation is performed.

fun <T> MutableList<T>.move(from: IntRange, to: Int)

Moves a sublist defined by the specified range of indices to a new position within the mutable list.

Link copied to clipboard
fun readArrayElementViaUnsafe(arr: Any, index: Int): Any?
Link copied to clipboard
fun readFieldSafely(obj: Any?, field: Field): Result<Any?>

Reads a field of the owner object obj via Unsafe, in case of failure fallbacks into reading the field via reflection.

Link copied to clipboard
fun readFieldViaUnsafe(obj: Any?, field: Field): Any?
inline fun <T> readFieldViaUnsafe(obj: Any?, field: Field, getter: Unsafe.(Any?, Long) -> T): T
Link copied to clipboard
fun <T> MutableList<T>.resize(size: Int, defaultValue: T)

Resizes the mutable list to the specified size. If the new size is greater than the current size, the list is expanded and the new elements are initialized to the specified default value. If the new size is less than the current size, the list is truncated.

Link copied to clipboard
inline fun <R> runInsideIgnoredSection(block: () -> R): R

Executes a given block of code within an ignored section.

Link copied to clipboard
inline fun <R> runInsideInjectedCode(block: () -> R): R?

Executes a given block of code within an injected code under condition that analysis is enabled. This method is used to account for the situation when the Main thread is finished and it wants to logically "finish" all other threads which still record some events.

inline fun runInsideInjectedCode(block: () -> Unit)
inline fun <R> runInsideInjectedCode(default: R, block: () -> R): R
Link copied to clipboard
inline fun <R> runOutsideIgnoredSection(block: () -> R): R

Exits the ignored section and invokes the provided block outside an ignored section, restoring the ignored section back after the block is executed.

Link copied to clipboard
fun SpinnerGroup(nThreads: Int): List<Spinner>

A SpinnerGroup function creates a list of spinners to be used by the specified number of threads. It provides a convenient way to manage multiple spinners together.

Link copied to clipboard
inline fun <T> Spinner.spinWaitBoundedFor(getter: () -> T?): T?

Waits for the result of the given getter function in the spin-loop until the result is not null. Exits the spin-loop after a certain number of spin-loop iterations.

Link copied to clipboard

Returns a view of the portion of this mutable list within the specified range.

Link copied to clipboard
fun <T> MutableList<T>.truncateTo(size: Int)

Truncates the mutable list to the specified size by removing all elements beyond the target size. If the current size is already less than or equal to the specified size, the list remains unchanged.

Link copied to clipboard
fun <K, V> MutableMap<K, V>.update(key: K, default: V, transform: (V) -> V): V
Link copied to clipboard
fun <K, V> MutableMap<K, V>.updateInplace(key: K, default: V, apply: V.() -> Unit)
Link copied to clipboard
fun writeArrayElementViaUnsafe(arr: Any, index: Int, value: Any?): Any?
Link copied to clipboard
fun writeFieldViaUnsafe(obj: Any?, field: Field, value: Any?)
inline fun writeFieldViaUnsafe(obj: Any?, field: Field, value: Any?, setter: Unsafe.(Any?, Long, Any?) -> Unit)