[FIR-TEST] Move analysis tests to separate module
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
@R|java/lang/annotation/Documented|() @R|javax/annotation/meta/TypeQualifierNickname|() @R|javax/annotation/Nonnull|(R|javax/annotation/meta/When.NEVER|()) @R|java/lang/annotation/Retention|(R|java/lang/annotation/RetentionPolicy.RUNTIME|()) public abstract annotation class MyNullable : R|kotlin/Annotation| {
|
||||
}
|
||||
public open class NonNullNever : R|kotlin/Any| {
|
||||
@R|javax/annotation/Nonnull|(R|javax/annotation/meta/When.NEVER|()) public open field field: R|kotlin/String?|
|
||||
|
||||
@R|MyNullable|() public open fun foo(@R|javax/annotation/Nonnull|(R|javax/annotation/meta/When.NEVER|()) x: R|kotlin/String?|, @R|MyNullable|() y: R|kotlin/CharSequence?|): R|kotlin/String?|
|
||||
|
||||
public constructor(): R|NonNullNever|
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// FOREIGN_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.NEVER)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface MyNullable {
|
||||
|
||||
}
|
||||
|
||||
// FILE: NonNullNever.java
|
||||
|
||||
import javax.annotation.*;
|
||||
import javax.annotation.meta.When;
|
||||
|
||||
public class NonNullNever {
|
||||
@Nonnull(when = When.NEVER) public String field = null;
|
||||
|
||||
@MyNullable
|
||||
public String foo(@Nonnull(when = When.NEVER) String x, @MyNullable CharSequence y) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
public open class Simple : R|kotlin/Any| {
|
||||
@R|javax/annotation/Nullable|() public open field field: R|kotlin/String?|
|
||||
|
||||
@R|javax/annotation/Nullable|() public open fun foo(@R|javax/annotation/Nonnull|() x: R|kotlin/String|, @R|javax/annotation/CheckForNull|() y: R|kotlin/CharSequence?|): R|kotlin/String?|
|
||||
|
||||
@R|javax/annotation/Nonnull|() public open fun bar(): R|kotlin/String|
|
||||
|
||||
public constructor(): R|Simple|
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
// FOREIGN_ANNOTATIONS
|
||||
import javax.annotation.*;
|
||||
|
||||
public class Simple {
|
||||
@Nullable public String field = null;
|
||||
|
||||
@Nullable
|
||||
public String foo(@Nonnull String x, @CheckForNull CharSequence y) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public String bar() {
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
public open class Strange : R|kotlin/Any| {
|
||||
@R|javax/annotation/Nonnull|(R|javax/annotation/meta/When.UNKNOWN|()) public open field field: R|ft<kotlin/String, kotlin/String?>!|
|
||||
|
||||
@R|javax/annotation/Nonnull|(R|javax/annotation/meta/When.MAYBE|()) public open fun foo(@R|javax/annotation/Nonnull|(R|javax/annotation/meta/When.ALWAYS|()) x: R|kotlin/String|, @R|javax/annotation/Nonnull|(R|javax/annotation/meta/When.NEVER|()) y: R|kotlin/CharSequence?|): R|kotlin/String?|
|
||||
|
||||
@R|javax/annotation/Nonnull|() public open fun bar(): R|kotlin/String|
|
||||
|
||||
public constructor(): R|Strange|
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// FOREIGN_ANNOTATIONS
|
||||
import javax.annotation.*;
|
||||
import javax.annotation.meta.*;
|
||||
|
||||
public class Strange {
|
||||
@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 "";
|
||||
}
|
||||
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
@R|FieldsAreNullable|() public open class A : R|kotlin/Any| {
|
||||
public open field field: R|kotlin/String?|
|
||||
|
||||
@R|javax/annotation/Nonnull|() public open field nonNullField: R|kotlin/String|
|
||||
|
||||
public open fun foo(q: R|ft<kotlin/String, kotlin/String?>!|, @R|javax/annotation/Nonnull|() x: R|kotlin/String|, @R|javax/annotation/CheckForNull|() y: R|kotlin/CharSequence?|): R|ft<kotlin/String, kotlin/String?>!|
|
||||
|
||||
@R|javax/annotation/Nonnull|() public open fun bar(): R|kotlin/String|
|
||||
|
||||
public constructor(): R|A|
|
||||
|
||||
}
|
||||
@R|java/lang/annotation/Retention|(R|java/lang/annotation/RetentionPolicy.RUNTIME|()) @R|java/lang/annotation/Documented|() @R|javax/annotation/CheckForNull|() @R|javax/annotation/meta/TypeQualifierDefault|(<implicitArrayOf>(R|java/lang/annotation/ElementType.FIELD|())) public abstract annotation class FieldsAreNullable : R|kotlin/Annotation| {
|
||||
}
|
||||
Vendored
+39
@@ -0,0 +1,39 @@
|
||||
// FOREIGN_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 "";
|
||||
}
|
||||
}
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
@R|spr/NonNullApi|() public open class A : R|kotlin/Any| {
|
||||
public open fun foo(x: R|kotlin/String|, @R|spr/Nullable|() y: R|kotlin/CharSequence?|): R|kotlin/String|
|
||||
|
||||
@R|spr/ForceFlexibility|() public open fun bar(x: R|ft<kotlin/String, kotlin/String?>!|, @R|javax/annotation/Nonnull|() y: R|kotlin/CharSequence|): R|ft<kotlin/String, kotlin/String?>!|
|
||||
|
||||
public constructor(): R|A|
|
||||
|
||||
}
|
||||
@R|java/lang/annotation/Retention|(R|java/lang/annotation/RetentionPolicy.RUNTIME|()) @R|java/lang/annotation/Documented|() @R|spr/UnknownNullability|() @R|javax/annotation/meta/TypeQualifierDefault|(<implicitArrayOf>(R|java/lang/annotation/ElementType.METHOD|(), R|java/lang/annotation/ElementType.PARAMETER|())) public abstract annotation class ForceFlexibility : R|kotlin/Annotation| {
|
||||
}
|
||||
@R|java/lang/annotation/Target|(R|java/lang/annotation/ElementType.TYPE|()) @R|java/lang/annotation/Retention|(R|java/lang/annotation/RetentionPolicy.RUNTIME|()) @R|java/lang/annotation/Documented|() @R|javax/annotation/Nonnull|() @R|javax/annotation/meta/TypeQualifierDefault|(<implicitArrayOf>(R|java/lang/annotation/ElementType.METHOD|(), R|java/lang/annotation/ElementType.PARAMETER|())) public abstract annotation class NonNullApi : R|kotlin/Annotation| {
|
||||
}
|
||||
@R|java/lang/annotation/Target|(<implicitArrayOf>(R|java/lang/annotation/ElementType.METHOD|(), R|java/lang/annotation/ElementType.PARAMETER|())) @R|java/lang/annotation/Retention|(R|java/lang/annotation/RetentionPolicy.RUNTIME|()) @R|java/lang/annotation/Documented|() @R|javax/annotation/Nonnull|(R|javax/annotation/meta/When.MAYBE|()) @R|javax/annotation/meta/TypeQualifierNickname|() public abstract annotation class Nullable : R|kotlin/Annotation| {
|
||||
}
|
||||
@R|java/lang/annotation/Documented|() @R|javax/annotation/meta/TypeQualifierNickname|() @R|javax/annotation/Nonnull|(R|javax/annotation/meta/When.UNKNOWN|()) @R|java/lang/annotation/Retention|(R|java/lang/annotation/RetentionPolicy.RUNTIME|()) public abstract annotation class UnknownNullability : R|kotlin/Annotation| {
|
||||
}
|
||||
Vendored
+99
@@ -0,0 +1,99 @@
|
||||
// FOREIGN_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: spr/UnknownNullability.java
|
||||
package spr;
|
||||
|
||||
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.UNKNOWN)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface UnknownNullability {
|
||||
|
||||
}
|
||||
|
||||
// FILE: spr/ForceFlexibility.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;
|
||||
import javax.annotation.meta.When;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@UnknownNullability
|
||||
@TypeQualifierDefault({ElementType.METHOD, ElementType.PARAMETER})
|
||||
public @interface ForceFlexibility {
|
||||
}
|
||||
|
||||
// FILE: A.java
|
||||
|
||||
import spr.*;
|
||||
|
||||
@NonNullApi
|
||||
public class A {
|
||||
public String foo(String x, @Nullable CharSequence y) {
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
@ForceFlexibility
|
||||
public String bar(String x, @javax.annotation.Nonnull CharSequence y) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
@R|spr/NonNullApi|() public open class A : R|kotlin/Any|, R|B| {
|
||||
@R|spr/ForceFlexibility|() public open fun foo(x: R|kotlin/String|): R|kotlin/Unit|
|
||||
|
||||
public open fun bar(@R|spr/ForceFlexibility|() x: R|kotlin/String|): R|kotlin/Unit|
|
||||
|
||||
public open fun baz(@R|spr/UnknownNullability|() x: R|kotlin/String|): R|kotlin/Unit|
|
||||
|
||||
public open fun foobar(@R|javax/annotation/Nonnull|(R|javax/annotation/meta/When.UNKNOWN|()) x: R|ft<kotlin/String, kotlin/String?>!|): R|kotlin/Unit|
|
||||
|
||||
public constructor(): R|A|
|
||||
|
||||
}
|
||||
public abstract interface B : R|kotlin/Any| {
|
||||
public abstract fun foo(@R|javax/annotation/Nonnull|() x: R|kotlin/String|): R|kotlin/Unit|
|
||||
|
||||
public abstract fun bar(@R|javax/annotation/Nonnull|() x: R|kotlin/String|): R|kotlin/Unit|
|
||||
|
||||
public abstract fun baz(@R|javax/annotation/Nonnull|() x: R|kotlin/String|): R|kotlin/Unit|
|
||||
|
||||
public abstract fun foobar(@R|javax/annotation/Nonnull|() x: R|kotlin/String|): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
@R|java/lang/annotation/Retention|(R|java/lang/annotation/RetentionPolicy.RUNTIME|()) @R|java/lang/annotation/Documented|() @R|spr/UnknownNullability|() @R|javax/annotation/meta/TypeQualifierDefault|(<implicitArrayOf>(R|java/lang/annotation/ElementType.METHOD|(), R|java/lang/annotation/ElementType.PARAMETER|())) public abstract annotation class ForceFlexibility : R|kotlin/Annotation| {
|
||||
}
|
||||
@R|java/lang/annotation/Target|(R|java/lang/annotation/ElementType.TYPE|()) @R|java/lang/annotation/Retention|(R|java/lang/annotation/RetentionPolicy.RUNTIME|()) @R|java/lang/annotation/Documented|() @R|javax/annotation/Nonnull|() @R|javax/annotation/meta/TypeQualifierDefault|(<implicitArrayOf>(R|java/lang/annotation/ElementType.METHOD|(), R|java/lang/annotation/ElementType.PARAMETER|())) public abstract annotation class NonNullApi : R|kotlin/Annotation| {
|
||||
}
|
||||
@R|java/lang/annotation/Documented|() @R|javax/annotation/meta/TypeQualifierNickname|() @R|javax/annotation/Nonnull|(R|javax/annotation/meta/When.UNKNOWN|()) @R|java/lang/annotation/Retention|(R|java/lang/annotation/RetentionPolicy.RUNTIME|()) public abstract annotation class UnknownNullability : R|kotlin/Annotation| {
|
||||
}
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
// FOREIGN_ANNOTATIONS
|
||||
|
||||
// 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: spr/UnknownNullability.java
|
||||
package spr;
|
||||
|
||||
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.UNKNOWN)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface UnknownNullability {
|
||||
|
||||
}
|
||||
|
||||
// FILE: spr/ForceFlexibility.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;
|
||||
import javax.annotation.meta.When;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@UnknownNullability
|
||||
@TypeQualifierDefault({ElementType.METHOD, ElementType.PARAMETER})
|
||||
public @interface ForceFlexibility {
|
||||
}
|
||||
|
||||
// FILE: B.java
|
||||
public interface B {
|
||||
public void foo(@javax.annotation.Nonnull String x);
|
||||
public void bar(@javax.annotation.Nonnull String x);
|
||||
public void baz(@javax.annotation.Nonnull String x);
|
||||
public void foobar(@javax.annotation.Nonnull String x);
|
||||
}
|
||||
|
||||
// FILE: A.java
|
||||
|
||||
import spr.*;
|
||||
|
||||
@NonNullApi
|
||||
public class A implements B {
|
||||
@ForceFlexibility
|
||||
public void foo(String x) {}
|
||||
public void bar(@ForceFlexibility String x) {}
|
||||
public void baz(@UnknownNullability String x) {}
|
||||
public void foobar(@javax.annotation.Nonnull(when = javax.annotation.meta.When.UNKNOWN) String x) {}
|
||||
}
|
||||
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
@R|NonNullApi|() public open class A : R|kotlin/Any| {
|
||||
public open fun foo1(x: R|kotlin/String|): R|kotlin/String|
|
||||
|
||||
public open fun foo2(x: R|kotlin/String|): R|kotlin/String|
|
||||
|
||||
public open fun foo3(x: R|kotlin/String|): R|kotlin/String|
|
||||
|
||||
@R|javax/annotation/Nullable|() public open fun bar1(@R|javax/annotation/Nullable|() x: R|kotlin/String?|): R|kotlin/String?|
|
||||
|
||||
@R|javax/annotation/Nullable|() public open fun bar2(@R|javax/annotation/Nullable|() x: R|kotlin/String?|): R|kotlin/String?|
|
||||
|
||||
public open fun baz(@R|javax/annotation/Nonnull|() x: R|kotlin/String|): R|kotlin/String|
|
||||
|
||||
public constructor(): R|A|
|
||||
|
||||
}
|
||||
@R|NonNullApi|() public abstract interface AInt : R|kotlin/Any| {
|
||||
public abstract fun foo1(x: R|kotlin/String|): R|kotlin/CharSequence|
|
||||
|
||||
public abstract fun foo2(x: R|kotlin/String|): R|kotlin/CharSequence|
|
||||
|
||||
public abstract fun foo3(x: R|kotlin/String|): R|kotlin/CharSequence|
|
||||
|
||||
@R|javax/annotation/Nullable|() public abstract fun bar1(@R|javax/annotation/Nullable|() x: R|kotlin/String?|): R|kotlin/CharSequence?|
|
||||
|
||||
@R|javax/annotation/Nullable|() public abstract fun bar2(@R|javax/annotation/Nullable|() x: R|kotlin/String?|): R|kotlin/CharSequence?|
|
||||
|
||||
public abstract fun baz(@R|javax/annotation/Nonnull|() x: R|kotlin/String|): R|kotlin/CharSequence|
|
||||
|
||||
}
|
||||
@R|NullableApi|() public open class B : R|A|, R|AInt| {
|
||||
public open fun foo1(x: R|kotlin/String|): R|kotlin/String|
|
||||
|
||||
@R|javax/annotation/Nonnull|() public open fun foo2(@R|javax/annotation/Nonnull|() x: R|kotlin/String|): R|kotlin/String|
|
||||
|
||||
public open fun bar1(x: R|kotlin/String?|): R|kotlin/String?|
|
||||
|
||||
public open fun baz(x: R|kotlin/String|): R|kotlin/String|
|
||||
|
||||
public constructor(): R|B|
|
||||
|
||||
}
|
||||
@R|NonNullApi|() public open class C : R|A|, R|AInt| {
|
||||
public open fun foo1(x: R|kotlin/String|): R|kotlin/String|
|
||||
|
||||
public open fun foo2(@R|javax/annotation/Nonnull|() x: R|kotlin/String|): R|kotlin/String|
|
||||
|
||||
public open fun bar1(x: R|kotlin/String?|): R|kotlin/String?|
|
||||
|
||||
@R|javax/annotation/Nullable|() public open fun bar2(@R|javax/annotation/Nullable|() x: R|kotlin/String?|): R|kotlin/String?|
|
||||
|
||||
public open fun baz(x: R|kotlin/String|): R|kotlin/String|
|
||||
|
||||
public constructor(): R|C|
|
||||
|
||||
}
|
||||
@R|java/lang/annotation/Target|(R|java/lang/annotation/ElementType.TYPE|()) @R|java/lang/annotation/Retention|(R|java/lang/annotation/RetentionPolicy.RUNTIME|()) @R|java/lang/annotation/Documented|() @R|javax/annotation/Nonnull|() @R|javax/annotation/meta/TypeQualifierDefault|(<implicitArrayOf>(R|java/lang/annotation/ElementType.METHOD|(), R|java/lang/annotation/ElementType.PARAMETER|(), R|java/lang/annotation/ElementType.FIELD|())) public abstract annotation class NonNullApi : R|kotlin/Annotation| {
|
||||
}
|
||||
@R|java/lang/annotation/Target|(R|java/lang/annotation/ElementType.TYPE|()) @R|java/lang/annotation/Retention|(R|java/lang/annotation/RetentionPolicy.RUNTIME|()) @R|java/lang/annotation/Documented|() @R|javax/annotation/CheckForNull|() @R|javax/annotation/meta/TypeQualifierDefault|(<implicitArrayOf>(R|java/lang/annotation/ElementType.METHOD|(), R|java/lang/annotation/ElementType.PARAMETER|(), R|java/lang/annotation/ElementType.FIELD|())) public abstract annotation class NullableApi : R|kotlin/Annotation| {
|
||||
}
|
||||
+131
@@ -0,0 +1,131 @@
|
||||
// FOREIGN_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 ""; }
|
||||
}
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
@R|NonNullApi|() public open class A : R|kotlin/Any| {
|
||||
public open field field: R|kotlin/String|
|
||||
|
||||
public open fun foo(x: R|kotlin/String|, @R|javax/annotation/CheckForNull|() y: R|kotlin/CharSequence?|): R|kotlin/String|
|
||||
|
||||
@R|NullableApi|() public open fun foobar(x: R|kotlin/String?|, @R|NonNullApi|() y: R|kotlin/CharSequence|): R|kotlin/String?|
|
||||
|
||||
public open fun bar(): R|kotlin/String|
|
||||
|
||||
@R|javax/annotation/Nullable|() public open fun baz(): R|ft<kotlin/collections/MutableList<ft<kotlin/String, kotlin/String?>!>?, kotlin/collections/List<ft<kotlin/String, kotlin/String?>!>?>?|
|
||||
|
||||
public constructor(): R|A|
|
||||
|
||||
}
|
||||
@R|java/lang/annotation/Retention|(R|java/lang/annotation/RetentionPolicy.RUNTIME|()) @R|java/lang/annotation/Documented|() @R|javax/annotation/CheckForNull|() @R|javax/annotation/meta/TypeQualifierDefault|(<implicitArrayOf>(R|java/lang/annotation/ElementType.FIELD|())) public abstract annotation class FieldsAreNullable : R|kotlin/Annotation| {
|
||||
}
|
||||
@R|java/lang/annotation/Retention|(R|java/lang/annotation/RetentionPolicy.RUNTIME|()) @R|java/lang/annotation/Documented|() @R|javax/annotation/Nonnull|() @R|javax/annotation/meta/TypeQualifierDefault|(<implicitArrayOf>(R|java/lang/annotation/ElementType.METHOD|(), R|java/lang/annotation/ElementType.PARAMETER|(), R|java/lang/annotation/ElementType.FIELD|())) public abstract annotation class NonNullApi : R|kotlin/Annotation| {
|
||||
}
|
||||
@R|java/lang/annotation/Retention|(R|java/lang/annotation/RetentionPolicy.RUNTIME|()) @R|java/lang/annotation/Documented|() @R|javax/annotation/CheckForNull|() @R|javax/annotation/meta/TypeQualifierDefault|(<implicitArrayOf>(R|java/lang/annotation/ElementType.METHOD|(), R|java/lang/annotation/ElementType.PARAMETER|(), R|java/lang/annotation/ElementType.FIELD|())) public abstract annotation class NullableApi : R|kotlin/Annotation| {
|
||||
}
|
||||
+128
@@ -0,0 +1,128 @@
|
||||
// FOREIGN_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, @NonNullApi 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, @NullableApi 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
@R|javax/annotation/ParametersAreNonnullByDefault|() public open class A : R|kotlin/Any| {
|
||||
@R|javax/annotation/Nullable|() public open field field: R|kotlin/String?|
|
||||
|
||||
public open fun foo(q: R|kotlin/String|, @R|javax/annotation/Nonnull|() x: R|kotlin/String|, @R|javax/annotation/CheckForNull|() y: R|kotlin/CharSequence?|): R|ft<kotlin/String, kotlin/String?>!|
|
||||
|
||||
@R|javax/annotation/Nonnull|() public open fun bar(): R|kotlin/String|
|
||||
|
||||
public constructor(): R|A|
|
||||
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// FOREIGN_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 "";
|
||||
}
|
||||
}
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
public open class A : R|kotlin/Any| {
|
||||
@R|javax/annotation/Nullable|() public open field field: R|kotlin/String?|
|
||||
|
||||
public open fun foo(q: R|ft<kotlin/String, kotlin/String?>!|, @R|javax/annotation/Nonnull|() x: R|kotlin/String|, @R|javax/annotation/CheckForNull|() y: R|kotlin/CharSequence?|): R|ft<kotlin/String, kotlin/String?>!|
|
||||
|
||||
@R|javax/annotation/Nonnull|() public open fun bar(): R|kotlin/String|
|
||||
|
||||
public constructor(): R|test/A|
|
||||
|
||||
}
|
||||
public open class A2 : R|kotlin/Any| {
|
||||
@R|javax/annotation/Nullable|() public open field field: R|kotlin/String?|
|
||||
|
||||
public open fun foo(q: R|ft<kotlin/String, kotlin/String?>!|, @R|javax/annotation/Nonnull|() x: R|kotlin/String|, @R|javax/annotation/CheckForNull|() y: R|kotlin/CharSequence?|): R|ft<kotlin/String, kotlin/String?>!|
|
||||
|
||||
@R|javax/annotation/Nonnull|() public open fun bar(): R|kotlin/String|
|
||||
|
||||
public constructor(): R|test2/A2|
|
||||
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
// FOREIGN_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 "";
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
@R|spr/NonNullApi|() public open class A : R|kotlin/Any| {
|
||||
public open field field: R|ft<kotlin/String, kotlin/String?>!|
|
||||
|
||||
public open fun foo(x: R|kotlin/String|, @R|spr/Nullable|() y: R|kotlin/CharSequence?|): R|kotlin/String|
|
||||
|
||||
public open fun bar(): R|kotlin/String|
|
||||
|
||||
@R|spr/Nullable|() public open fun baz(): R|ft<kotlin/collections/MutableList<ft<kotlin/String, kotlin/String?>!>?, kotlin/collections/List<ft<kotlin/String, kotlin/String?>!>?>?|
|
||||
|
||||
public constructor(): R|A|
|
||||
|
||||
}
|
||||
@R|java/lang/annotation/Target|(R|java/lang/annotation/ElementType.TYPE|()) @R|java/lang/annotation/Retention|(R|java/lang/annotation/RetentionPolicy.RUNTIME|()) @R|java/lang/annotation/Documented|() @R|javax/annotation/Nonnull|() @R|javax/annotation/meta/TypeQualifierDefault|(<implicitArrayOf>(R|java/lang/annotation/ElementType.METHOD|(), R|java/lang/annotation/ElementType.PARAMETER|())) public abstract annotation class NonNullApi : R|kotlin/Annotation| {
|
||||
}
|
||||
@R|java/lang/annotation/Target|(<implicitArrayOf>(R|java/lang/annotation/ElementType.METHOD|(), R|java/lang/annotation/ElementType.PARAMETER|())) @R|java/lang/annotation/Retention|(R|java/lang/annotation/RetentionPolicy.RUNTIME|()) @R|java/lang/annotation/Documented|() @R|javax/annotation/Nonnull|(R|javax/annotation/meta/When.MAYBE|()) @R|javax/annotation/meta/TypeQualifierNickname|() public abstract annotation class Nullable : R|kotlin/Annotation| {
|
||||
}
|
||||
Vendored
+65
@@ -0,0 +1,65 @@
|
||||
// FOREIGN_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;
|
||||
}
|
||||
}
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
public open class A : R|kotlin/Any| {
|
||||
public open field field: R|ft<kotlin/String, kotlin/String?>!|
|
||||
|
||||
public open fun foo(x: R|ft<kotlin/String, kotlin/String?>!|, @R|spr/Nullable|() y: R|kotlin/CharSequence?|): R|ft<kotlin/String, kotlin/String?>!|
|
||||
|
||||
public open fun bar(): R|ft<kotlin/String, kotlin/String?>!|
|
||||
|
||||
@R|spr/Nullable|() public open fun baz(): R|ft<kotlin/collections/MutableList<ft<kotlin/String, kotlin/String?>!>?, kotlin/collections/List<ft<kotlin/String, kotlin/String?>!>?>?|
|
||||
|
||||
public constructor(): R|test/A|
|
||||
|
||||
}
|
||||
@R|java/lang/annotation/Target|(R|java/lang/annotation/ElementType.PACKAGE|()) @R|java/lang/annotation/Retention|(R|java/lang/annotation/RetentionPolicy.RUNTIME|()) @R|java/lang/annotation/Documented|() @R|javax/annotation/Nonnull|() @R|javax/annotation/meta/TypeQualifierDefault|(<implicitArrayOf>(R|java/lang/annotation/ElementType.METHOD|(), R|java/lang/annotation/ElementType.PARAMETER|())) public abstract annotation class NonNullApi : R|kotlin/Annotation| {
|
||||
}
|
||||
@R|java/lang/annotation/Target|(<implicitArrayOf>(R|java/lang/annotation/ElementType.METHOD|(), R|java/lang/annotation/ElementType.PARAMETER|())) @R|java/lang/annotation/Retention|(R|java/lang/annotation/RetentionPolicy.RUNTIME|()) @R|java/lang/annotation/Documented|() @R|javax/annotation/Nonnull|(R|javax/annotation/meta/When.MAYBE|()) @R|javax/annotation/meta/TypeQualifierNickname|() public abstract annotation class Nullable : R|kotlin/Annotation| {
|
||||
}
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
// FOREIGN_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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
public abstract class AbstractMap : R|kotlin/Any|, R|kotlin/collections/MutableMap<ft<kotlin/String, kotlin/String?>!, ft<kotlin/String, kotlin/String?>!>| {
|
||||
public constructor(): R|AbstractMap|
|
||||
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
public abstract class AbstractMap implements java.util.Map<String, String> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
Most FIR enhancement tests use compiler/testData/loadJava/compilerJava
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
public/*package*/ open class A : R|kotlin/Any| {
|
||||
public open fun a(@R|kotlin/annotations/jvm/internal/DefaultValue|(String(HELLO)) arg: R|ft<Signs, Signs?>!| = R|/Signs.HELLO|): R|ft<Signs, Signs?>!|
|
||||
|
||||
public open fun bar(@R|kotlin/annotations/jvm/internal/DefaultValue|(String(X)) arg: R|ft<Signs, Signs?>!| = R|/Signs.X|): R|ft<Signs, Signs?>!|
|
||||
|
||||
public open fun baz(@R|kotlin/annotations/jvm/internal/DefaultValue|(String(NOT_ENTRY_EITHER)) arg: R|ft<Signs, Signs?>!|): R|ft<Signs, Signs?>!|
|
||||
|
||||
public open fun bam(@R|kotlin/annotations/jvm/internal/DefaultValue|(String(NOT_ENTRY_EITHER)) arg: R|ft<Mixed, Mixed?>!| = R|/Mixed.NOT_ENTRY_EITHER|): R|ft<Mixed, Mixed?>!|
|
||||
|
||||
public/*package*/ constructor(): R|A|
|
||||
|
||||
}
|
||||
public final enum class Mixed : R|kotlin/Enum<ft<Mixed, Mixed?>!>| {
|
||||
public final static field NOT_ENTRY_EITHER: R|ft<Mixed, Mixed?>!|
|
||||
|
||||
public final static fun values(): R|kotlin/Array<Mixed>| {
|
||||
}
|
||||
|
||||
public final static fun valueOf(value: R|kotlin/String|): R|Mixed| {
|
||||
}
|
||||
|
||||
}
|
||||
public final enum class Signs : R|kotlin/Enum<ft<Signs, Signs?>!>| {
|
||||
public final static field HELLO: R|ft<Signs, Signs?>!|
|
||||
|
||||
public final static field WORLD: R|ft<Signs, Signs?>!|
|
||||
|
||||
public final static field X: R|ft<Signs, Signs?>!|
|
||||
|
||||
public final static fun values(): R|kotlin/Array<Signs>| {
|
||||
}
|
||||
|
||||
public final static fun valueOf(value: R|kotlin/String|): R|Signs| {
|
||||
}
|
||||
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
// FILE: Signs.java
|
||||
// ANDROID_ANNOTATIONS
|
||||
|
||||
public enum Signs {
|
||||
HELLO,
|
||||
WORLD;
|
||||
|
||||
public static final Signs X;
|
||||
public static final class NOT_ENTRY_EITHER {}
|
||||
}
|
||||
|
||||
// FILE: Mixed.java
|
||||
public enum Mixed {
|
||||
NOT_ENTRY_EITHER;
|
||||
|
||||
public static final class NOT_ENTRY_EITHER {}
|
||||
}
|
||||
|
||||
// FILE: A.java
|
||||
import kotlin.annotations.jvm.internal.*;
|
||||
|
||||
class A {
|
||||
public Signs a(@DefaultValue("HELLO") Signs arg) {
|
||||
return arg;
|
||||
}
|
||||
|
||||
public Signs bar(@DefaultValue("X") Signs arg) {
|
||||
return arg;
|
||||
}
|
||||
|
||||
public Signs baz(@DefaultValue("NOT_ENTRY_EITHER") Signs arg) {
|
||||
return arg;
|
||||
}
|
||||
|
||||
public Mixed bam(@DefaultValue("NOT_ENTRY_EITHER") Mixed arg) {
|
||||
return arg;
|
||||
}
|
||||
|
||||
}
|
||||
Vendored
+24
@@ -0,0 +1,24 @@
|
||||
public open class A : R|kotlin/Any| {
|
||||
public open fun first(@R|kotlin/annotations/jvm/internal/DefaultValue|(String(0x1F)) value: R|ft<kotlin/Long, kotlin/Long?>!| = Long(31)): R|kotlin/Unit|
|
||||
|
||||
public open fun second(@R|kotlin/annotations/jvm/internal/DefaultValue|(String(0X1F)) value: R|ft<kotlin/Long, kotlin/Long?>!| = Long(31)): R|kotlin/Unit|
|
||||
|
||||
public open fun third(@R|kotlin/annotations/jvm/internal/DefaultValue|(String(0b1010)) value: R|ft<kotlin/Long, kotlin/Long?>!| = Long(10)): R|kotlin/Unit|
|
||||
|
||||
public open fun fourth(@R|kotlin/annotations/jvm/internal/DefaultValue|(String(0B1010)) value: R|ft<kotlin/Long, kotlin/Long?>!| = Long(10)): R|kotlin/Unit|
|
||||
|
||||
public constructor(): R|A|
|
||||
|
||||
}
|
||||
public open class B : R|kotlin/Any| {
|
||||
public open fun first(@R|kotlin/annotations/jvm/internal/DefaultValue|(String(0x)) value: R|ft<kotlin/Long, kotlin/Long?>!|): R|kotlin/Unit|
|
||||
|
||||
public open fun second(@R|kotlin/annotations/jvm/internal/DefaultValue|(String(0xZZ)) value: R|ft<kotlin/Long, kotlin/Long?>!|): R|kotlin/Unit|
|
||||
|
||||
public open fun third(@R|kotlin/annotations/jvm/internal/DefaultValue|(String(0b)) value: R|ft<kotlin/Long, kotlin/Long?>!|): R|kotlin/Unit|
|
||||
|
||||
public open fun fourth(@R|kotlin/annotations/jvm/internal/DefaultValue|(String(0B1234)) value: R|ft<kotlin/Long, kotlin/Long?>!|): R|kotlin/Unit|
|
||||
|
||||
public constructor(): R|B|
|
||||
|
||||
}
|
||||
Vendored
+36
@@ -0,0 +1,36 @@
|
||||
// FILE: A.java
|
||||
// ANDROID_ANNOTATIONS
|
||||
|
||||
import kotlin.annotations.jvm.internal.*;
|
||||
|
||||
public class A {
|
||||
public void first(@DefaultValue("0x1F") Long value) {
|
||||
}
|
||||
|
||||
public void second(@DefaultValue("0X1F") Long value) {
|
||||
}
|
||||
|
||||
public void third(@DefaultValue("0b1010") Long value) {
|
||||
}
|
||||
|
||||
public void fourth(@DefaultValue("0B1010") Long value) {
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: B.java
|
||||
import kotlin.annotations.jvm.internal.*;
|
||||
|
||||
public class B {
|
||||
public void first(@DefaultValue("0x") Long value) {
|
||||
}
|
||||
|
||||
public void second(@DefaultValue("0xZZ") Long value) {
|
||||
}
|
||||
|
||||
public void third(@DefaultValue("0b") Long value) {
|
||||
}
|
||||
|
||||
public void fourth(@DefaultValue("0B1234") Long value) {
|
||||
}
|
||||
}
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
public open class A : R|kotlin/Any| {
|
||||
public open fun foo(@R|kotlin/annotations/jvm/internal/DefaultNull|() x: R|ft<kotlin/Int, kotlin/Int?>!| = Null(null)): R|kotlin/Unit|
|
||||
|
||||
public open fun bar(@R|kotlin/annotations/jvm/internal/DefaultNull|() x: R|kotlin/Int| = Null(null)): R|kotlin/Unit|
|
||||
|
||||
public constructor(): R|A|
|
||||
|
||||
}
|
||||
public open class B<T> : R|kotlin/Any| {
|
||||
public open fun foo(@R|kotlin/annotations/jvm/internal/DefaultNull|() t: R|ft<T, T?>!| = Null(null)): R|kotlin/Unit|
|
||||
|
||||
public constructor<T>(): R|B<T>|
|
||||
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// FILE: A.java
|
||||
// ANDROID_ANNOTATIONS
|
||||
|
||||
import kotlin.annotations.jvm.internal.*;
|
||||
|
||||
public class A {
|
||||
public void foo(@DefaultNull Integer x) {}
|
||||
public void bar(@DefaultNull int x) {}
|
||||
}
|
||||
|
||||
// FILE: B.java
|
||||
import kotlin.annotations.jvm.internal.*;
|
||||
|
||||
public class B<T> {
|
||||
public void foo(@DefaultNull T t) { }
|
||||
}
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
public open class A : R|kotlin/Any| {
|
||||
public open fun foo(@R|kotlin/annotations/jvm/internal/DefaultNull|() i: R|ft<kotlin/Int, kotlin/Int?>!| = Null(null)): R|kotlin/Unit|
|
||||
|
||||
public open fun bar(@R|kotlin/annotations/jvm/internal/DefaultNull|() a: R|ft<kotlin/Int, kotlin/Int?>!| = Null(null)): R|kotlin/Unit|
|
||||
|
||||
public open fun bam(@R|kotlin/annotations/jvm/internal/DefaultNull|() a: R|ft<kotlin/Int, kotlin/Int?>!| = Null(null)): R|kotlin/Unit|
|
||||
|
||||
public open fun baz(@R|kotlin/annotations/jvm/internal/DefaultValue|(String(42)) a: R|ft<kotlin/Int, kotlin/Int?>!| = Int(42)): R|kotlin/Unit|
|
||||
|
||||
public constructor(): R|A|
|
||||
|
||||
}
|
||||
public abstract interface AInt : R|kotlin/Any| {
|
||||
public abstract fun foo(@R|kotlin/annotations/jvm/internal/DefaultValue|(String(42)) i: R|ft<kotlin/Int, kotlin/Int?>!| = Int(42)): R|kotlin/Unit|
|
||||
|
||||
public abstract fun bar(@R|kotlin/annotations/jvm/internal/DefaultNull|() a: R|ft<kotlin/Int, kotlin/Int?>!| = Null(null)): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
public open class B : R|A| {
|
||||
public open fun foo(i: R|ft<kotlin/Int, kotlin/Int?>!|): R|kotlin/Unit|
|
||||
|
||||
public open fun bar(@R|kotlin/annotations/jvm/internal/DefaultValue|(String(42)) a: R|ft<kotlin/Int, kotlin/Int?>!| = Int(42)): R|kotlin/Unit|
|
||||
|
||||
public open fun bam(@R|kotlin/annotations/jvm/internal/DefaultNull|() @R|kotlin/annotations/jvm/internal/DefaultValue|(String(42)) a: R|ft<kotlin/Int, kotlin/Int?>!| = Int(42)): R|kotlin/Unit|
|
||||
|
||||
public constructor(): R|B|
|
||||
|
||||
}
|
||||
public open class C : R|A|, R|AInt| {
|
||||
public constructor(): R|C|
|
||||
|
||||
}
|
||||
Vendored
+38
@@ -0,0 +1,38 @@
|
||||
// FILE: A.java
|
||||
// ANDROID_ANNOTATIONS
|
||||
|
||||
import kotlin.annotations.jvm.internal.*;
|
||||
|
||||
public class A {
|
||||
public void foo(@DefaultNull Integer i) {}
|
||||
|
||||
public void bar(@DefaultNull Integer a) {}
|
||||
|
||||
public void bam(@DefaultNull Integer a) {}
|
||||
|
||||
public void baz(@DefaultValue("42") Integer a) {}
|
||||
}
|
||||
|
||||
// FILE: AInt.java
|
||||
import kotlin.annotations.jvm.internal.*;
|
||||
|
||||
public interface AInt {
|
||||
public void foo(@DefaultValue("42") Integer i) {}
|
||||
public void bar(@DefaultNull Integer a) {}
|
||||
}
|
||||
|
||||
// FILE: B.java
|
||||
import kotlin.annotations.jvm.internal.*;
|
||||
|
||||
public class B extends A {
|
||||
public void foo(Integer i) {}
|
||||
|
||||
public void bar(@DefaultValue("42") Integer a) {}
|
||||
|
||||
public void bam(@DefaultNull @DefaultValue("42") Integer a) {}
|
||||
}
|
||||
|
||||
// FILE: C.java
|
||||
public class C extends A implements AInt {
|
||||
}
|
||||
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
public/*package*/ open class A : R|kotlin/Any| {
|
||||
public open fun first(@R|kotlin/annotations/jvm/internal/DefaultValue|(String(hello)) value: R|ft<kotlin/String, kotlin/String?>!| = String(hello)): R|kotlin/Unit|
|
||||
|
||||
public open fun second(@R|kotlin/annotations/jvm/internal/DefaultValue|(String(first)) a: R|ft<kotlin/String, kotlin/String?>!| = String(first), @R|kotlin/annotations/jvm/internal/DefaultValue|(String(second)) b: R|ft<kotlin/String, kotlin/String?>!| = String(second)): R|kotlin/Unit|
|
||||
|
||||
public open fun third(@R|kotlin/annotations/jvm/internal/DefaultValue|(String(first)) a: R|ft<kotlin/String, kotlin/String?>!| = String(first), b: R|ft<kotlin/String, kotlin/String?>!|): R|kotlin/Unit|
|
||||
|
||||
public open fun fourth(first: R|ft<kotlin/String, kotlin/String?>!|, @R|kotlin/annotations/jvm/internal/DefaultValue|(String(second)) second: R|ft<kotlin/String, kotlin/String?>!| = String(second)): R|kotlin/Unit|
|
||||
|
||||
public open fun wrong(@R|kotlin/annotations/jvm/internal/DefaultValue|(String(hello)) i: R|ft<kotlin/Int, kotlin/Int?>!|): R|kotlin/Unit|
|
||||
|
||||
public/*package*/ constructor(): R|A|
|
||||
|
||||
}
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
// FILE: A.java
|
||||
// ANDROID_ANNOTATIONS
|
||||
|
||||
import kotlin.annotations.jvm.internal.*;
|
||||
|
||||
class A {
|
||||
public void first(@DefaultValue("hello") String value) {
|
||||
}
|
||||
|
||||
public void second(@DefaultValue("first") String a, @DefaultValue("second") String b) {
|
||||
}
|
||||
|
||||
public void third(@DefaultValue("first") String a, String b) {
|
||||
}
|
||||
|
||||
public void fourth(String first, @DefaultValue("second") String second) {
|
||||
}
|
||||
|
||||
public void wrong(@DefaultValue("hello") Integer i) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
public/*package*/ open class A : R|kotlin/Any| {
|
||||
public open fun emptyName(@R|kotlin/annotations/jvm/internal/ParameterName|(String()) first: R|ft<kotlin/String, kotlin/String?>!|, @R|kotlin/annotations/jvm/internal/ParameterName|(String(ok)) second: R|kotlin/Int|): R|kotlin/Unit|
|
||||
|
||||
public open fun missingName(@R|kotlin/annotations/jvm/internal/ParameterName|() first: R|ft<kotlin/String, kotlin/String?>!|): R|kotlin/Unit|
|
||||
|
||||
public open fun numberName(@R|kotlin/annotations/jvm/internal/ParameterName|(Int(42)) first: R|ft<kotlin/String, kotlin/String?>!|): R|kotlin/Unit|
|
||||
|
||||
public/*package*/ constructor(): R|A|
|
||||
|
||||
}
|
||||
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
// FILE: A.java
|
||||
// ANDROID_ANNOTATIONS
|
||||
|
||||
import kotlin.annotations.jvm.internal.*;
|
||||
|
||||
class A {
|
||||
public void emptyName(@ParameterName("") String first, @ParameterName("ok") int second) {
|
||||
}
|
||||
|
||||
public void missingName(@ParameterName() String first) {
|
||||
}
|
||||
|
||||
public void numberName(@ParameterName(42) String first) {
|
||||
}
|
||||
}
|
||||
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
public open class A : R|kotlin/Any| {
|
||||
public open fun connect(@R|kotlin/annotations/jvm/internal/ParameterName|(String(host)) host: R|ft<kotlin/String, kotlin/String?>!|, @R|kotlin/annotations/jvm/internal/ParameterName|(String(port)) port: R|kotlin/Int|): R|kotlin/Unit|
|
||||
|
||||
public constructor(): R|A|
|
||||
|
||||
}
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
|
||||
// FILE: A.java
|
||||
// ANDROID_ANNOTATIONS
|
||||
import kotlin.annotations.jvm.internal.*;
|
||||
|
||||
public class A {
|
||||
public void connect(@ParameterName("host") String host, @ParameterName("port") int port) {
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
public open class A : R|kotlin/Any| {
|
||||
public open fun same(@R|kotlin/annotations/jvm/internal/ParameterName|(String(ok)) first: R|ft<kotlin/String, kotlin/String?>!|, @R|kotlin/annotations/jvm/internal/ParameterName|(String(ok)) second: R|ft<kotlin/String, kotlin/String?>!|): R|kotlin/Unit|
|
||||
|
||||
public constructor(): R|A|
|
||||
|
||||
}
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
|
||||
// FILE: A.java
|
||||
// ANDROID_ANNOTATIONS
|
||||
import kotlin.annotations.jvm.internal.*;
|
||||
|
||||
public class A {
|
||||
public void same(@ParameterName("ok") String first, @ParameterName("ok") String second) {
|
||||
}
|
||||
}
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
public open class A : R|kotlin/Any| {
|
||||
public open fun dollarName(@R|kotlin/annotations/jvm/internal/ParameterName|(String($)) host: R|ft<kotlin/String, kotlin/String?>!|): R|kotlin/Unit|
|
||||
|
||||
public open fun numberName(@R|kotlin/annotations/jvm/internal/ParameterName|(String(42)) field: R|ft<kotlin/String, kotlin/String?>!|): R|kotlin/Unit|
|
||||
|
||||
public constructor(): R|A|
|
||||
|
||||
}
|
||||
compiler/fir/analysis-tests/testData/enhancement/signatureAnnotations/SpecialCharsParameterName.java
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
// FILE: A.java
|
||||
// ANDROID_ANNOTATIONS
|
||||
import kotlin.annotations.jvm.internal.*;
|
||||
import kotlin.internal.*;
|
||||
|
||||
public class A {
|
||||
public void dollarName(@ParameterName("$") String host) {
|
||||
}
|
||||
|
||||
public void numberName(@ParameterName("42") String field) {
|
||||
}
|
||||
}
|
||||
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
public/*package*/ open class A : R|kotlin/Any| {
|
||||
public open static fun withDefault(@R|kotlin/annotations/jvm/internal/DefaultValue|(String(OK)) arg: R|ft<kotlin/String, kotlin/String?>!| = String(OK)): R|ft<kotlin/String, kotlin/String?>!|
|
||||
|
||||
public/*package*/ constructor(): R|A|
|
||||
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// IGNORE_BACKEND: JS, NATIVE
|
||||
|
||||
// FILE: A.java
|
||||
// ANDROID_ANNOTATIONS
|
||||
|
||||
import kotlin.annotations.jvm.internal.*;
|
||||
|
||||
class A {
|
||||
public static String withDefault(@DefaultValue("OK") String arg) {
|
||||
return arg;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user