mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[devkit] IJPL-195964 Improve threadingModelHelper docs
GitOrigin-RevId: b1e14966cc4bc221c1b02272a1aac99236e96dfb
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f3aebf133e
commit
7c148e8d3b
+13
-18
@@ -3,31 +3,26 @@
|
||||
/**
|
||||
* <h2>Threading Model Helper</h2>
|
||||
* <p>
|
||||
* Instruments methods annotated with
|
||||
* Instruments methods (including constructors) annotated with threading annotations by inserting a call to a corresponding assertion method.
|
||||
* This call becomes the first instruction in the method's body.
|
||||
* <ul>
|
||||
* <li>{@code @RequiresEdt}
|
||||
* <li>{@code @RequiresBackgroundThread}
|
||||
* <li>{@code @RequiresReadLock}
|
||||
* <li>{@code @RequiresWriteLock}
|
||||
* <li>{@code @RequiresReadLockAbsence}
|
||||
* <li>{@code @RequiresEdt} → {@code ThreadingAssertions.assertEventDispatchThread()}
|
||||
* <li>{@code @RequiresBackgroundThread} → {@code ThreadingAssertions.assertBackgroundThread()}
|
||||
* <li>{@code @RequiresReadLock} → {@code ThreadingAssertions.assertReadAccess()}
|
||||
* <li>{@code @RequiresWriteLock} → {@code ThreadingAssertions.assertWriteAccess()}
|
||||
* <li>{@code @RequiresReadLockAbsence} → {@code Application.assertNoReadAccess()}
|
||||
* </ul>
|
||||
* by inserting
|
||||
* <ul>
|
||||
* <li>{@code ThreadingAssertions.assertEventDispatchThread()}
|
||||
* <li>{@code Application.assertIsNonDispatchThread()}
|
||||
* <li>{@code Application.assertReadAccessAllowed()}
|
||||
* <li>{@code Application.assertWriteAccessAllowed()}
|
||||
* <li>{@code Application.assertReadAccessNotAllowed()}
|
||||
* </ul>
|
||||
* calls accordingly.
|
||||
* <p>
|
||||
* To disable the instrumentation, use the {@code tmh.generate.assertions.for.annotations} key in the Registry.
|
||||
*
|
||||
* <h3>Limitations</h3>
|
||||
*
|
||||
* <ul>
|
||||
* <li>Only Java code is instrumented,
|
||||
* <li>Only Java code is instrumented.
|
||||
* <a href="https://youtrack.jetbrains.com/issue/IDEA-263465">Kotlin instrumentation is planned</a>.
|
||||
* <li>Does not instrument parameters. Consider calling the corresponding assertion method manually.</li>
|
||||
* <li>Does not instrument overriding methods. If the overriding method has the same threading contract as the supermethod,
|
||||
* annotate it again.</li>
|
||||
* <li>Does not instrument abstract methods, as there is no method body.</li>
|
||||
* </ul>
|
||||
*
|
||||
*/
|
||||
package org.jetbrains.jps.devkit.threadingModelHelper;
|
||||
Reference in New Issue
Block a user