Add tests on jsr305 annotations warnings
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import javax.annotation.*;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
import javax.annotation.meta.TypeQualifierNickname;
|
||||
import javax.annotation.meta.When;
|
||||
|
||||
@Documented
|
||||
@TypeQualifierNickname
|
||||
@Nonnull(when = When.ALWAYS)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface MyNonnull {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import javax.annotation.*;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
import javax.annotation.meta.TypeQualifierNickname;
|
||||
import javax.annotation.meta.When;
|
||||
|
||||
@Documented
|
||||
@TypeQualifierNickname
|
||||
@Nonnull(when = When.MAYBE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface MyNullable {
|
||||
|
||||
}
|
||||
compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/arithmetic.kt
Vendored
+51
@@ -0,0 +1,51 @@
|
||||
// WARNING_FOR_JSR305_ANNOTATIONS
|
||||
|
||||
// FILE: J.java
|
||||
|
||||
public class J {
|
||||
@MyNonnull
|
||||
public static Integer staticNN;
|
||||
@MyNullable
|
||||
public static Integer staticN;
|
||||
public static Integer staticJ;
|
||||
}
|
||||
|
||||
// FILE: k.kt
|
||||
|
||||
fun test() {
|
||||
var platformNN = J.staticNN
|
||||
var platformN = J.staticN
|
||||
var platformJ = J.staticJ
|
||||
|
||||
+platformNN
|
||||
+<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>platformN<!>
|
||||
+platformJ
|
||||
|
||||
++platformNN
|
||||
++<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>platformN<!>
|
||||
++platformJ
|
||||
|
||||
platformNN++
|
||||
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>platformN<!>++
|
||||
platformJ++
|
||||
|
||||
1 + platformNN
|
||||
1 + <!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>platformN<!>
|
||||
1 + platformJ
|
||||
|
||||
platformNN + 1
|
||||
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>platformN<!> + 1
|
||||
platformJ + 1
|
||||
|
||||
1 <!INFIX_MODIFIER_REQUIRED!>plus<!> platformNN
|
||||
1 <!INFIX_MODIFIER_REQUIRED!>plus<!> <!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>platformN<!>
|
||||
1 <!INFIX_MODIFIER_REQUIRED!>plus<!> platformJ
|
||||
|
||||
platformNN <!INFIX_MODIFIER_REQUIRED!>plus<!> 1
|
||||
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>platformN<!> <!INFIX_MODIFIER_REQUIRED!>plus<!> 1
|
||||
platformJ <!INFIX_MODIFIER_REQUIRED!>plus<!> 1
|
||||
|
||||
platformNN += 1
|
||||
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>platformN<!> += 1
|
||||
platformJ += 1
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package
|
||||
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
public open class J {
|
||||
public constructor J()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public final var staticJ: kotlin.Int!
|
||||
@MyNullable public final var staticN: kotlin.Int!
|
||||
@MyNonnull public final var staticNN: kotlin.Int!
|
||||
}
|
||||
Vendored
+27
@@ -0,0 +1,27 @@
|
||||
// WARNING_FOR_JSR305_ANNOTATIONS
|
||||
|
||||
// FILE: J.java
|
||||
|
||||
public class J {
|
||||
@MyNonnull
|
||||
public static Integer[] staticNN;
|
||||
@MyNullable
|
||||
public static Integer[] staticN;
|
||||
public static Integer[] staticJ;
|
||||
}
|
||||
|
||||
// FILE: k.kt
|
||||
|
||||
fun test() {
|
||||
val platformNN = J.staticNN
|
||||
val platformN = J.staticN
|
||||
val platformJ = J.staticJ
|
||||
|
||||
platformNN[0]
|
||||
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>platformN<!>[0]
|
||||
platformJ[0]
|
||||
|
||||
platformNN[0] = 1
|
||||
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>platformN<!>[0] = 1
|
||||
platformJ[0] = 1
|
||||
}
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
package
|
||||
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
public open class J {
|
||||
public constructor J()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public final var staticJ: kotlin.Array<(out) kotlin.Int!>!
|
||||
@MyNullable public final var staticN: kotlin.Array<(out) kotlin.Int!>!
|
||||
@MyNonnull public final var staticNN: kotlin.Array<(out) kotlin.Int!>!
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
// WARNING_FOR_JSR305_ANNOTATIONS
|
||||
|
||||
// FILE: J.java
|
||||
|
||||
public class J {
|
||||
@MyNonnull
|
||||
public static J staticNN;
|
||||
@MyNullable
|
||||
public static J staticN;
|
||||
public static J staticJ;
|
||||
}
|
||||
|
||||
// FILE: k.kt
|
||||
|
||||
var v: J = J()
|
||||
var n: J? = J()
|
||||
|
||||
fun test() {
|
||||
v = J.staticNN
|
||||
v = <!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>J.staticN<!>
|
||||
v = J.staticJ
|
||||
|
||||
n = J.staticNN
|
||||
n = J.staticN
|
||||
n = J.staticJ
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package
|
||||
|
||||
public var n: J?
|
||||
public var v: J
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
public open class J {
|
||||
public constructor J()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public final var staticJ: J!
|
||||
@MyNullable public final var staticN: J!
|
||||
@MyNonnull public final var staticNN: J!
|
||||
}
|
||||
compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/conditions.kt
Vendored
+44
@@ -0,0 +1,44 @@
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION
|
||||
// WARNING_FOR_JSR305_ANNOTATIONS
|
||||
|
||||
// FILE: J.java
|
||||
|
||||
public class J {
|
||||
@MyNonnull
|
||||
public static Boolean staticNN;
|
||||
@MyNullable
|
||||
public static Boolean staticN;
|
||||
public static Boolean staticJ;
|
||||
}
|
||||
|
||||
// FILE: k.kt
|
||||
|
||||
fun test() {
|
||||
val platformNN = J.staticNN
|
||||
val platformN = J.staticN
|
||||
val platformJ = J.staticJ
|
||||
|
||||
if (platformNN) {}
|
||||
if (<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS, NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>platformN<!>) {}
|
||||
if (platformJ) {}
|
||||
|
||||
while (platformNN) {}
|
||||
while (<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS, NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>platformN<!>) {}
|
||||
while (platformJ) {}
|
||||
|
||||
do {} while (platformNN)
|
||||
do {} while (<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS, NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>platformN<!>)
|
||||
do {} while (platformJ)
|
||||
|
||||
platformNN && false
|
||||
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>platformN<!> && false
|
||||
platformJ && false
|
||||
|
||||
platformNN || false
|
||||
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>platformN<!> || false
|
||||
platformJ || false
|
||||
|
||||
!platformNN
|
||||
!<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>platformN<!>
|
||||
!platformJ
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package
|
||||
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
public open class J {
|
||||
public constructor J()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public final var staticJ: kotlin.Boolean!
|
||||
@MyNullable public final var staticN: kotlin.Boolean!
|
||||
@MyNonnull public final var staticNN: kotlin.Boolean!
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// WARNING_FOR_JSR305_ANNOTATIONS
|
||||
|
||||
// FILE: J.java
|
||||
|
||||
public class J {
|
||||
@MyNonnull
|
||||
public static J staticNN;
|
||||
@MyNullable
|
||||
public static J staticN;
|
||||
}
|
||||
|
||||
// FILE: k.kt
|
||||
|
||||
fun test() {
|
||||
val n = J.staticN
|
||||
foo(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>n<!>)
|
||||
J.staticNN = <!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>n<!>
|
||||
if (n != null) {
|
||||
foo(n)
|
||||
J.staticNN = n
|
||||
}
|
||||
|
||||
val x: J? = null
|
||||
J.staticNN = <!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>x<!>
|
||||
if (x != null) {
|
||||
J.staticNN = x
|
||||
}
|
||||
}
|
||||
|
||||
fun foo(j: J) {}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package
|
||||
|
||||
public fun foo(/*0*/ j: J): kotlin.Unit
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
public open class J {
|
||||
public constructor J()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
@MyNullable public final var staticN: J!
|
||||
@MyNonnull public final var staticNN: J!
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// WARNING_FOR_JSR305_ANNOTATIONS
|
||||
|
||||
// FILE: J.java
|
||||
|
||||
public class J {
|
||||
@MyNonnull
|
||||
public static J staticNN;
|
||||
@MyNullable
|
||||
public static J staticN;
|
||||
public static J staticJ;
|
||||
}
|
||||
|
||||
// FILE: k.kt
|
||||
|
||||
fun test() {
|
||||
val platformNN = J.staticNN
|
||||
val platformN = J.staticN
|
||||
val platformJ = J.staticJ
|
||||
|
||||
fun foo(p: J = platformNN, p1: J = <!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>platformN<!>, p2: J = platformJ) {}
|
||||
|
||||
fun foo1(p: J? = platformNN, p1: J? = platformN, p2: J? = platformJ) {}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package
|
||||
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
public open class J {
|
||||
public constructor J()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public final var staticJ: J!
|
||||
@MyNullable public final var staticN: J!
|
||||
@MyNonnull public final var staticNN: J!
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
// WARNING_FOR_JSR305_ANNOTATIONS
|
||||
|
||||
// FILE: J.java
|
||||
|
||||
public class J {
|
||||
|
||||
public interface DP {
|
||||
String getValue(Object a, Object b);
|
||||
String setValue(Object a, Object b, Object c);
|
||||
}
|
||||
|
||||
@MyNonnull
|
||||
public static DP staticNN;
|
||||
@MyNullable
|
||||
public static DP staticN;
|
||||
public static DP staticJ;
|
||||
}
|
||||
|
||||
// FILE: k.kt
|
||||
|
||||
var A by J.staticNN
|
||||
var B by <!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS, NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>J.staticN<!>
|
||||
var C by J.staticJ
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package
|
||||
|
||||
public var A: kotlin.String!
|
||||
public var B: kotlin.String!
|
||||
public var C: kotlin.String!
|
||||
|
||||
public open class J {
|
||||
public constructor J()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public interface DP {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public abstract operator fun getValue(/*0*/ a: kotlin.Any!, /*1*/ b: kotlin.Any!): kotlin.String!
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public abstract operator fun setValue(/*0*/ a: kotlin.Any!, /*1*/ b: kotlin.Any!, /*2*/ c: kotlin.Any!): kotlin.String!
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
// Static members
|
||||
public final var staticJ: J.DP!
|
||||
@MyNullable public final var staticN: J.DP!
|
||||
@MyNonnull public final var staticNN: J.DP!
|
||||
}
|
||||
compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/delegation.kt
Vendored
+19
@@ -0,0 +1,19 @@
|
||||
// WARNING_FOR_JSR305_ANNOTATIONS
|
||||
|
||||
// FILE: J.java
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class J {
|
||||
@MyNonnull
|
||||
public static List<String> staticNN;
|
||||
@MyNullable
|
||||
public static List<String> staticN;
|
||||
public static List<String> staticJ;
|
||||
}
|
||||
|
||||
// FILE: k.kt
|
||||
|
||||
class A : List<String> by J.staticNN
|
||||
class B : List<String> by <!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>J.staticN<!>
|
||||
class C : List<String> by J.staticJ
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
package
|
||||
|
||||
public final class A : kotlin.collections.List<kotlin.String> {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*delegation*/ val size: kotlin.Int
|
||||
public open override /*1*/ /*delegation*/ fun contains(/*0*/ element: kotlin.String): kotlin.Boolean
|
||||
public open override /*1*/ /*delegation*/ fun containsAll(/*0*/ elements: kotlin.collections.Collection<kotlin.String>): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun forEach(/*0*/ p0: java.util.function.Consumer<in kotlin.String!>!): kotlin.Unit
|
||||
public open override /*1*/ /*delegation*/ fun get(/*0*/ index: kotlin.Int): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*delegation*/ fun indexOf(/*0*/ element: kotlin.String): kotlin.Int
|
||||
public open override /*1*/ /*delegation*/ fun isEmpty(): kotlin.Boolean
|
||||
public open override /*1*/ /*delegation*/ fun iterator(): kotlin.collections.Iterator<kotlin.String>
|
||||
public open override /*1*/ /*delegation*/ fun lastIndexOf(/*0*/ element: kotlin.String): kotlin.Int
|
||||
public open override /*1*/ /*delegation*/ fun listIterator(): kotlin.collections.ListIterator<kotlin.String>
|
||||
public open override /*1*/ /*delegation*/ fun listIterator(/*0*/ index: kotlin.Int): kotlin.collections.ListIterator<kotlin.String>
|
||||
public open override /*1*/ /*fake_override*/ fun parallelStream(): java.util.stream.Stream<kotlin.String>
|
||||
public open override /*1*/ /*fake_override*/ fun spliterator(): java.util.Spliterator<kotlin.String!>
|
||||
public open override /*1*/ /*fake_override*/ fun stream(): java.util.stream.Stream<kotlin.String>
|
||||
public open override /*1*/ /*delegation*/ fun subList(/*0*/ fromIndex: kotlin.Int, /*1*/ toIndex: kotlin.Int): kotlin.collections.List<kotlin.String>
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class B : kotlin.collections.List<kotlin.String> {
|
||||
public constructor B()
|
||||
public open override /*1*/ /*delegation*/ val size: kotlin.Int
|
||||
public open override /*1*/ /*delegation*/ fun contains(/*0*/ element: kotlin.String): kotlin.Boolean
|
||||
public open override /*1*/ /*delegation*/ fun containsAll(/*0*/ elements: kotlin.collections.Collection<kotlin.String>): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun forEach(/*0*/ p0: java.util.function.Consumer<in kotlin.String!>!): kotlin.Unit
|
||||
public open override /*1*/ /*delegation*/ fun get(/*0*/ index: kotlin.Int): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*delegation*/ fun indexOf(/*0*/ element: kotlin.String): kotlin.Int
|
||||
public open override /*1*/ /*delegation*/ fun isEmpty(): kotlin.Boolean
|
||||
public open override /*1*/ /*delegation*/ fun iterator(): kotlin.collections.Iterator<kotlin.String>
|
||||
public open override /*1*/ /*delegation*/ fun lastIndexOf(/*0*/ element: kotlin.String): kotlin.Int
|
||||
public open override /*1*/ /*delegation*/ fun listIterator(): kotlin.collections.ListIterator<kotlin.String>
|
||||
public open override /*1*/ /*delegation*/ fun listIterator(/*0*/ index: kotlin.Int): kotlin.collections.ListIterator<kotlin.String>
|
||||
public open override /*1*/ /*fake_override*/ fun parallelStream(): java.util.stream.Stream<kotlin.String>
|
||||
public open override /*1*/ /*fake_override*/ fun spliterator(): java.util.Spliterator<kotlin.String!>
|
||||
public open override /*1*/ /*fake_override*/ fun stream(): java.util.stream.Stream<kotlin.String>
|
||||
public open override /*1*/ /*delegation*/ fun subList(/*0*/ fromIndex: kotlin.Int, /*1*/ toIndex: kotlin.Int): kotlin.collections.List<kotlin.String>
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class C : kotlin.collections.List<kotlin.String> {
|
||||
public constructor C()
|
||||
public open override /*1*/ /*delegation*/ val size: kotlin.Int
|
||||
public open override /*1*/ /*delegation*/ fun contains(/*0*/ element: kotlin.String): kotlin.Boolean
|
||||
public open override /*1*/ /*delegation*/ fun containsAll(/*0*/ elements: kotlin.collections.Collection<kotlin.String>): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun forEach(/*0*/ p0: java.util.function.Consumer<in kotlin.String!>!): kotlin.Unit
|
||||
public open override /*1*/ /*delegation*/ fun get(/*0*/ index: kotlin.Int): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*delegation*/ fun indexOf(/*0*/ element: kotlin.String): kotlin.Int
|
||||
public open override /*1*/ /*delegation*/ fun isEmpty(): kotlin.Boolean
|
||||
public open override /*1*/ /*delegation*/ fun iterator(): kotlin.collections.Iterator<kotlin.String>
|
||||
public open override /*1*/ /*delegation*/ fun lastIndexOf(/*0*/ element: kotlin.String): kotlin.Int
|
||||
public open override /*1*/ /*delegation*/ fun listIterator(): kotlin.collections.ListIterator<kotlin.String>
|
||||
public open override /*1*/ /*delegation*/ fun listIterator(/*0*/ index: kotlin.Int): kotlin.collections.ListIterator<kotlin.String>
|
||||
public open override /*1*/ /*fake_override*/ fun parallelStream(): java.util.stream.Stream<kotlin.String>
|
||||
public open override /*1*/ /*fake_override*/ fun spliterator(): java.util.Spliterator<kotlin.String!>
|
||||
public open override /*1*/ /*fake_override*/ fun stream(): java.util.stream.Stream<kotlin.String>
|
||||
public open override /*1*/ /*delegation*/ fun subList(/*0*/ fromIndex: kotlin.Int, /*1*/ toIndex: kotlin.Int): kotlin.collections.List<kotlin.String>
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public open class J {
|
||||
public constructor J()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public final var staticJ: kotlin.collections.(Mutable)List<kotlin.String!>!
|
||||
@MyNullable public final var staticN: kotlin.collections.(Mutable)List<kotlin.String!>!
|
||||
@MyNonnull public final var staticNN: kotlin.collections.(Mutable)List<kotlin.String!>!
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// WARNING_FOR_JSR305_ANNOTATIONS
|
||||
|
||||
// FILE: J.java
|
||||
|
||||
public class J {
|
||||
@MyNonnull
|
||||
public static J staticNN;
|
||||
@MyNullable
|
||||
public static J staticN;
|
||||
public static J staticJ;
|
||||
}
|
||||
|
||||
// FILE: k.kt
|
||||
|
||||
fun test() {
|
||||
val platformNN = J.staticNN
|
||||
val platformN = J.staticN
|
||||
val platformJ = J.staticJ
|
||||
|
||||
platformNN.foo()
|
||||
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>platformN<!>.foo()
|
||||
platformJ.foo()
|
||||
|
||||
with(platformNN) {
|
||||
foo()
|
||||
}
|
||||
with(platformN) {
|
||||
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>foo<!>()
|
||||
}
|
||||
with(platformJ) {
|
||||
foo()
|
||||
}
|
||||
|
||||
platformNN.bar()
|
||||
platformN.bar()
|
||||
platformJ.bar()
|
||||
}
|
||||
|
||||
fun J.foo() {}
|
||||
fun J?.bar() {}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package
|
||||
|
||||
public fun test(): kotlin.Unit
|
||||
public fun J?.bar(): kotlin.Unit
|
||||
public fun J.foo(): kotlin.Unit
|
||||
|
||||
public open class J {
|
||||
public constructor J()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public final var staticJ: J!
|
||||
@MyNullable public final var staticN: J!
|
||||
@MyNonnull public final var staticNN: J!
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// WARNING_FOR_JSR305_ANNOTATIONS
|
||||
|
||||
// FILE: J.java
|
||||
|
||||
public class J {
|
||||
@MyNonnull
|
||||
public static J staticNN;
|
||||
@MyNullable
|
||||
public static J staticN;
|
||||
public static J staticJ;
|
||||
|
||||
public void foo() {}
|
||||
}
|
||||
|
||||
// FILE: k.kt
|
||||
|
||||
fun test() {
|
||||
// @NotNull platform type
|
||||
val platformNN = J.staticNN
|
||||
// @Nullable platform type
|
||||
val platformN = J.staticN
|
||||
// platform type with no annotation
|
||||
val platformJ = J.staticJ
|
||||
|
||||
platformNN.foo()
|
||||
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>platformN<!>.foo()
|
||||
platformJ.foo()
|
||||
|
||||
with(platformNN) {
|
||||
foo()
|
||||
}
|
||||
with(platformN) {
|
||||
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>foo<!>()
|
||||
}
|
||||
with(platformJ) {
|
||||
foo()
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package
|
||||
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
public open class J {
|
||||
public constructor J()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open fun foo(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public final var staticJ: J!
|
||||
@MyNullable public final var staticN: J!
|
||||
@MyNonnull public final var staticNN: J!
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
// !CHECK_TYPE
|
||||
// WARNING_FOR_JSR305_ANNOTATIONS
|
||||
|
||||
// FILE: J.java
|
||||
|
||||
public class J {
|
||||
@MyNonnull
|
||||
public static J staticNN;
|
||||
@MyNullable
|
||||
public static J staticN;
|
||||
public static J staticJ;
|
||||
}
|
||||
|
||||
// FILE: k.kt
|
||||
|
||||
fun test() {
|
||||
val platformNN = J.staticNN
|
||||
val platformN = J.staticN
|
||||
val platformJ = J.staticJ
|
||||
|
||||
checkSubtype<J>(platformNN)
|
||||
checkSubtype<J>(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>platformN<!>)
|
||||
checkSubtype<J>(platformJ)
|
||||
|
||||
checkSubtype<J?>(platformNN)
|
||||
checkSubtype<J?>(platformN)
|
||||
checkSubtype<J?>(platformJ)
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package
|
||||
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
public open class J {
|
||||
public constructor J()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public final var staticJ: J!
|
||||
@MyNullable public final var staticN: J!
|
||||
@MyNonnull public final var staticNN: J!
|
||||
}
|
||||
Vendored
+26
@@ -0,0 +1,26 @@
|
||||
// WARNING_FOR_JSR305_ANNOTATIONS
|
||||
|
||||
// FILE: J.java
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class J {
|
||||
@MyNonnull
|
||||
public static List<String> staticNN;
|
||||
@MyNullable
|
||||
public static List<String> staticN;
|
||||
public static List<String> staticJ;
|
||||
}
|
||||
|
||||
// FILE: k.kt
|
||||
|
||||
fun test() {
|
||||
val platformNN = J.staticNN
|
||||
val platformN = J.staticN
|
||||
val platformJ = J.staticJ
|
||||
|
||||
for (x in platformNN) {}
|
||||
for (x in <!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>platformN<!>) {}
|
||||
for (x in platformJ) {}
|
||||
}
|
||||
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
package
|
||||
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
public open class J {
|
||||
public constructor J()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public final var staticJ: kotlin.collections.(Mutable)List<kotlin.String!>!
|
||||
@MyNullable public final var staticN: kotlin.collections.(Mutable)List<kotlin.String!>!
|
||||
@MyNonnull public final var staticNN: kotlin.collections.(Mutable)List<kotlin.String!>!
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// WARNING_FOR_JSR305_ANNOTATIONS
|
||||
|
||||
// FILE: J.java
|
||||
|
||||
public class J {
|
||||
@MyNonnull
|
||||
public static J staticNN;
|
||||
@MyNullable
|
||||
public static J staticN;
|
||||
public static J staticJ;
|
||||
}
|
||||
|
||||
// FILE: k.kt
|
||||
|
||||
fun test() {
|
||||
foo(J.staticNN)
|
||||
foo(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>J.staticN<!>)
|
||||
foo(J.staticJ)
|
||||
|
||||
bar(J.staticNN)
|
||||
bar(J.staticN)
|
||||
bar(J.staticJ)
|
||||
}
|
||||
|
||||
fun foo(j: J) {}
|
||||
fun bar(j: J?) {}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package
|
||||
|
||||
public fun bar(/*0*/ j: J?): kotlin.Unit
|
||||
public fun foo(/*0*/ j: J): kotlin.Unit
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
public open class J {
|
||||
public constructor J()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public final var staticJ: J!
|
||||
@MyNullable public final var staticN: J!
|
||||
@MyNonnull public final var staticNN: J!
|
||||
}
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
// WARNING_FOR_JSR305_ANNOTATIONS
|
||||
|
||||
// FILE: J.java
|
||||
|
||||
public class J {
|
||||
public interface Invoke {
|
||||
void invoke();
|
||||
}
|
||||
|
||||
@MyNonnull
|
||||
public static Invoke staticNN;
|
||||
@MyNullable
|
||||
public static Invoke staticN;
|
||||
public static Invoke staticJ;
|
||||
}
|
||||
|
||||
// FILE: k.kt
|
||||
|
||||
fun test() {
|
||||
J.staticNN()
|
||||
J.<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>staticN<!>()
|
||||
J.staticJ()
|
||||
}
|
||||
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
package
|
||||
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
public open class J {
|
||||
public constructor J()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public interface Invoke {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public abstract operator fun invoke(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
// Static members
|
||||
public final var staticJ: J.Invoke!
|
||||
@MyNullable public final var staticN: J.Invoke!
|
||||
@MyNonnull public final var staticNN: J.Invoke!
|
||||
}
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// WARNING_FOR_JSR305_ANNOTATIONS
|
||||
|
||||
// KT-6829 False warning on map to @Nullable
|
||||
|
||||
// FILE: J.java
|
||||
|
||||
public class J {
|
||||
|
||||
@MyNullable
|
||||
public String method() { return ""; }
|
||||
}
|
||||
|
||||
// FILE: k.kt
|
||||
|
||||
fun foo(collection: Collection<J>) {
|
||||
val mapped = collection.map { it.method() }
|
||||
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>mapped[0]<!>.length
|
||||
}
|
||||
|
||||
public fun <T, R> Iterable<T>.map(transform: (T) -> R): List<R> {
|
||||
null!!
|
||||
}
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
package
|
||||
|
||||
public fun foo(/*0*/ collection: kotlin.collections.Collection<J>): kotlin.Unit
|
||||
public fun </*0*/ T, /*1*/ R> kotlin.collections.Iterable<T>.map(/*0*/ transform: (T) -> R): kotlin.collections.List<R>
|
||||
|
||||
public open class J {
|
||||
public constructor J()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
@MyNullable public open fun method(): kotlin.String!
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
// WARNING_FOR_JSR305_ANNOTATIONS
|
||||
|
||||
// FILE: J.java
|
||||
|
||||
public class J {
|
||||
public interface Multi {
|
||||
String component1();
|
||||
String component2();
|
||||
}
|
||||
|
||||
@MyNonnull
|
||||
public static Multi staticNN;
|
||||
@MyNullable
|
||||
public static Multi staticN;
|
||||
public static Multi staticJ;
|
||||
}
|
||||
|
||||
// FILE: k.kt
|
||||
|
||||
fun test() {
|
||||
val platformNN = J.staticNN
|
||||
val platformN = J.staticN
|
||||
val platformJ = J.staticJ
|
||||
|
||||
val (a1, b1) = platformNN
|
||||
val (a2, b2) = <!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS, NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>platformN<!>
|
||||
val (a3, b3) = platformJ
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package
|
||||
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
public open class J {
|
||||
public constructor J()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public interface Multi {
|
||||
public abstract operator fun component1(): kotlin.String!
|
||||
public abstract operator fun component2(): kotlin.String!
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
// Static members
|
||||
public final var staticJ: J.Multi!
|
||||
@MyNullable public final var staticN: J.Multi!
|
||||
@MyNonnull public final var staticNN: J.Multi!
|
||||
}
|
||||
compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/passToJava.kt
Vendored
+90
@@ -0,0 +1,90 @@
|
||||
// WARNING_FOR_JSR305_ANNOTATIONS
|
||||
|
||||
// FILE: J.java
|
||||
|
||||
|
||||
public class J {
|
||||
@MyNonnull
|
||||
public static J staticNN;
|
||||
@MyNullable
|
||||
public static J staticN;
|
||||
public static J staticJ;
|
||||
|
||||
public static void staticSet(@MyNonnull J nn, @MyNullable J n, J j) {}
|
||||
|
||||
public J(@MyNonnull J nn, @MyNullable J n, J j) {}
|
||||
public J() {}
|
||||
|
||||
@MyNonnull
|
||||
public J nn;
|
||||
@MyNullable
|
||||
public J n;
|
||||
public J j;
|
||||
|
||||
public void set(@MyNonnull J nn, @MyNullable J n, J j) {}
|
||||
}
|
||||
|
||||
// FILE: k.kt
|
||||
|
||||
fun test(n: J?, nn: J) {
|
||||
// @NotNull platform type
|
||||
val platformNN = J.staticNN
|
||||
// @Nullable platform type
|
||||
val platformN = J.staticN
|
||||
// platform type with no annotation
|
||||
val platformJ = J.staticJ
|
||||
|
||||
J.staticNN = <!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>n<!>
|
||||
J.staticNN = <!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>platformN<!>
|
||||
J.staticNN = nn
|
||||
J.staticNN = platformNN
|
||||
J.staticNN = platformJ
|
||||
|
||||
J.staticN = n
|
||||
J.staticN = platformN
|
||||
J.staticN = nn
|
||||
J.staticN = platformNN
|
||||
J.staticN = platformJ
|
||||
|
||||
J.staticJ = n
|
||||
J.staticJ = platformN
|
||||
J.staticJ = nn
|
||||
J.staticJ = platformNN
|
||||
J.staticJ = platformJ
|
||||
|
||||
J.staticSet(nn, nn, nn)
|
||||
J.staticSet(platformNN, platformNN, platformNN)
|
||||
J.staticSet(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>n<!>, n, n)
|
||||
J.staticSet(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>platformN<!>, platformN, platformN)
|
||||
J.staticSet(platformJ, platformJ, platformJ)
|
||||
|
||||
J().nn = <!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>n<!>
|
||||
J().nn = <!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>platformN<!>
|
||||
J().nn = nn
|
||||
J().nn = platformNN
|
||||
J().nn = platformJ
|
||||
|
||||
J().n = n
|
||||
J().n = platformN
|
||||
J().n = nn
|
||||
J().n = platformNN
|
||||
J().n = platformJ
|
||||
|
||||
J().j = n
|
||||
J().j = platformN
|
||||
J().j = nn
|
||||
J().j = platformNN
|
||||
J().j = platformJ
|
||||
|
||||
J().set(nn, nn, nn)
|
||||
J().set(platformNN, platformNN, platformNN)
|
||||
J().set(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>n<!>, n, n)
|
||||
J().set(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>platformN<!>, platformN, platformN)
|
||||
J().set(platformJ, platformJ, platformJ)
|
||||
|
||||
J(nn, nn, nn)
|
||||
J(platformNN, platformNN, platformNN)
|
||||
J(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>n<!>, n, n)
|
||||
J(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>platformN<!>, platformN, platformN)
|
||||
J(platformJ, platformJ, platformJ)
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package
|
||||
|
||||
public fun test(/*0*/ n: J?, /*1*/ nn: J): kotlin.Unit
|
||||
|
||||
public open class J {
|
||||
public constructor J()
|
||||
public constructor J(/*0*/ @MyNonnull nn: J!, /*1*/ @MyNullable n: J!, /*2*/ j: J!)
|
||||
public final var j: J!
|
||||
@MyNullable public final var n: J!
|
||||
@MyNonnull public final var nn: J!
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open operator fun set(/*0*/ @MyNonnull nn: J!, /*1*/ @MyNullable n: J!, /*2*/ j: J!): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public final var staticJ: J!
|
||||
@MyNullable public final var staticN: J!
|
||||
@MyNonnull public final var staticNN: J!
|
||||
public open fun staticSet(/*0*/ @MyNonnull nn: J!, /*1*/ @MyNullable n: J!, /*2*/ j: J!): kotlin.Unit
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
// WARNING_FOR_JSR305_ANNOTATIONS
|
||||
|
||||
// FILE: J.java
|
||||
|
||||
public class J {
|
||||
@MyNonnull
|
||||
public static int[] staticNN;
|
||||
@MyNullable
|
||||
public static int[] staticN;
|
||||
public static int[] staticJ;
|
||||
}
|
||||
|
||||
// FILE: k.kt
|
||||
|
||||
fun test() {
|
||||
val platformNN = J.staticNN
|
||||
val platformN = J.staticN
|
||||
val platformJ = J.staticJ
|
||||
|
||||
platformNN[0]
|
||||
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>platformN<!>[0]
|
||||
platformJ[0]
|
||||
|
||||
platformNN[0] = 1
|
||||
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>platformN<!>[0] = 1
|
||||
platformJ[0] = 1
|
||||
}
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package
|
||||
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
public open class J {
|
||||
public constructor J()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public final var staticJ: kotlin.IntArray!
|
||||
@MyNullable public final var staticN: kotlin.IntArray!
|
||||
@MyNonnull public final var staticNN: kotlin.IntArray!
|
||||
}
|
||||
Vendored
+25
@@ -0,0 +1,25 @@
|
||||
// WARNING_FOR_JSR305_ANNOTATIONS
|
||||
|
||||
// FILE: J.java
|
||||
|
||||
public class J {
|
||||
@MyNonnull
|
||||
public static Exception staticNN;
|
||||
@MyNullable
|
||||
public static Exception staticN;
|
||||
public static Exception staticJ;
|
||||
}
|
||||
|
||||
// FILE: k.kt
|
||||
|
||||
fun test() {
|
||||
throw J.staticNN
|
||||
}
|
||||
|
||||
fun test1() {
|
||||
throw <!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>J.staticN<!>
|
||||
}
|
||||
|
||||
fun test2() {
|
||||
throw J.staticJ
|
||||
}
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
package
|
||||
|
||||
public fun test(): kotlin.Unit
|
||||
public fun test1(): kotlin.Unit
|
||||
public fun test2(): kotlin.Unit
|
||||
|
||||
public open class J {
|
||||
public constructor J()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public final var staticJ: java.lang.Exception!
|
||||
@MyNullable public final var staticN: java.lang.Exception!
|
||||
@MyNonnull public final var staticNN: java.lang.Exception!
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// WARNING_FOR_JSR305_ANNOTATIONS
|
||||
|
||||
// FILE: J.java
|
||||
|
||||
public class J {
|
||||
@MyNullable
|
||||
public static J staticN;
|
||||
}
|
||||
|
||||
// FILE: JJ.java
|
||||
|
||||
public class JJ {
|
||||
public static JJ staticNN;
|
||||
}
|
||||
|
||||
// FILE: JJJ.java
|
||||
|
||||
public class JJJ {
|
||||
@MyNonnull
|
||||
public static JJJ staticNNN;
|
||||
}
|
||||
|
||||
// FILE: k.kt
|
||||
|
||||
fun test() {
|
||||
val a = J.staticN ?: null
|
||||
foo(a)
|
||||
val b = JJ.staticNN ?: null
|
||||
foo(b)
|
||||
val c = JJJ.staticNNN ?: <!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>
|
||||
foo(c)
|
||||
}
|
||||
|
||||
fun foo(a: Any?) {
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package
|
||||
|
||||
public fun foo(/*0*/ a: kotlin.Any?): kotlin.Unit
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
public open class J {
|
||||
public constructor J()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
@MyNullable public final var staticN: J!
|
||||
}
|
||||
|
||||
public open class JJ {
|
||||
public constructor JJ()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public final var staticNN: JJ!
|
||||
}
|
||||
|
||||
public open class JJJ {
|
||||
public constructor JJJ()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
@MyNonnull public final var staticNNN: JJJ!
|
||||
}
|
||||
Vendored
+41
@@ -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()<!>
|
||||
}
|
||||
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
package
|
||||
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
public open class A</*0*/ T : kotlin.Any!> {
|
||||
public constructor A</*0*/ T : kotlin.Any!>()
|
||||
@MyNullable public open fun bam(): T!
|
||||
@MyNullable public open fun bar(): kotlin.String!
|
||||
@MyNullable public open fun </*0*/ X : kotlin.Any!> baz(): X!
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open fun foo(/*0*/ @MyNonnull t: T!): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class X</*0*/ T> {
|
||||
public constructor X</*0*/ T>(/*0*/ t: T?)
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Vendored
+69
@@ -0,0 +1,69 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
|
||||
// WARNING_FOR_JSR305_ANNOTATIONS
|
||||
|
||||
// FILE: MyNullable.java
|
||||
import javax.annotation.*;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
import javax.annotation.meta.TypeQualifierNickname;
|
||||
import javax.annotation.meta.When;
|
||||
|
||||
@Documented
|
||||
@TypeQualifierNickname
|
||||
@Nonnull(when = When.MAYBE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface MyNullable {
|
||||
|
||||
}
|
||||
|
||||
// FILE: MyNonnull.java
|
||||
import javax.annotation.*;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
import javax.annotation.meta.TypeQualifierNickname;
|
||||
import javax.annotation.meta.When;
|
||||
|
||||
@Documented
|
||||
@TypeQualifierNickname
|
||||
@Nonnull(when = When.ALWAYS)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface MyNonnull {
|
||||
|
||||
}
|
||||
|
||||
// FILE: A.java
|
||||
|
||||
import javax.annotation.*;
|
||||
|
||||
public class A {
|
||||
@MyNullable public String field = null;
|
||||
|
||||
@MyNullable
|
||||
public String foo(@MyNonnull String x, @MyNullable CharSequence y) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@MyNonnull
|
||||
public String bar() {
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
fun main(a: A) {
|
||||
a.foo("", null)?.length
|
||||
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>a.foo("", null)<!>.length
|
||||
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>a.foo(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>, "")<!>.length
|
||||
|
||||
a.bar().length
|
||||
a.bar()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
|
||||
|
||||
a.field?.length
|
||||
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>a.field<!>.length
|
||||
}
|
||||
Vendored
+27
@@ -0,0 +1,27 @@
|
||||
package
|
||||
|
||||
public fun main(/*0*/ a: A): kotlin.Unit
|
||||
|
||||
public open class A {
|
||||
public constructor A()
|
||||
@MyNullable public final var field: kotlin.String!
|
||||
@MyNonnull public open fun bar(): kotlin.String!
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
@MyNullable public open fun foo(/*0*/ @MyNonnull x: kotlin.String!, /*1*/ @MyNullable y: kotlin.CharSequence!): kotlin.String!
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.annotation.MustBeDocumented @javax.annotation.meta.TypeQualifierNickname @javax.annotation.Nonnull(when = When.ALWAYS) @kotlin.annotation.Retention(value = AnnotationRetention.RUNTIME) public final annotation class MyNonnull : kotlin.Annotation {
|
||||
public constructor MyNonnull()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.annotation.MustBeDocumented @javax.annotation.meta.TypeQualifierNickname @javax.annotation.Nonnull(when = When.MAYBE) @kotlin.annotation.Retention(value = AnnotationRetention.RUNTIME) public final annotation class MyNullable : kotlin.Annotation {
|
||||
public constructor MyNullable()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
|
||||
// WARNING_FOR_JSR305_ANNOTATIONS
|
||||
|
||||
// FILE: A.java
|
||||
|
||||
import javax.annotation.*;
|
||||
|
||||
public class A {
|
||||
@Nullable public String field = null;
|
||||
|
||||
@Nullable
|
||||
public String foo(@Nonnull String x, @CheckForNull CharSequence y) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public String bar() {
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
fun main(a: A) {
|
||||
a.foo("", null)?.length
|
||||
a.foo("", null)<!UNSAFE_CALL!>.<!>length
|
||||
a.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>, "")<!UNSAFE_CALL!>.<!>length
|
||||
|
||||
a.bar().length
|
||||
a.bar()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
|
||||
|
||||
a.field?.length
|
||||
a.field<!UNSAFE_CALL!>.<!>length
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package
|
||||
|
||||
public fun main(/*0*/ a: A): kotlin.Unit
|
||||
|
||||
public open class A {
|
||||
public constructor A()
|
||||
@javax.annotation.Nullable public final var field: kotlin.String?
|
||||
@javax.annotation.Nonnull public open fun bar(): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
@javax.annotation.Nullable public open fun foo(/*0*/ @javax.annotation.Nonnull x: kotlin.String, /*1*/ @javax.annotation.CheckForNull y: kotlin.CharSequence?): kotlin.String?
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
|
||||
// WARNING_FOR_JSR305_ANNOTATIONS
|
||||
|
||||
// FILE: A.java
|
||||
|
||||
import javax.annotation.*;
|
||||
import javax.annotation.meta.*;
|
||||
|
||||
public class A {
|
||||
@Nonnull(when=When.UNKNOWN) public String field = null;
|
||||
|
||||
@Nonnull(when=When.MAYBE)
|
||||
public String foo(@Nonnull(when=When.ALWAYS) String x, @Nonnull(when=When.NEVER) CharSequence y) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public String bar() {
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
fun main(a: A) {
|
||||
a.foo("", null)?.length
|
||||
a.foo("", null)<!UNSAFE_CALL!>.<!>length
|
||||
a.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>, "")<!UNSAFE_CALL!>.<!>length
|
||||
|
||||
a.bar().length
|
||||
a.bar()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
|
||||
|
||||
a.field?.length
|
||||
a.field.length
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package
|
||||
|
||||
public fun main(/*0*/ a: A): kotlin.Unit
|
||||
|
||||
public open class A {
|
||||
public constructor A()
|
||||
@javax.annotation.Nonnull(when = When.UNKNOWN) public final var field: kotlin.String!
|
||||
@javax.annotation.Nonnull public open fun bar(): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
@javax.annotation.Nonnull(when = When.MAYBE) public open fun foo(/*0*/ @javax.annotation.Nonnull(when = When.ALWAYS) x: kotlin.String, /*1*/ @javax.annotation.Nonnull(when = When.NEVER) y: kotlin.CharSequence!): kotlin.String?
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
|
||||
// WARNING_FOR_JSR305_ANNOTATIONS
|
||||
|
||||
// FILE: FieldsAreNullable.java
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.CheckForNull;
|
||||
import javax.annotation.meta.TypeQualifierDefault;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@CheckForNull
|
||||
@TypeQualifierDefault({ElementType.FIELD})
|
||||
public @interface FieldsAreNullable {
|
||||
}
|
||||
|
||||
// FILE: A.java
|
||||
|
||||
import javax.annotation.*;
|
||||
|
||||
@FieldsAreNullable
|
||||
public class A {
|
||||
public String field = null;
|
||||
@Nonnull
|
||||
public String nonNullField = "";
|
||||
|
||||
public String foo(String q, @Nonnull String x, @CheckForNull CharSequence y) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public String bar() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
fun main(a: A) {
|
||||
// foo is platform
|
||||
a.foo("", "", null)?.length
|
||||
a.foo("", "", null).length
|
||||
a.foo(null, <!NULL_FOR_NONNULL_TYPE!>null<!>, "").length
|
||||
|
||||
a.bar().length
|
||||
a.bar()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
|
||||
|
||||
a.field?.length
|
||||
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>a.field<!>.length
|
||||
a.field = null
|
||||
|
||||
a.nonNullField<!UNNECESSARY_SAFE_CALL!>?.<!>length
|
||||
a.nonNullField.length
|
||||
a.nonNullField = <!NULL_FOR_NONNULL_TYPE!>null<!>
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package
|
||||
|
||||
public fun main(/*0*/ a: A): kotlin.Unit
|
||||
|
||||
@FieldsAreNullable public open class A {
|
||||
public constructor A()
|
||||
public final var field: kotlin.String!
|
||||
@javax.annotation.Nonnull public final var nonNullField: kotlin.String
|
||||
@javax.annotation.Nonnull public open fun bar(): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open fun foo(/*0*/ q: kotlin.String!, /*1*/ @javax.annotation.Nonnull x: kotlin.String, /*2*/ @javax.annotation.CheckForNull y: kotlin.CharSequence?): kotlin.String!
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.annotation.Retention(value = AnnotationRetention.RUNTIME) @kotlin.annotation.MustBeDocumented @javax.annotation.CheckForNull @javax.annotation.meta.TypeQualifierDefault(value = {ElementType.FIELD}) public final annotation class FieldsAreNullable : kotlin.Annotation {
|
||||
public constructor FieldsAreNullable()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+159
@@ -0,0 +1,159 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
|
||||
// WARNING_FOR_JSR305_ANNOTATIONS
|
||||
|
||||
// FILE: NonNullApi.java
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.meta.TypeQualifierDefault;
|
||||
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Nonnull
|
||||
@TypeQualifierDefault({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD})
|
||||
public @interface NonNullApi {
|
||||
}
|
||||
|
||||
// FILE: NullableApi.java
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import javax.annotation.CheckForNull;
|
||||
import javax.annotation.meta.TypeQualifierDefault;
|
||||
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@CheckForNull
|
||||
@TypeQualifierDefault({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD})
|
||||
public @interface NullableApi {
|
||||
}
|
||||
|
||||
// FILE: A.java
|
||||
|
||||
import javax.annotation.CheckForNull;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@NonNullApi
|
||||
public class A {
|
||||
public String foo1(String x) { return ""; }
|
||||
public String foo2(String x) { return ""; }
|
||||
public String foo3(String x) { return ""; }
|
||||
|
||||
|
||||
@Nullable
|
||||
public String bar1(@Nullable String x) { return ""; }
|
||||
@Nullable
|
||||
public String bar2(@Nullable String x) { return ""; }
|
||||
|
||||
public String baz(@Nonnull String x) { return ""; }
|
||||
}
|
||||
|
||||
// FILE: AInt.java
|
||||
|
||||
import javax.annotation.CheckForNull;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@NonNullApi
|
||||
public interface AInt {
|
||||
public CharSequence foo1(String x);
|
||||
public CharSequence foo2(String x);
|
||||
public CharSequence foo3(String x);
|
||||
|
||||
|
||||
@Nullable
|
||||
public CharSequence bar1(@Nullable String x);
|
||||
@Nullable
|
||||
public CharSequence bar2(@Nullable String x);
|
||||
|
||||
public CharSequence baz(@Nonnull String x);
|
||||
}
|
||||
|
||||
|
||||
// FILE: B.java
|
||||
|
||||
import javax.annotation.CheckForNull;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@NullableApi
|
||||
public class B extends A implements AInt {
|
||||
// conflicts
|
||||
public String foo1(String x) { return ""; }
|
||||
|
||||
// no conflicts
|
||||
@Nonnull
|
||||
public String foo2(@Nonnull String x) { return ""; }
|
||||
|
||||
// fake override for foo3 shouldn't have any conflicts
|
||||
|
||||
// no conflicts
|
||||
public String bar1(String x) { return ""; }
|
||||
|
||||
// conflicts
|
||||
public String baz(String x) { return ""; }
|
||||
}
|
||||
|
||||
// FILE: C.java
|
||||
|
||||
import javax.annotation.CheckForNull;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@NonNullApi
|
||||
public class C extends A implements AInt {
|
||||
// no conflicts
|
||||
public String foo1(String x) { return ""; }
|
||||
|
||||
// no conflicts
|
||||
public String foo2(@Nonnull String x) { return ""; }
|
||||
|
||||
// fake override for foo3 shouldn't have any conflicts
|
||||
|
||||
// no conflicts, covariant override
|
||||
public String bar1(String x) { return ""; }
|
||||
// no conflicts
|
||||
@Nullable
|
||||
public String bar2(@Nullable String x) { return ""; }
|
||||
|
||||
// no conflicts
|
||||
public String baz(String x) { return ""; }
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
fun main(a: A, b: B, c: C) {
|
||||
a.foo1(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>).length
|
||||
a.foo2(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>).length
|
||||
a.foo3(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>).length
|
||||
a.bar1(null)<!UNSAFE_CALL!>.<!>length
|
||||
a.bar2(null)<!UNSAFE_CALL!>.<!>length
|
||||
a.baz(<!NULL_FOR_NONNULL_TYPE!>null<!>).length
|
||||
|
||||
b.foo1(null).length
|
||||
b.foo1(null)?.length
|
||||
b.foo2(<!NULL_FOR_NONNULL_TYPE!>null<!>).length
|
||||
b.foo3(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>).length
|
||||
b.bar1(null)<!UNSAFE_CALL!>.<!>length
|
||||
b.bar2(null)<!UNSAFE_CALL!>.<!>length
|
||||
b.baz(<!NULL_FOR_NONNULL_TYPE!>null<!>).length
|
||||
b.baz(<!NULL_FOR_NONNULL_TYPE!>null<!>)?.length
|
||||
|
||||
c.foo1(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>).length
|
||||
c.foo2(<!NULL_FOR_NONNULL_TYPE!>null<!>).length
|
||||
c.foo3(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>).length
|
||||
c.bar1(null)<!UNSAFE_CALL!>.<!>length
|
||||
c.bar1(null)?.length
|
||||
c.bar2(null)<!UNSAFE_CALL!>.<!>length
|
||||
c.baz(<!NULL_FOR_NONNULL_TYPE!>null<!>).length
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package
|
||||
|
||||
public fun main(/*0*/ a: A, /*1*/ b: B, /*2*/ c: C): kotlin.Unit
|
||||
|
||||
@NonNullApi public open class A {
|
||||
public constructor A()
|
||||
@javax.annotation.Nullable public open fun bar1(/*0*/ @javax.annotation.Nullable x: kotlin.String?): kotlin.String?
|
||||
@javax.annotation.Nullable public open fun bar2(/*0*/ @javax.annotation.Nullable x: kotlin.String?): kotlin.String?
|
||||
public open fun baz(/*0*/ @javax.annotation.Nonnull x: kotlin.String): kotlin.String!
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open fun foo1(/*0*/ x: kotlin.String!): kotlin.String!
|
||||
public open fun foo2(/*0*/ x: kotlin.String!): kotlin.String!
|
||||
public open fun foo3(/*0*/ x: kotlin.String!): kotlin.String!
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@NonNullApi public interface AInt {
|
||||
@javax.annotation.Nullable public abstract fun bar1(/*0*/ @javax.annotation.Nullable x: kotlin.String?): kotlin.CharSequence?
|
||||
@javax.annotation.Nullable public abstract fun bar2(/*0*/ @javax.annotation.Nullable x: kotlin.String?): kotlin.CharSequence?
|
||||
public abstract fun baz(/*0*/ @javax.annotation.Nonnull x: kotlin.String): kotlin.CharSequence!
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public abstract fun foo1(/*0*/ x: kotlin.String!): kotlin.CharSequence!
|
||||
public abstract fun foo2(/*0*/ x: kotlin.String!): kotlin.CharSequence!
|
||||
public abstract fun foo3(/*0*/ x: kotlin.String!): kotlin.CharSequence!
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@NullableApi public open class B : A, AInt {
|
||||
public constructor B()
|
||||
public open override /*2*/ fun bar1(/*0*/ x: kotlin.String?): kotlin.String?
|
||||
@javax.annotation.Nullable public open override /*2*/ /*fake_override*/ fun bar2(/*0*/ @javax.annotation.Nullable x: kotlin.String?): kotlin.String?
|
||||
public open override /*2*/ fun baz(/*0*/ x: kotlin.String): kotlin.String!
|
||||
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*2*/ fun foo1(/*0*/ x: kotlin.String!): kotlin.String!
|
||||
@javax.annotation.Nonnull public open override /*2*/ fun foo2(/*0*/ @javax.annotation.Nonnull x: kotlin.String): kotlin.String
|
||||
public open override /*2*/ /*fake_override*/ fun foo3(/*0*/ x: kotlin.String!): kotlin.String!
|
||||
public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@NonNullApi public open class C : A, AInt {
|
||||
public constructor C()
|
||||
public open override /*2*/ fun bar1(/*0*/ x: kotlin.String?): kotlin.String?
|
||||
@javax.annotation.Nullable public open override /*2*/ fun bar2(/*0*/ @javax.annotation.Nullable x: kotlin.String?): kotlin.String?
|
||||
public open override /*2*/ fun baz(/*0*/ x: kotlin.String): kotlin.String!
|
||||
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*2*/ fun foo1(/*0*/ x: kotlin.String!): kotlin.String!
|
||||
public open override /*2*/ fun foo2(/*0*/ @javax.annotation.Nonnull x: kotlin.String): kotlin.String!
|
||||
public open override /*2*/ /*fake_override*/ fun foo3(/*0*/ x: kotlin.String!): kotlin.String!
|
||||
public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS, AnnotationTarget.FILE}) @kotlin.annotation.Retention(value = AnnotationRetention.RUNTIME) @kotlin.annotation.MustBeDocumented @javax.annotation.Nonnull @javax.annotation.meta.TypeQualifierDefault(value = {ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD}) public final annotation class NonNullApi : kotlin.Annotation {
|
||||
public constructor NonNullApi()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS, AnnotationTarget.FILE}) @kotlin.annotation.Retention(value = AnnotationRetention.RUNTIME) @kotlin.annotation.MustBeDocumented @javax.annotation.CheckForNull @javax.annotation.meta.TypeQualifierDefault(value = {ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD}) public final annotation class NullableApi : kotlin.Annotation {
|
||||
public constructor NullableApi()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+185
@@ -0,0 +1,185 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
|
||||
// WARNING_FOR_JSR305_ANNOTATIONS
|
||||
|
||||
// FILE: NonNullApi.java
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.meta.TypeQualifierDefault;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Nonnull
|
||||
@TypeQualifierDefault({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD})
|
||||
public @interface NonNullApi {
|
||||
}
|
||||
|
||||
// FILE: NullableApi.java
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import javax.annotation.CheckForNull;
|
||||
import javax.annotation.meta.TypeQualifierDefault;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@CheckForNull
|
||||
@TypeQualifierDefault({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD})
|
||||
public @interface NullableApi {
|
||||
}
|
||||
|
||||
// FILE: FieldsAreNullable.java
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.CheckForNull;
|
||||
import javax.annotation.meta.TypeQualifierDefault;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@CheckForNull
|
||||
@TypeQualifierDefault({ElementType.FIELD})
|
||||
public @interface FieldsAreNullable {
|
||||
}
|
||||
|
||||
// FILE: A.java
|
||||
|
||||
import javax.annotation.CheckForNull;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@NonNullApi
|
||||
public class A {
|
||||
public String field = null;
|
||||
|
||||
public String foo(String x, @CheckForNull CharSequence y) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@NullableApi
|
||||
public String foobar(String x, @Nonnull CharSequence y) {
|
||||
return "";
|
||||
}
|
||||
|
||||
public String bar() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public java.util.List<String> baz() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@NullableApi
|
||||
public class B {
|
||||
public String field = null;
|
||||
|
||||
public String foo(String x, @Nonnull CharSequence y) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@NonNullApi
|
||||
public String foobar(String x, @Nullable CharSequence y) {
|
||||
return "";
|
||||
}
|
||||
|
||||
public String bar() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public java.util.List<String> baz() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@FieldsAreNullable
|
||||
public class C {
|
||||
public String field = null;
|
||||
|
||||
public String foo(String x, @Nullable CharSequence y) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@NullableApi
|
||||
public String foobar(String x, @Nullable CharSequence y) {
|
||||
return "";
|
||||
}
|
||||
|
||||
public String bar() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public java.util.List<String> baz() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
fun main(a: A, b: A.B, c: A.C) {
|
||||
a.foo("", null)<!UNNECESSARY_SAFE_CALL!>?.<!>length
|
||||
a.foo("", null).length
|
||||
a.foo(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>, "").length
|
||||
|
||||
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>a.foobar(null, "")<!>.length
|
||||
a.foobar("", <!NULL_FOR_NONNULL_TYPE!>null<!>)?.length
|
||||
|
||||
a.bar().length
|
||||
a.bar()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
|
||||
|
||||
a.field<!UNNECESSARY_SAFE_CALL!>?.<!>length
|
||||
a.field.length
|
||||
|
||||
a.baz()<!UNSAFE_CALL!>.<!>get(0)
|
||||
a.baz()!!.get(0).get(0)
|
||||
a.baz()!!.get(0)?.get(0)
|
||||
|
||||
// b
|
||||
b.foo("", <!NULL_FOR_NONNULL_TYPE!>null<!>)?.length
|
||||
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>b.foo("", <!NULL_FOR_NONNULL_TYPE!>null<!>)<!>.length
|
||||
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>b.foo(null, "")<!>.length
|
||||
|
||||
b.foobar(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>, "").length
|
||||
b.foobar("", null)<!UNNECESSARY_SAFE_CALL!>?.<!>length
|
||||
|
||||
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>b.bar()<!>.length
|
||||
b.bar()!!.length
|
||||
|
||||
b.field?.length
|
||||
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>b.field<!>.length
|
||||
|
||||
b.baz()<!UNSAFE_CALL!>.<!>get(0)
|
||||
b.baz()!!.get(0).get(0)
|
||||
b.baz()!!.get(0)?.get(0)
|
||||
|
||||
// c
|
||||
c.foo("", null)<!UNNECESSARY_SAFE_CALL!>?.<!>length
|
||||
c.foo("", null).length
|
||||
c.foo(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>, "").length
|
||||
|
||||
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>c.foobar(null, "")<!>.length
|
||||
c.foobar("", null)?.length
|
||||
|
||||
c.bar().length
|
||||
c.bar()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
|
||||
|
||||
c.field?.length
|
||||
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>c.field<!>.length
|
||||
|
||||
c.baz()<!UNSAFE_CALL!>.<!>get(0)
|
||||
c.baz()!!.get(0).get(0)
|
||||
c.baz()!!.get(0)?.get(0)
|
||||
}
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
package
|
||||
|
||||
public fun main(/*0*/ a: A, /*1*/ b: A.B, /*2*/ c: A.C): kotlin.Unit
|
||||
|
||||
@NonNullApi public open class A {
|
||||
public constructor A()
|
||||
public final var field: kotlin.String!
|
||||
public open fun bar(): kotlin.String!
|
||||
@javax.annotation.Nullable public open fun baz(): kotlin.collections.(Mutable)List<kotlin.String!>?
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open fun foo(/*0*/ x: kotlin.String!, /*1*/ @javax.annotation.CheckForNull y: kotlin.CharSequence?): kotlin.String!
|
||||
@NullableApi public open fun foobar(/*0*/ x: kotlin.String!, /*1*/ @javax.annotation.Nonnull y: kotlin.CharSequence): kotlin.String!
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
@NullableApi public open inner class B {
|
||||
public constructor B()
|
||||
public final var field: kotlin.String!
|
||||
public open fun bar(): kotlin.String!
|
||||
@javax.annotation.Nullable public open fun baz(): kotlin.collections.(Mutable)List<kotlin.String!>?
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open fun foo(/*0*/ x: kotlin.String!, /*1*/ @javax.annotation.Nonnull y: kotlin.CharSequence): kotlin.String!
|
||||
@NonNullApi public open fun foobar(/*0*/ x: kotlin.String!, /*1*/ @javax.annotation.Nullable y: kotlin.CharSequence?): kotlin.String!
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@FieldsAreNullable public open inner class C {
|
||||
public constructor C()
|
||||
public final var field: kotlin.String!
|
||||
public open fun bar(): kotlin.String!
|
||||
@javax.annotation.Nullable public open fun baz(): kotlin.collections.(Mutable)List<kotlin.String!>?
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open fun foo(/*0*/ x: kotlin.String!, /*1*/ @javax.annotation.Nullable y: kotlin.CharSequence?): kotlin.String!
|
||||
@NullableApi public open fun foobar(/*0*/ x: kotlin.String!, /*1*/ @javax.annotation.Nullable y: kotlin.CharSequence?): kotlin.String!
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
@kotlin.annotation.Retention(value = AnnotationRetention.RUNTIME) @kotlin.annotation.MustBeDocumented @javax.annotation.CheckForNull @javax.annotation.meta.TypeQualifierDefault(value = {ElementType.FIELD}) public final annotation class FieldsAreNullable : kotlin.Annotation {
|
||||
public constructor FieldsAreNullable()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.annotation.Retention(value = AnnotationRetention.RUNTIME) @kotlin.annotation.MustBeDocumented @javax.annotation.Nonnull @javax.annotation.meta.TypeQualifierDefault(value = {ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD}) public final annotation class NonNullApi : kotlin.Annotation {
|
||||
public constructor NonNullApi()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.annotation.Retention(value = AnnotationRetention.RUNTIME) @kotlin.annotation.MustBeDocumented @javax.annotation.CheckForNull @javax.annotation.meta.TypeQualifierDefault(value = {ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD}) public final annotation class NullableApi : kotlin.Annotation {
|
||||
public constructor NullableApi()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
|
||||
// WARNING_FOR_JSR305_ANNOTATIONS
|
||||
|
||||
// FILE: A.java
|
||||
|
||||
import javax.annotation.*;
|
||||
|
||||
@ParametersAreNonnullByDefault
|
||||
public class A {
|
||||
@Nullable public String field = null;
|
||||
|
||||
public String foo(String q, @Nonnull String x, @CheckForNull CharSequence y) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public String bar() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
fun main(a: A) {
|
||||
// foo is platform
|
||||
a.foo("", "", null)?.length
|
||||
a.foo("", "", null).length
|
||||
a.foo(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>, <!NULL_FOR_NONNULL_TYPE!>null<!>, "").length
|
||||
|
||||
a.bar().length
|
||||
a.bar()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
|
||||
|
||||
a.field?.length
|
||||
a.field<!UNSAFE_CALL!>.<!>length
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package
|
||||
|
||||
public fun main(/*0*/ a: A): kotlin.Unit
|
||||
|
||||
@javax.annotation.ParametersAreNonnullByDefault public open class A {
|
||||
public constructor A()
|
||||
@javax.annotation.Nullable public final var field: kotlin.String?
|
||||
@javax.annotation.Nonnull public open fun bar(): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open fun foo(/*0*/ q: kotlin.String!, /*1*/ @javax.annotation.Nonnull x: kotlin.String, /*2*/ @javax.annotation.CheckForNull y: kotlin.CharSequence?): kotlin.String!
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
|
||||
// RENDER_PACKAGE: test
|
||||
// RENDER_PACKAGE: test2
|
||||
// WARNING_FOR_JSR305_ANNOTATIONS
|
||||
|
||||
// FILE: test/package-info.java
|
||||
|
||||
@javax.annotation.ParametersAreNonnullByDefault()
|
||||
package test;
|
||||
|
||||
// FILE: test/A.java
|
||||
|
||||
package test;
|
||||
|
||||
import javax.annotation.*;
|
||||
|
||||
public class A {
|
||||
@Nullable public String field = null;
|
||||
|
||||
public String foo(String q, @Nonnull String x, @CheckForNull CharSequence y) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public String bar() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: test2/A2.java
|
||||
|
||||
package test2;
|
||||
|
||||
import javax.annotation.*;
|
||||
|
||||
public class A2 {
|
||||
@Nullable public String field = null;
|
||||
|
||||
public String foo(String q, @Nonnull String x, @CheckForNull CharSequence y) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public String bar() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
import test.A
|
||||
import test2.A2
|
||||
|
||||
fun main(a: A, a2: A2) {
|
||||
a.foo("", "", null)?.length
|
||||
a.foo("", "", null).length
|
||||
a.foo(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>, <!NULL_FOR_NONNULL_TYPE!>null<!>, "").length
|
||||
|
||||
a.bar().length
|
||||
a.bar()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
|
||||
|
||||
a.field?.length
|
||||
a.field<!UNSAFE_CALL!>.<!>length
|
||||
|
||||
a2.foo("", "", null)?.length
|
||||
a2.foo("", "", null).length
|
||||
a2.foo(null, <!NULL_FOR_NONNULL_TYPE!>null<!>, "").length
|
||||
|
||||
a2.bar().length
|
||||
a2.bar()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
|
||||
|
||||
a2.field?.length
|
||||
a2.field<!UNSAFE_CALL!>.<!>length
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package test
|
||||
|
||||
public open class A {
|
||||
public constructor A()
|
||||
@javax.annotation.Nullable public final var field: kotlin.String?
|
||||
@javax.annotation.Nonnull public open fun bar(): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open fun foo(/*0*/ q: kotlin.String!, /*1*/ @javax.annotation.Nonnull x: kotlin.String, /*2*/ @javax.annotation.CheckForNull y: kotlin.CharSequence?): kotlin.String!
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
package test2
|
||||
|
||||
public open class A2 {
|
||||
public constructor A2()
|
||||
@javax.annotation.Nullable public final var field: kotlin.String?
|
||||
@javax.annotation.Nonnull public open fun bar(): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open fun foo(/*0*/ q: kotlin.String!, /*1*/ @javax.annotation.Nonnull x: kotlin.String, /*2*/ @javax.annotation.CheckForNull y: kotlin.CharSequence?): kotlin.String!
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
package
|
||||
|
||||
public fun main(/*0*/ a: test.A, /*1*/ a2: test2.A2): kotlin.Unit
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
|
||||
// WARNING_FOR_JSR305_ANNOTATIONS
|
||||
|
||||
// FILE: spr/Nullable.java
|
||||
|
||||
package spr;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.meta.TypeQualifierNickname;
|
||||
import javax.annotation.meta.When;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Nonnull(when = When.MAYBE)
|
||||
@TypeQualifierNickname
|
||||
public @interface Nullable {
|
||||
}
|
||||
|
||||
// FILE: spr/NonNullApi.java
|
||||
|
||||
package spr;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.meta.TypeQualifierDefault;
|
||||
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Nonnull
|
||||
@TypeQualifierDefault({ElementType.METHOD, ElementType.PARAMETER})
|
||||
public @interface NonNullApi {
|
||||
}
|
||||
|
||||
// FILE: A.java
|
||||
|
||||
import spr.*;
|
||||
|
||||
@NonNullApi
|
||||
public class A {
|
||||
public String field = null;
|
||||
|
||||
public String foo(String x, @Nullable CharSequence y) {
|
||||
return "";
|
||||
}
|
||||
|
||||
public String bar() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public java.util.List<String> baz() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
fun main(a: A) {
|
||||
a.foo("", null)<!UNNECESSARY_SAFE_CALL!>?.<!>length
|
||||
a.foo("", null).length
|
||||
a.foo(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>, "").length
|
||||
|
||||
a.bar().length
|
||||
a.bar()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
|
||||
|
||||
a.field?.length
|
||||
a.field.length
|
||||
|
||||
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>a.baz()<!>.get(0)
|
||||
a.baz()!!.get(0).get(0)
|
||||
a.baz()!!.get(0)?.get(0)
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package
|
||||
|
||||
public fun main(/*0*/ a: A): kotlin.Unit
|
||||
|
||||
@spr.NonNullApi public open class A {
|
||||
public constructor A()
|
||||
public final var field: kotlin.String!
|
||||
public open fun bar(): kotlin.String!
|
||||
@spr.Nullable public open fun baz(): kotlin.collections.(Mutable)List<kotlin.String!>!
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open fun foo(/*0*/ x: kotlin.String!, /*1*/ @spr.Nullable y: kotlin.CharSequence!): kotlin.String!
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
|
||||
// RENDER_PACKAGE: test
|
||||
// WARNING_FOR_JSR305_ANNOTATIONS
|
||||
|
||||
// FILE: spr/Nullable.java
|
||||
|
||||
package spr;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.meta.TypeQualifierNickname;
|
||||
import javax.annotation.meta.When;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Nonnull(when = When.MAYBE)
|
||||
@TypeQualifierNickname
|
||||
public @interface Nullable {
|
||||
}
|
||||
|
||||
// FILE: spr/NonNullApi.java
|
||||
|
||||
package spr;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.meta.TypeQualifierDefault;
|
||||
|
||||
@Target(ElementType.PACKAGE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Nonnull
|
||||
@TypeQualifierDefault({ElementType.METHOD, ElementType.PARAMETER})
|
||||
public @interface NonNullApi {
|
||||
}
|
||||
|
||||
// FILE: test/package-info.java
|
||||
|
||||
@spr.NonNullApi()
|
||||
package test;
|
||||
|
||||
// FILE: test/A.java
|
||||
|
||||
package test;
|
||||
|
||||
import spr.*;
|
||||
|
||||
public class A {
|
||||
public String field = null;
|
||||
|
||||
public String foo(String x, @Nullable CharSequence y) {
|
||||
return "";
|
||||
}
|
||||
|
||||
public String bar() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public java.util.List<String> baz() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
fun main(a: test.A) {
|
||||
a.foo("", null)<!UNNECESSARY_SAFE_CALL!>?.<!>length
|
||||
a.foo("", null).length
|
||||
a.foo(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>, "").length
|
||||
|
||||
a.bar().length
|
||||
a.bar()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
|
||||
|
||||
a.field?.length
|
||||
a.field.length
|
||||
|
||||
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>a.baz()<!>.get(0)
|
||||
a.baz()!!.get(0).get(0)
|
||||
a.baz()!!.get(0)?.get(0)
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package test
|
||||
|
||||
public open class A {
|
||||
public constructor A()
|
||||
public final var field: kotlin.String!
|
||||
public open fun bar(): kotlin.String!
|
||||
@spr.Nullable public open fun baz(): kotlin.collections.(Mutable)List<kotlin.String!>!
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open fun foo(/*0*/ x: kotlin.String!, /*1*/ @spr.Nullable y: kotlin.CharSequence!): kotlin.String!
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
package
|
||||
|
||||
public fun main(/*0*/ a: test.A): kotlin.Unit
|
||||
+213
@@ -90,6 +90,219 @@ public class ForeignAnnotationsNoAnnotationInClasspathTestGenerated extends Abst
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Jsr305NullabilityWarnings extends AbstractForeignAnnotationsNoAnnotationInClasspathTest {
|
||||
public void testAllFilesPresentInJsr305NullabilityWarnings() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("jsr305NullabilityGenerics.kt")
|
||||
public void testJsr305NullabilityGenerics() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/jsr305NullabilityGenerics.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("jsr305NullabilityNicknames.kt")
|
||||
public void testJsr305NullabilityNicknames() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/jsr305NullabilityNicknames.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("jsr305Simple.kt")
|
||||
public void testJsr305Simple() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/jsr305Simple.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("jsr305Strange.kt")
|
||||
public void testJsr305Strange() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/jsr305Strange.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class FromPlatformTypes extends AbstractForeignAnnotationsNoAnnotationInClasspathTest {
|
||||
public void testAllFilesPresentInFromPlatformTypes() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("arithmetic.kt")
|
||||
public void testArithmetic() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/arithmetic.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("array.kt")
|
||||
public void testArray() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/array.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("assignToVar.kt")
|
||||
public void testAssignToVar() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/assignToVar.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("conditions.kt")
|
||||
public void testConditions() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/conditions.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("dataFlowInfo.kt")
|
||||
public void testDataFlowInfo() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/dataFlowInfo.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("defaultParameters.kt")
|
||||
public void testDefaultParameters() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/defaultParameters.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("delegatedProperties.kt")
|
||||
public void testDelegatedProperties() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/delegatedProperties.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("delegation.kt")
|
||||
public void testDelegation() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/delegation.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("derefenceExtension.kt")
|
||||
public void testDerefenceExtension() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/derefenceExtension.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("derefenceMember.kt")
|
||||
public void testDerefenceMember() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/derefenceMember.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("expectedType.kt")
|
||||
public void testExpectedType() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/expectedType.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("for.kt")
|
||||
public void testFor() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/for.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("functionArguments.kt")
|
||||
public void testFunctionArguments() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/functionArguments.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("invoke.kt")
|
||||
public void testInvoke() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/invoke.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt6829.kt")
|
||||
public void testKt6829() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/kt6829.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("multiDeclaration.kt")
|
||||
public void testMultiDeclaration() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/multiDeclaration.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("passToJava.kt")
|
||||
public void testPassToJava() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/passToJava.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("primitiveArray.kt")
|
||||
public void testPrimitiveArray() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/primitiveArray.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("throw.kt")
|
||||
public void testThrow() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/throw.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("uselessElvisRightIsNull.kt")
|
||||
public void testUselessElvisRightIsNull() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/uselessElvisRightIsNull.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/typeQualifierDefault")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class TypeQualifierDefault extends AbstractForeignAnnotationsNoAnnotationInClasspathTest {
|
||||
public void testAllFilesPresentInTypeQualifierDefault() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("fieldsAreNullable.kt")
|
||||
public void testFieldsAreNullable() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/typeQualifierDefault/fieldsAreNullable.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("nullabilityFromOverridden.kt")
|
||||
public void testNullabilityFromOverridden() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/typeQualifierDefault/nullabilityFromOverridden.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("overridingDefaultQualifier.kt")
|
||||
public void testOverridingDefaultQualifier() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/typeQualifierDefault/overridingDefaultQualifier.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("parametersAreNonnullByDefault.kt")
|
||||
public void testParametersAreNonnullByDefault() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefault.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("parametersAreNonnullByDefaultPackage.kt")
|
||||
public void testParametersAreNonnullByDefaultPackage() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefaultPackage.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("springNullable.kt")
|
||||
public void testSpringNullable() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/typeQualifierDefault/springNullable.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("springNullablePackage.kt")
|
||||
public void testSpringNullablePackage() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/typeQualifierDefault/springNullablePackage.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/foreignAnnotations/tests/typeQualifierDefault")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
+213
@@ -90,6 +90,219 @@ public class ForeignAnnotationsNoAnnotationInClasspathWithFastClassReadingTestGe
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Jsr305NullabilityWarnings extends AbstractForeignAnnotationsNoAnnotationInClasspathWithFastClassReadingTest {
|
||||
public void testAllFilesPresentInJsr305NullabilityWarnings() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("jsr305NullabilityGenerics.kt")
|
||||
public void testJsr305NullabilityGenerics() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/jsr305NullabilityGenerics.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("jsr305NullabilityNicknames.kt")
|
||||
public void testJsr305NullabilityNicknames() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/jsr305NullabilityNicknames.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("jsr305Simple.kt")
|
||||
public void testJsr305Simple() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/jsr305Simple.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("jsr305Strange.kt")
|
||||
public void testJsr305Strange() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/jsr305Strange.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class FromPlatformTypes extends AbstractForeignAnnotationsNoAnnotationInClasspathWithFastClassReadingTest {
|
||||
public void testAllFilesPresentInFromPlatformTypes() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("arithmetic.kt")
|
||||
public void testArithmetic() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/arithmetic.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("array.kt")
|
||||
public void testArray() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/array.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("assignToVar.kt")
|
||||
public void testAssignToVar() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/assignToVar.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("conditions.kt")
|
||||
public void testConditions() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/conditions.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("dataFlowInfo.kt")
|
||||
public void testDataFlowInfo() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/dataFlowInfo.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("defaultParameters.kt")
|
||||
public void testDefaultParameters() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/defaultParameters.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("delegatedProperties.kt")
|
||||
public void testDelegatedProperties() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/delegatedProperties.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("delegation.kt")
|
||||
public void testDelegation() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/delegation.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("derefenceExtension.kt")
|
||||
public void testDerefenceExtension() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/derefenceExtension.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("derefenceMember.kt")
|
||||
public void testDerefenceMember() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/derefenceMember.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("expectedType.kt")
|
||||
public void testExpectedType() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/expectedType.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("for.kt")
|
||||
public void testFor() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/for.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("functionArguments.kt")
|
||||
public void testFunctionArguments() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/functionArguments.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("invoke.kt")
|
||||
public void testInvoke() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/invoke.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt6829.kt")
|
||||
public void testKt6829() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/kt6829.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("multiDeclaration.kt")
|
||||
public void testMultiDeclaration() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/multiDeclaration.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("passToJava.kt")
|
||||
public void testPassToJava() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/passToJava.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("primitiveArray.kt")
|
||||
public void testPrimitiveArray() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/primitiveArray.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("throw.kt")
|
||||
public void testThrow() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/throw.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("uselessElvisRightIsNull.kt")
|
||||
public void testUselessElvisRightIsNull() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/uselessElvisRightIsNull.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/typeQualifierDefault")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class TypeQualifierDefault extends AbstractForeignAnnotationsNoAnnotationInClasspathWithFastClassReadingTest {
|
||||
public void testAllFilesPresentInTypeQualifierDefault() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("fieldsAreNullable.kt")
|
||||
public void testFieldsAreNullable() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/typeQualifierDefault/fieldsAreNullable.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("nullabilityFromOverridden.kt")
|
||||
public void testNullabilityFromOverridden() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/typeQualifierDefault/nullabilityFromOverridden.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("overridingDefaultQualifier.kt")
|
||||
public void testOverridingDefaultQualifier() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/typeQualifierDefault/overridingDefaultQualifier.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("parametersAreNonnullByDefault.kt")
|
||||
public void testParametersAreNonnullByDefault() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefault.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("parametersAreNonnullByDefaultPackage.kt")
|
||||
public void testParametersAreNonnullByDefaultPackage() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefaultPackage.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("springNullable.kt")
|
||||
public void testSpringNullable() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/typeQualifierDefault/springNullable.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("springNullablePackage.kt")
|
||||
public void testSpringNullablePackage() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/typeQualifierDefault/springNullablePackage.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/foreignAnnotations/tests/typeQualifierDefault")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
@@ -90,6 +90,219 @@ public class ForeignAnnotationsTestGenerated extends AbstractForeignAnnotationsT
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Jsr305NullabilityWarnings extends AbstractForeignAnnotationsTest {
|
||||
public void testAllFilesPresentInJsr305NullabilityWarnings() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("jsr305NullabilityGenerics.kt")
|
||||
public void testJsr305NullabilityGenerics() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/jsr305NullabilityGenerics.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("jsr305NullabilityNicknames.kt")
|
||||
public void testJsr305NullabilityNicknames() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/jsr305NullabilityNicknames.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("jsr305Simple.kt")
|
||||
public void testJsr305Simple() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/jsr305Simple.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("jsr305Strange.kt")
|
||||
public void testJsr305Strange() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/jsr305Strange.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class FromPlatformTypes extends AbstractForeignAnnotationsTest {
|
||||
public void testAllFilesPresentInFromPlatformTypes() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("arithmetic.kt")
|
||||
public void testArithmetic() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/arithmetic.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("array.kt")
|
||||
public void testArray() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/array.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("assignToVar.kt")
|
||||
public void testAssignToVar() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/assignToVar.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("conditions.kt")
|
||||
public void testConditions() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/conditions.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("dataFlowInfo.kt")
|
||||
public void testDataFlowInfo() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/dataFlowInfo.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("defaultParameters.kt")
|
||||
public void testDefaultParameters() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/defaultParameters.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("delegatedProperties.kt")
|
||||
public void testDelegatedProperties() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/delegatedProperties.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("delegation.kt")
|
||||
public void testDelegation() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/delegation.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("derefenceExtension.kt")
|
||||
public void testDerefenceExtension() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/derefenceExtension.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("derefenceMember.kt")
|
||||
public void testDerefenceMember() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/derefenceMember.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("expectedType.kt")
|
||||
public void testExpectedType() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/expectedType.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("for.kt")
|
||||
public void testFor() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/for.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("functionArguments.kt")
|
||||
public void testFunctionArguments() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/functionArguments.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("invoke.kt")
|
||||
public void testInvoke() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/invoke.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt6829.kt")
|
||||
public void testKt6829() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/kt6829.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("multiDeclaration.kt")
|
||||
public void testMultiDeclaration() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/multiDeclaration.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("passToJava.kt")
|
||||
public void testPassToJava() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/passToJava.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("primitiveArray.kt")
|
||||
public void testPrimitiveArray() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/primitiveArray.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("throw.kt")
|
||||
public void testThrow() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/throw.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("uselessElvisRightIsNull.kt")
|
||||
public void testUselessElvisRightIsNull() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/fromPlatformTypes/uselessElvisRightIsNull.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/typeQualifierDefault")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class TypeQualifierDefault extends AbstractForeignAnnotationsTest {
|
||||
public void testAllFilesPresentInTypeQualifierDefault() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("fieldsAreNullable.kt")
|
||||
public void testFieldsAreNullable() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/typeQualifierDefault/fieldsAreNullable.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("nullabilityFromOverridden.kt")
|
||||
public void testNullabilityFromOverridden() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/typeQualifierDefault/nullabilityFromOverridden.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("overridingDefaultQualifier.kt")
|
||||
public void testOverridingDefaultQualifier() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/typeQualifierDefault/overridingDefaultQualifier.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("parametersAreNonnullByDefault.kt")
|
||||
public void testParametersAreNonnullByDefault() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefault.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("parametersAreNonnullByDefaultPackage.kt")
|
||||
public void testParametersAreNonnullByDefaultPackage() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefaultPackage.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("springNullable.kt")
|
||||
public void testSpringNullable() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/typeQualifierDefault/springNullable.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("springNullablePackage.kt")
|
||||
public void testSpringNullablePackage() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/typeQualifierDefault/springNullablePackage.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/foreignAnnotations/tests/typeQualifierDefault")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
Reference in New Issue
Block a user