Move JSR-305 tests to one directory and strip common name prefix

This commit is contained in:
Denis Zharkov
2017-09-06 15:07:39 +03:00
parent 8a66919a5c
commit 02d3d9785c
94 changed files with 1006 additions and 952 deletions
@@ -0,0 +1,41 @@
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
// WARNING_FOR_JSR305_ANNOTATIONS
// FILE: A.java
public class A<T> {
public void foo(@MyNonnull T t) {
}
public @MyNullable String bar() {
return null;
}
public @MyNullable T bam() {
return null;
}
@MyNullable
public <X> X baz() {
return null;
}
}
// FILE: main.kt
class X<T>(t: T?) {
init {
val a = A<T>()
a.foo(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>t<!>)
val x: T = <!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>a.bam()<!>
val y: T = <!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>a.baz<T>()<!>
}
}
fun test() {
val a = A<String?>()
a.foo(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>)
val b: String = <!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>a.bar()<!>
}