Skip to content

Commit 5a4e1b6

Browse files
committed
Contract: improved documentation for mutates parameter; unmark it as experimental
1 parent 3d7f14f commit 5a4e1b6

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

src/commonMain/kotlin/org/jetbrains/annotations/Contract.kt

+1-2
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ expect annotation class Contract(
107107
* <tr><td>"this,param1"</td><td>Method mutates the receiver and first argument and doesn't mutate any other arguments</td></tr>
108108
</table> *
109109
*
110-
* **Warning: This annotation parameter is experimental and may be changed or removed without further notice!**
111110
* @return a mutation specifier string
112111
*/
113-
@get:ApiStatus.Experimental @get:NonNls val mutates: String = ""
112+
@get:NonNls val mutates: String = ""
114113
)

src/jvmMain/java/org/jetbrains/annotations/Contract.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,17 @@
9292
* Contains a specifier which describes which method parameters can be mutated during the method call.
9393
* <table>
9494
* <caption>Possible values:</caption>
95-
* <tr><td>"this"</td><td>Method mutates the receiver object, and doesn't mutates any objects passed as arguments (cannot be applied for static method or constructor)</td></tr>
96-
* <tr><td>"param"</td><td>Method mutates the sole argument and doesn't mutate the receiver object (if applicable)</td></tr>
95+
* <tr><td>"this"</td><td>Method mutates the receiver object, and doesn't mutate any objects passed as arguments (cannot be applied for static method or constructor)</td></tr>
96+
* <tr><td>"param"</td><td>Method mutates the sole argument and doesn't mutate the receiver object (if applicable) or anything else</td></tr>
9797
* <tr><td>"param1", "param2", ...</td><td>Method mutates the N-th argument</td></tr>
98-
* <tr><td>"this,param1"</td><td>Method mutates the receiver and first argument and doesn't mutate any other arguments</td></tr>
98+
* <tr><td>"io"</td><td>Method performs input/output changing the outer world but does not mutate any observable program state</td></tr>
99+
* <tr><td>"this,param1"</td><td>Method mutates the receiver and first argument and doesn't mutate any other arguments or observable program state</td></tr>
100+
* <tr><td>"io,this"</td><td>Method performs input/output changing the outer world and mutates the receiver, but doesn't mutate any arguments or observable program state</td></tr>
99101
* </table>
100102
*
101103
* <strong>Warning: This annotation parameter is experimental and may be changed or removed without further notice!</strong>
102104
* @return a mutation specifier string
103105
*/
104-
@ApiStatus.Experimental
105106
@NonNls
106107
String mutates() default "";
107108
}

src/nonJvmMain/kotlin/org/jetbrains/annotations/Contract.kt

+1-2
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,7 @@ actual annotation class Contract(
106106
* <tr><td>"this,param1"</td><td>Method mutates the receiver and first argument and doesn't mutate any other arguments</td></tr>
107107
</table> *
108108
*
109-
* **Warning: This annotation parameter is experimental and may be changed or removed without further notice!**
110109
* @return a mutation specifier string
111110
*/
112-
@get:ApiStatus.Experimental @get:NonNls actual val mutates: String = ""
111+
@get:NonNls actual val mutates: String = ""
113112
)

0 commit comments

Comments
 (0)