mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-25 01:19:02 +00:00
This change allows the Kotlin compiler to type check methods annotated with the org.elasticsearch.common.Nullable annotation in Elasticsearch Java APIs as described in: https://kotlinlang.org/docs/reference/java-interop.html#jsr-305-support. (cherry picked from commit 0d0485ad9cf10e16b75b862b023b42827c375599)
This commit is contained in:
parent
21971feae8
commit
a89860160b
@ -73,6 +73,9 @@ publishing {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// This dependency is used only by :libs:core for null-checking interop with other tools
|
||||
compileOnly "com.google.code.findbugs:jsr305:3.0.2"
|
||||
|
||||
testCompile "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}"
|
||||
testCompile "junit:junit:${versions.junit}"
|
||||
testCompile "org.hamcrest:hamcrest:${versions.hamcrest}"
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package org.elasticsearch.common;
|
||||
|
||||
import javax.annotation.CheckForNull;
|
||||
import javax.annotation.meta.TypeQualifierNickname;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
@ -33,6 +35,8 @@ import java.lang.annotation.Target;
|
||||
*
|
||||
*/
|
||||
@Documented
|
||||
@TypeQualifierNickname
|
||||
@CheckForNull
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.PARAMETER, ElementType.FIELD, ElementType.METHOD})
|
||||
public @interface Nullable {
|
||||
|
Loading…
x
Reference in New Issue
Block a user