File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed
gradle/plugins/common/src/main/kotlin
junit-platform-commons/src/main/java/org/junit/platform/commons/annotation Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,8 @@ tasks.withType<JavaCompile>().configureEach {
54
54
enable()
55
55
}
56
56
isJSpecifyMode = true
57
+ customContractAnnotations.add(" org.junit.platform.commons.annotation.Contract" )
58
+ checkContracts = true
57
59
}
58
60
}
59
61
}
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright 2015-2025 the original author or authors.
3
+ *
4
+ * All rights reserved. This program and the accompanying materials are
5
+ * made available under the terms of the Eclipse Public License v2.0 which
6
+ * accompanies this distribution and is available at
7
+ *
8
+ * https://www.eclipse.org/legal/epl-v20.html
9
+ */
10
+
11
+ package org .junit .platform .commons .annotation ;
12
+
13
+ import static org .apiguardian .api .API .Status .INTERNAL ;
14
+
15
+ import java .lang .annotation .Documented ;
16
+ import java .lang .annotation .ElementType ;
17
+ import java .lang .annotation .Target ;
18
+
19
+ import org .apiguardian .api .API ;
20
+
21
+ /**
22
+ * Specifies some aspects of the annotated method's behavior to be used by tools
23
+ * for data flow analysis.
24
+ *
25
+ * @since 6.0
26
+ * @see <a href="https://github.com/JetBrains/java-annotations/blob/2a28eab73042023559d2ec4cd00d6779213b6425/src/jvmMain/java/org/jetbrains/annotations/Contract.java">org.jetbrains.annotations.Contract</a>
27
+ * @see <a href="https://github.com/uber/NullAway/wiki/Configuration#custom-contract-annotations">NullAway custom contract annotations</a>
28
+ */
29
+ @ Documented
30
+ @ Target (ElementType .METHOD )
31
+ @ API (status = INTERNAL , since = "6.0" )
32
+ public @interface Contract {
33
+
34
+ /**
35
+ * Contains the contract clauses describing causal relations between call
36
+ * arguments and the returned value.
37
+ */
38
+ String value ();
39
+
40
+ }
You can’t perform that action at this time.
0 commit comments