From 6f9694174fa01e478dd0c65b4c96eb1e04eea51e Mon Sep 17 00:00:00 2001 From: Victor Petukhov Date: Mon, 5 Apr 2021 17:23:01 +0300 Subject: [PATCH] Move foreign annotation tests into diagnostics folder --- .../java8Tests/checkerFramework.kt | 2 - .../java8Tests/checkerFramework.txt | 0 .../java8Tests/eclipse.kt | 2 - .../java8Tests/eclipse.txt | 0 .../AnnotatedBoundsOfWildcard.fir.kt | 88 +++ .../AnnotatedBoundsOfWildcard.fir.txt | 38 + .../strictMode/AnnotatedBoundsOfWildcard.kt | 88 +++ .../strictMode/AnnotatedBoundsOfWildcard.txt | 39 + .../jspecify/strictMode/Defaults.fir.kt | 50 ++ .../jspecify/strictMode/Defaults.fir.txt | 25 + .../jspecify/strictMode/Defaults.kt | 50 ++ .../jspecify/strictMode/Defaults.txt | 26 + .../strictMode/IgnoreAnnotations.fir.kt | 48 ++ .../strictMode/IgnoreAnnotations.fir.txt | 31 + .../jspecify/strictMode/IgnoreAnnotations.kt | 48 ++ .../jspecify/strictMode/IgnoreAnnotations.txt | 32 + .../NonPlatformTypeParameter.fir.kt | 29 + .../NonPlatformTypeParameter.fir.txt | 19 + .../strictMode/NonPlatformTypeParameter.kt | 29 + .../strictMode/NonPlatformTypeParameter.txt | 20 + .../NullnessUnspecifiedTypeParameter.fir.kt | 38 + .../NullnessUnspecifiedTypeParameter.fir.txt | 19 + .../NullnessUnspecifiedTypeParameter.kt | 38 + .../NullnessUnspecifiedTypeParameter.txt | 20 + .../jspecify/strictMode/SelfType.fir.kt | 58 ++ .../jspecify/strictMode/SelfType.fir.txt | 67 ++ .../jspecify/strictMode/SelfType.kt | 58 ++ .../jspecify/strictMode/SelfType.txt | 68 ++ .../jspecify/strictMode/Simple.fir.kt | 39 + .../jspecify/strictMode/Simple.fir.txt | 28 + .../java8Tests/jspecify/strictMode/Simple.kt | 39 + .../java8Tests/jspecify/strictMode/Simple.txt | 29 + .../TypeArgumentsFromParameterBounds.fir.kt | 49 ++ .../TypeArgumentsFromParameterBounds.fir.txt | 33 + .../TypeArgumentsFromParameterBounds.kt | 49 ++ .../TypeArgumentsFromParameterBounds.txt | 34 + .../strictMode/TypeParameterBounds.fir.kt | 47 ++ .../strictMode/TypeParameterBounds.fir.txt | 28 + .../strictMode/TypeParameterBounds.kt | 47 ++ .../strictMode/TypeParameterBounds.txt | 29 + .../strictMode/WildcardsWithDefault.fir.kt | 37 + .../strictMode/WildcardsWithDefault.fir.txt | 19 + .../strictMode/WildcardsWithDefault.kt | 37 + .../strictMode/WildcardsWithDefault.txt | 20 + .../AnnotatedBoundsOfWildcard.fir.kt} | 32 +- .../AnnotatedBoundsOfWildcard.fir.txt} | 14 +- .../warnMode}/AnnotatedBoundsOfWildcard.kt | 31 +- .../warnMode/AnnotatedBoundsOfWildcard.txt | 13 +- .../jspecify/warnMode/Defaults.fir.kt} | 32 +- .../jspecify/warnMode/Defaults.fir.txt} | 10 - .../java8Tests/jspecify/warnMode}/Defaults.kt | 29 +- .../jspecify/warnMode}/Defaults.txt | 9 - .../warnMode/IgnoreAnnotations.fir.kt | 47 ++ .../warnMode/IgnoreAnnotations.fir.txt} | 10 - .../jspecify/warnMode/IgnoreAnnotations.kt | 47 ++ .../jspecify/warnMode}/IgnoreAnnotations.txt | 9 - .../warnMode/NonPlatformTypeParameter.fir.kt | 29 + .../NonPlatformTypeParameter.fir.txt} | 8 - .../warnMode/NonPlatformTypeParameter.kt | 29 + .../warnMode/NonPlatformTypeParameter.txt | 7 - .../NullnessUnspecifiedTypeParameter.fir.kt | 38 + .../NullnessUnspecifiedTypeParameter.fir.txt} | 8 - .../NullnessUnspecifiedTypeParameter.kt | 38 + .../NullnessUnspecifiedTypeParameter.txt | 7 - .../jspecify/warnMode/SelfType.fir.kt | 58 ++ .../jspecify/warnMode/SelfType.fir.txt} | 5 +- .../java8Tests/jspecify/warnMode/SelfType.kt | 58 ++ .../jspecify/warnMode}/SelfType.txt | 6 +- .../jspecify/warnMode/Simple.fir.kt | 38 + .../jspecify/warnMode/Simple.fir.txt} | 10 - .../java8Tests/jspecify/warnMode/Simple.kt | 38 + .../java8Tests/jspecify/warnMode}/Simple.txt | 9 - .../TypeArgumentsFromParameterBounds.fir.kt | 49 ++ .../TypeArgumentsFromParameterBounds.fir.txt} | 26 +- .../TypeArgumentsFromParameterBounds.kt | 49 ++ .../TypeArgumentsFromParameterBounds.txt | 25 +- .../warnMode/TypeParameterBounds.fir.kt | 47 ++ .../warnMode/TypeParameterBounds.fir.txt} | 8 - .../jspecify/warnMode/TypeParameterBounds.kt | 47 ++ .../warnMode}/TypeParameterBounds.txt | 7 - .../warnMode/WildcardsWithDefault.fir.kt} | 19 +- .../warnMode/WildcardsWithDefault.fir.txt} | 12 +- .../warnMode/WildcardsWithDefault.kt | 20 +- .../warnMode}/WildcardsWithDefault.txt | 13 +- .../jsr305/defaultAnnotationAppliedToType.kt | 5 +- .../jsr305/defaultAnnotationAppliedToType.txt | 0 ...tAnnotationAppliedToTypeForCompiledJava.kt | 5 +- ...AnnotationAppliedToTypeForCompiledJava.txt | 0 .../jsr305/springNullableWithTypeUse.kt | 5 +- .../jsr305/springNullableWithTypeUse.txt | 0 .../java8Tests/jsr305/typeArguments.kt | 8 +- .../java8Tests/jsr305/typeArguments.txt | 0 .../jsr305/typeUseVsMethodConflict.kt | 5 +- .../jsr305/typeUseVsMethodConflict.txt | 0 .../classTypeParameterBound.fir.kt} | 11 + .../onCompiled/classTypeParameterBound.kt | 25 + ...lassTypeParameterBoundWithWarnings.fir.kt} | 12 +- .../classTypeParameterBoundWithWarnings.kt | 25 + .../onCompiled/returnType.fir.kt | 65 ++ .../typeEnhancement/onCompiled/returnType.kt} | 25 +- .../onCompiled/returnTypeWithWarnings.fir.kt | 65 ++ .../onCompiled/returnTypeWithWarnings.kt} | 39 +- .../onCompiled/valueParameter.fir.kt} | 19 +- .../onCompiled/valueParameter.kt | 62 ++ .../valueParameterWithWarnings.fir.kt} | 19 +- .../onCompiled/valueParameterWithWarnings.kt | 62 ++ .../onSources/annotatedTypeArguments.fir.kt | 38 + .../onSources/annotatedTypeArguments.fir.txt} | 0 .../annotatedTypeArguments.javac.txt | 0 .../onSources}/annotatedTypeArguments.kt | 1 - .../onSources/annotatedTypeArguments.txt | 48 ++ .../onSources/methodWithTypeParameter.fir.kt | 54 ++ .../methodWithTypeParameter.fir.txt} | 0 .../methodWithTypeParameter.javac.txt | 0 .../onSources}/methodWithTypeParameter.kt | 1 - .../onSources/methodWithTypeParameter.txt | 44 ++ .../onSources/notNullVarargsOverrides.fir.kt | 21 + .../notNullVarargsOverrides.fir.txt} | 0 .../onSources}/notNullVarargsOverrides.kt | 1 - .../onSources/notNullVarargsOverrides.txt | 26 + .../onSources/nullableVarargsOverrides.fir.kt | 21 + .../nullableVarargsOverrides.fir.txt} | 0 .../onSources}/nullableVarargsOverrides.kt | 1 - .../onSources/nullableVarargsOverrides.txt | 26 + .../returnTypeDifferentConstructor.fir.kt | 37 + .../returnTypeDifferentConstructor.fir.txt} | 0 .../returnTypeDifferentConstructor.javac.txt | 0 .../returnTypeDifferentConstructor.kt | 1 - .../returnTypeDifferentConstructor.txt | 56 ++ .../returnTypeOverrideInKotlin.fir.kt | 31 + .../returnTypeOverrideInKotlin.fir.txt} | 0 .../onSources}/returnTypeOverrideInKotlin.kt | 2 - .../onSources/returnTypeOverrideInKotlin.txt | 56 ++ .../typeEnhancement/onSources/simple.fir.kt | 7 + .../typeEnhancement/onSources/simple.fir.txt} | 0 .../typeEnhancement/onSources}/simple.kt | 1 - .../typeEnhancement/onSources/simple.txt | 9 + .../java8Tests/typeUseOnObject.kt | 1 - .../java8Tests/typeUseOnObject.txt | 0 .../tests/androidRecently.kt | 3 +- .../tests/androidRecently.txt | 0 .../tests/androidSdk.kt | 3 +- .../tests/androidSdk.txt | 0 .../tests/android_support.kt | 3 +- .../tests/android_support.txt | 0 .../tests/androidx.kt | 3 +- .../tests/androidx.txt | 0 .../foreignAnnotationsTests}/tests/aosp.kt | 3 +- .../foreignAnnotationsTests}/tests/aosp.txt | 0 .../tests/checkerFramework.kt | 3 +- .../tests/checkerFramework.txt | 0 .../foreignAnnotationsTests}/tests/eclipse.kt | 3 +- .../tests/eclipse.txt | 0 .../tests/findBugsSimple.kt | 3 +- .../tests/findBugsSimple.txt | 0 .../tests/irrelevantQualifierNicknames.kt | 2 - .../tests/irrelevantQualifierNicknames.txt | 0 .../ignore/parametersAreNonnullByDefault.kt | 2 - .../ignore/parametersAreNonnullByDefault.txt | 0 .../tests/jsr305/nonNullNever.kt | 4 +- .../tests/jsr305/nonNullNever.txt | 0 .../tests/jsr305/nullabilityNicknames.kt | 4 +- .../tests/jsr305/nullabilityNicknames.txt | 0 .../tests/jsr305/nullabilityWarnings/elvis.kt | 0 .../jsr305/nullabilityWarnings/elvis.txt | 0 .../fromPlatformTypes/arithmetic.kt | 2 - .../fromPlatformTypes/arithmetic.txt | 0 .../fromPlatformTypes/array.kt | 2 - .../fromPlatformTypes/array.txt | 0 .../fromPlatformTypes/assignToVar.kt | 2 - .../fromPlatformTypes/assignToVar.txt | 0 .../fromPlatformTypes/conditions.kt | 2 - .../fromPlatformTypes/conditions.txt | 0 .../fromPlatformTypes/dataFlowInfo.kt | 2 - .../fromPlatformTypes/dataFlowInfo.txt | 0 .../fromPlatformTypes/defaultParameters.kt | 2 - .../fromPlatformTypes/defaultParameters.txt | 0 .../fromPlatformTypes/delegatedProperties.kt | 2 - .../fromPlatformTypes/delegatedProperties.txt | 0 .../fromPlatformTypes/delegation.kt | 2 - .../fromPlatformTypes/delegation.txt | 0 .../fromPlatformTypes/derefenceExtension.kt | 2 - .../fromPlatformTypes/derefenceExtension.txt | 0 .../fromPlatformTypes/derefenceMember.kt | 2 - .../fromPlatformTypes/derefenceMember.txt | 0 .../fromPlatformTypes/expectedType.kt | 2 - .../fromPlatformTypes/expectedType.txt | 0 .../fromPlatformTypes/for.kt | 2 - .../fromPlatformTypes/for.txt | 0 .../fromPlatformTypes/functionArguments.kt | 2 - .../fromPlatformTypes/functionArguments.txt | 0 .../fromPlatformTypes/invoke.kt | 2 - .../fromPlatformTypes/invoke.txt | 0 .../fromPlatformTypes/kt6829.kt | 2 - .../fromPlatformTypes/kt6829.txt | 0 .../fromPlatformTypes/multiDeclaration.kt | 2 - .../fromPlatformTypes/multiDeclaration.txt | 0 .../fromPlatformTypes/passToJava.kt | 2 - .../fromPlatformTypes/passToJava.txt | 0 .../fromPlatformTypes/primitiveArray.kt | 2 - .../fromPlatformTypes/primitiveArray.txt | 0 .../fromPlatformTypes/throw.kt | 2 - .../fromPlatformTypes/throw.txt | 0 .../uselessElvisRightIsNull.kt | 4 - .../uselessElvisRightIsNull.txt | 0 .../nullabilityWarnings/localInference.kt | 0 .../nullabilityWarnings/localInference.txt | 1 + .../nullabilityGenerics.kt | 1 - .../nullabilityGenerics.txt | 0 .../nullabilityNicknames.kt | 2 - .../nullabilityNicknames.txt | 0 .../jsr305/nullabilityWarnings/safeCalls.kt | 0 .../jsr305/nullabilityWarnings/safeCalls.txt | 1 + .../jsr305/nullabilityWarnings/simple.kt | 2 - .../jsr305/nullabilityWarnings/simple.txt | 0 .../jsr305/nullabilityWarnings/strange.kt | 2 - .../jsr305/nullabilityWarnings/strange.txt | 0 .../typeQualifierDefault/equalsOnNonNull.kt | 3 - .../typeQualifierDefault/equalsOnNonNull.txt | 0 .../typeQualifierDefault/fieldsAreNullable.kt | 2 - .../fieldsAreNullable.txt | 0 .../nullabilityFromOverridden.kt | 7 - .../nullabilityFromOverridden.txt | 0 .../overridingDefaultQualifier.kt | 4 - .../overridingDefaultQualifier.txt | 0 .../parametersAreNonnullByDefault.kt | 2 - .../parametersAreNonnullByDefault.txt | 0 .../parametersAreNonnullByDefaultPackage.kt | 4 - .../parametersAreNonnullByDefaultPackage.txt | 0 .../typeQualifierDefault/springNullable.kt | 4 - .../typeQualifierDefault/springNullable.txt | 0 .../springNullablePackage.kt | 5 - .../springNullablePackage.txt | 0 .../tests/jsr305/simple.kt | 4 +- .../tests/jsr305/simple.txt | 0 .../tests/jsr305/strange.kt | 4 +- .../tests/jsr305/strange.txt | 0 .../typeQualifierDefault/fieldsAreNullable.kt | 3 +- .../fieldsAreNullable.txt | 0 .../typeQualifierDefault/forceFlexibility.kt | 6 +- .../typeQualifierDefault/forceFlexibility.txt | 0 .../forceFlexibleOverOverrides.kt | 5 +- .../forceFlexibleOverOverrides.txt | 0 .../nullabilityFromOverridden.kt | 8 +- .../nullabilityFromOverridden.txt | 0 .../overridingDefaultQualifier.kt | 5 +- .../overridingDefaultQualifier.txt | 0 .../parametersAreNonnullByDefault.kt | 4 +- .../parametersAreNonnullByDefault.txt | 0 .../parametersAreNonnullByDefaultPackage.kt | 6 +- .../parametersAreNonnullByDefaultPackage.txt | 0 .../typeQualifierDefault/springNullable.kt | 5 +- .../typeQualifierDefault/springNullable.txt | 0 .../springNullablePackage.kt | 6 +- .../springNullablePackage.txt | 0 .../migration/customMigration.kt | 2 - .../migration/customMigration.txt | 0 .../migration/globalIgnore.kt | 2 - .../migration/globalIgnore.txt | 0 .../migration/globalWarningMigrationIgnore.kt | 2 - .../globalWarningMigrationIgnore.txt | 0 .../migration/migrationError.kt | 2 - .../migration/migrationError.txt | 0 .../migration/migrationIgnore.kt | 2 - .../migration/migrationIgnore.txt | 0 .../migration/migrationWarning.kt | 2 - .../migration/migrationWarning.txt | 0 .../migration/overrideConflicts.kt | 0 .../migration/overrideConflicts.txt | 0 .../migration/specialCollision.kt | 2 - .../migration/specialCollision.txt | 0 .../migration/stateRefinement.kt | 2 - .../migration/stateRefinement.txt | 0 .../tests/lombokSimple.kt | 3 +- .../tests/lombokSimple.txt | 0 .../foreignAnnotationsTests}/tests/rxjava.kt | 3 +- .../foreignAnnotationsTests}/tests/rxjava.txt | 0 .../defaultAndNicknameMigrationPolicy.kt | 5 - .../defaultAndNicknameMigrationPolicy.txt | 0 .../MyMigrationNonnull.java | 0 .../MyMigrationNullable.java | 0 .../jsr305_test_annotations}/MyNonnull.java | 0 .../jsr305_test_annotations}/MyNullable.java | 0 .../java/AnnotatedBoundsOfWildcard.java | 81 -- .../java8Tests/jspecify/java/Defaults.java | 44 -- .../jspecify/java/IgnoreAnnotations.java | 41 - .../java/NonPlatformTypeParameter.java | 26 - .../NullnessUnspecifiedTypeParameter.java | 30 - .../java8Tests/jspecify/java/SelfType.java | 40 - .../java8Tests/jspecify/java/Simple.java | 33 - .../TypeArgumentsFromParameterBounds.java | 53 -- .../jspecify/java/TypeParameterBounds.java | 44 -- .../jspecify/java/WildcardsWithDefault.java | 33 - .../kotlin/strictMode/IgnoreAnnotations.kt | 17 - .../strictMode/NonPlatformTypeParameter.kt | 16 - .../NullnessUnspecifiedTypeParameter.kt | 19 - .../jspecify/kotlin/strictMode/SelfType.kt | 21 - .../jspecify/kotlin/strictMode/Simple.kt | 11 - .../TypeArgumentsFromParameterBounds.kt | 32 - .../kotlin/strictMode/TypeParameterBounds.kt | 27 - .../kotlin/warnMode/IgnoreAnnotations.kt | 18 - .../warnMode/NonPlatformTypeParameter.kt | 17 - .../NullnessUnspecifiedTypeParameter.kt | 20 - .../jspecify/kotlin/warnMode/SelfType.kt | 22 - .../jspecify/kotlin/warnMode/Simple.kt | 12 - .../TypeArgumentsFromParameterBounds.kt | 33 - .../kotlin/warnMode/TypeParameterBounds.kt | 28 - .../ClassTypeParameterBound.java | 6 - .../ClassTypeParameterBoundWithWarnings.java | 6 - .../ReturnType.java | 13 - .../ReturnTypeWithWarnings.java | 13 - .../ValueParameter.java | 13 - .../ValueParameterWithWarnings.java | 13 - ...sNoAnnotationInClasspathTestGenerated.java | 706 ++++++++++++++---- ...spathWithPsiClassReadingTestGenerated.java | 706 ++++++++++++++---- .../ForeignAnnotationsTestGenerated.java | 706 ++++++++++++++---- .../ForeignAnnotationsDirectives.kt | 4 +- .../runners/AbstractForeignAnnotationsTest.kt | 8 +- .../JvmForeignAnnotationsConfigurator.kt | 17 +- .../checkers/ThirdPartyAnnotationPaths.kt | 2 +- .../generators/GenerateJUnit5CompilerTests.kt | 12 +- license/README.md | 2 +- .../javax/annotation/CheckForNull.java | 0 .../javax/annotation/Nonnull.java | 0 .../javax/annotation/Nullable.java | 0 .../ParametersAreNonnullByDefault.java | 0 .../javax/annotation/meta/TypeQualifier.java | 0 .../annotation/meta/TypeQualifierDefault.java | 0 .../meta/TypeQualifierNickname.java | 0 .../meta/TypeQualifierValidator.java | 0 .../javax/annotation/meta/When.java | 0 .../checker/nullness/qual/NonNull.java | 0 .../checker/nullness/qual/Nullable.java | 0 .../org/eclipse/jdt/annotation/NonNull.java | 0 .../org/eclipse/jdt/annotation/Nullable.java | 0 .../org/jetbrains/annotations/NotNull.java | 0 .../org/jetbrains/annotations/Nullable.java | 0 .../org/jspecify/nullness/NullMarked.java | 0 .../org/jspecify/nullness/Nullable.java | 0 .../nullness/NullnessUnspecified.java | 0 340 files changed, 5049 insertions(+), 1622 deletions(-) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/java8Tests/checkerFramework.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/java8Tests/checkerFramework.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/java8Tests/eclipse.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/java8Tests/eclipse.txt (100%) create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.fir.kt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.fir.txt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.kt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.txt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.fir.kt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.fir.txt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.kt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.txt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.fir.kt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.fir.txt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.kt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.txt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.fir.kt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.fir.txt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.kt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.txt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.fir.kt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.fir.txt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.kt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.txt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.fir.kt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.fir.txt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.kt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.txt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.fir.kt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.fir.txt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.kt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.txt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.fir.kt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.fir.txt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.kt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.txt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.fir.kt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.fir.txt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.kt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.txt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.fir.kt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.fir.txt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.kt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.txt rename compiler/testData/{foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/AnnotatedBoundsOfWildcard.kt => diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.fir.kt} (62%) rename compiler/testData/{foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/AnnotatedBoundsOfWildcard.txt => diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.fir.txt} (61%) rename compiler/testData/{foreignAnnotations/java8Tests/jspecify/kotlin/strictMode => diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode}/AnnotatedBoundsOfWildcard.kt (62%) rename compiler/testData/{foreignAnnotations/java8Tests/jspecify/kotlin => diagnostics/foreignAnnotationsTests/java8Tests/jspecify}/warnMode/AnnotatedBoundsOfWildcard.txt (61%) rename compiler/testData/{foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/Defaults.kt => diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Defaults.fir.kt} (51%) rename compiler/testData/{foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/Defaults.txt => diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Defaults.fir.txt} (79%) rename compiler/testData/{foreignAnnotations/java8Tests/jspecify/kotlin/strictMode => diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode}/Defaults.kt (51%) rename compiler/testData/{foreignAnnotations/java8Tests/jspecify/kotlin/strictMode => diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode}/Defaults.txt (79%) create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.fir.kt rename compiler/testData/{foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/IgnoreAnnotations.txt => diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.fir.txt} (82%) create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.kt rename compiler/testData/{foreignAnnotations/java8Tests/jspecify/kotlin/strictMode => diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode}/IgnoreAnnotations.txt (82%) create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.fir.kt rename compiler/testData/{foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/NonPlatformTypeParameter.txt => diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.fir.txt} (66%) create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.kt rename compiler/testData/{foreignAnnotations/java8Tests/jspecify/kotlin => diagnostics/foreignAnnotationsTests/java8Tests/jspecify}/warnMode/NonPlatformTypeParameter.txt (66%) create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.fir.kt rename compiler/testData/{foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/NullnessUnspecifiedTypeParameter.txt => diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.fir.txt} (66%) create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.kt rename compiler/testData/{foreignAnnotations/java8Tests/jspecify/kotlin/strictMode => diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode}/NullnessUnspecifiedTypeParameter.txt (66%) create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.fir.kt rename compiler/testData/{foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/SelfType.txt => diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.fir.txt} (93%) create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.kt rename compiler/testData/{foreignAnnotations/java8Tests/jspecify/kotlin/strictMode => diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode}/SelfType.txt (93%) create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.fir.kt rename compiler/testData/{foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/Simple.txt => diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.fir.txt} (76%) create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.kt rename compiler/testData/{foreignAnnotations/java8Tests/jspecify/kotlin/strictMode => diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode}/Simple.txt (76%) create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.fir.kt rename compiler/testData/{foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/TypeArgumentsFromParameterBounds.txt => diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.fir.txt} (57%) create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.kt rename compiler/testData/{foreignAnnotations/java8Tests/jspecify/kotlin/strictMode => diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode}/TypeArgumentsFromParameterBounds.txt (57%) create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.fir.kt rename compiler/testData/{foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/TypeParameterBounds.txt => diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.fir.txt} (71%) create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.kt rename compiler/testData/{foreignAnnotations/java8Tests/jspecify/kotlin/strictMode => diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode}/TypeParameterBounds.txt (71%) rename compiler/testData/{foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/WildcardsWithDefault.kt => diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.fir.kt} (59%) rename compiler/testData/{foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/WildcardsWithDefault.txt => diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.fir.txt} (60%) rename compiler/testData/{foreignAnnotations/java8Tests/jspecify/kotlin => diagnostics/foreignAnnotationsTests/java8Tests/jspecify}/warnMode/WildcardsWithDefault.kt (59%) rename compiler/testData/{foreignAnnotations/java8Tests/jspecify/kotlin/strictMode => diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode}/WildcardsWithDefault.txt (60%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/java8Tests/jsr305/defaultAnnotationAppliedToType.kt (98%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/java8Tests/jsr305/defaultAnnotationAppliedToType.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/java8Tests/jsr305/defaultAnnotationAppliedToTypeForCompiledJava.kt (98%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/java8Tests/jsr305/defaultAnnotationAppliedToTypeForCompiledJava.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/java8Tests/jsr305/springNullableWithTypeUse.kt (98%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/java8Tests/jsr305/springNullableWithTypeUse.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/java8Tests/jsr305/typeArguments.kt (98%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/java8Tests/jsr305/typeArguments.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/java8Tests/jsr305/typeUseVsMethodConflict.kt (98%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/java8Tests/jsr305/typeUseVsMethodConflict.txt (100%) rename compiler/testData/{foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ClassTypeParameterBound.kt => diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/classTypeParameterBound.fir.kt} (73%) create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/classTypeParameterBound.kt rename compiler/testData/{foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ClassTypeParameterBoundWithWarnings.kt => diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/classTypeParameterBoundWithWarnings.fir.kt} (71%) create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/classTypeParameterBoundWithWarnings.kt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/returnType.fir.kt rename compiler/testData/{foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ReturnType.kt => diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/returnType.kt} (80%) create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/returnTypeWithWarnings.fir.kt rename compiler/testData/{foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ReturnTypeWithWarnings.kt => diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/returnTypeWithWarnings.kt} (72%) rename compiler/testData/{foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ValueParameter.kt => diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/valueParameter.fir.kt} (79%) create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/valueParameter.kt rename compiler/testData/{foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ValueParameterWithWarnings.kt => diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/valueParameterWithWarnings.fir.kt} (81%) create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/valueParameterWithWarnings.kt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/annotatedTypeArguments.fir.kt rename compiler/testData/{foreignAnnotations/java8Tests/typeEnhancement/annotatedTypeArguments.txt => diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/annotatedTypeArguments.fir.txt} (100%) rename compiler/testData/{foreignAnnotations/java8Tests/typeEnhancement => diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources}/annotatedTypeArguments.javac.txt (100%) rename compiler/testData/{foreignAnnotations/java8Tests/typeEnhancement => diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources}/annotatedTypeArguments.kt (99%) create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/annotatedTypeArguments.txt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/methodWithTypeParameter.fir.kt rename compiler/testData/{foreignAnnotations/java8Tests/typeEnhancement/methodWithTypeParameter.txt => diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/methodWithTypeParameter.fir.txt} (100%) rename compiler/testData/{foreignAnnotations/java8Tests/typeEnhancement => diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources}/methodWithTypeParameter.javac.txt (100%) rename compiler/testData/{foreignAnnotations/java8Tests/typeEnhancement => diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources}/methodWithTypeParameter.kt (99%) create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/methodWithTypeParameter.txt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/notNullVarargsOverrides.fir.kt rename compiler/testData/{foreignAnnotations/java8Tests/typeEnhancement/notNullVarargsOverrides.txt => diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/notNullVarargsOverrides.fir.txt} (100%) rename compiler/testData/{foreignAnnotations/java8Tests/typeEnhancement => diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources}/notNullVarargsOverrides.kt (99%) create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/notNullVarargsOverrides.txt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/nullableVarargsOverrides.fir.kt rename compiler/testData/{foreignAnnotations/java8Tests/typeEnhancement/nullableVarargsOverrides.txt => diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/nullableVarargsOverrides.fir.txt} (100%) rename compiler/testData/{foreignAnnotations/java8Tests/typeEnhancement => diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources}/nullableVarargsOverrides.kt (99%) create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/nullableVarargsOverrides.txt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeDifferentConstructor.fir.kt rename compiler/testData/{foreignAnnotations/java8Tests/typeEnhancement/returnTypeDifferentConstructor.txt => diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeDifferentConstructor.fir.txt} (100%) rename compiler/testData/{foreignAnnotations/java8Tests/typeEnhancement => diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources}/returnTypeDifferentConstructor.javac.txt (100%) rename compiler/testData/{foreignAnnotations/java8Tests/typeEnhancement => diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources}/returnTypeDifferentConstructor.kt (99%) create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeDifferentConstructor.txt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeOverrideInKotlin.fir.kt rename compiler/testData/{foreignAnnotations/java8Tests/typeEnhancement/returnTypeOverrideInKotlin.txt => diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeOverrideInKotlin.fir.txt} (100%) rename compiler/testData/{foreignAnnotations/java8Tests/typeEnhancement => diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources}/returnTypeOverrideInKotlin.kt (99%) create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeOverrideInKotlin.txt create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/simple.fir.kt rename compiler/testData/{foreignAnnotations/java8Tests/typeEnhancement/simple.txt => diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/simple.fir.txt} (100%) rename compiler/testData/{foreignAnnotations/java8Tests/typeEnhancement => diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources}/simple.kt (99%) create mode 100644 compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/simple.txt rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/java8Tests/typeUseOnObject.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/java8Tests/typeUseOnObject.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/androidRecently.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/androidRecently.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/androidSdk.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/androidSdk.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/android_support.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/android_support.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/androidx.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/androidx.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/aosp.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/aosp.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/checkerFramework.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/checkerFramework.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/eclipse.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/eclipse.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/findBugsSimple.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/findBugsSimple.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/irrelevantQualifierNicknames.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/irrelevantQualifierNicknames.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/ignore/parametersAreNonnullByDefault.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/ignore/parametersAreNonnullByDefault.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nonNullNever.kt (96%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nonNullNever.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityNicknames.kt (98%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityNicknames.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/elvis.kt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/elvis.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/arithmetic.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/arithmetic.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/array.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/array.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/assignToVar.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/assignToVar.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/conditions.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/conditions.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/dataFlowInfo.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/dataFlowInfo.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/defaultParameters.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/defaultParameters.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegatedProperties.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegatedProperties.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegation.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegation.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceExtension.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceExtension.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceMember.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceMember.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/expectedType.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/expectedType.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/for.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/for.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/functionArguments.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/functionArguments.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/invoke.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/invoke.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/kt6829.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/kt6829.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/multiDeclaration.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/multiDeclaration.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/passToJava.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/passToJava.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/primitiveArray.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/primitiveArray.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/throw.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/throw.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/uselessElvisRightIsNull.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/fromPlatformTypes/uselessElvisRightIsNull.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/localInference.kt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/localInference.txt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/nullabilityGenerics.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/nullabilityGenerics.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/nullabilityNicknames.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/nullabilityNicknames.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/safeCalls.kt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/safeCalls.txt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/simple.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/simple.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/strange.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/strange.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/typeQualifierDefault/equalsOnNonNull.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/typeQualifierDefault/equalsOnNonNull.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/typeQualifierDefault/fieldsAreNullable.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/typeQualifierDefault/fieldsAreNullable.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/typeQualifierDefault/nullabilityFromOverridden.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/typeQualifierDefault/nullabilityFromOverridden.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/typeQualifierDefault/overridingDefaultQualifier.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/typeQualifierDefault/overridingDefaultQualifier.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefault.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefault.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefaultPackage.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefaultPackage.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullable.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullable.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullablePackage.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullablePackage.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/simple.kt (95%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/simple.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/strange.kt (95%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/strange.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/typeQualifierDefault/fieldsAreNullable.kt (97%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/typeQualifierDefault/fieldsAreNullable.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/typeQualifierDefault/forceFlexibility.kt (98%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/typeQualifierDefault/forceFlexibility.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/typeQualifierDefault/forceFlexibleOverOverrides.kt (98%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/typeQualifierDefault/forceFlexibleOverOverrides.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/typeQualifierDefault/nullabilityFromOverridden.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/typeQualifierDefault/nullabilityFromOverridden.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/typeQualifierDefault/overridingDefaultQualifier.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/typeQualifierDefault/overridingDefaultQualifier.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefault.kt (95%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefault.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefaultPackage.kt (97%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefaultPackage.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/typeQualifierDefault/springNullable.kt (98%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/typeQualifierDefault/springNullable.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/typeQualifierDefault/springNullablePackage.kt (98%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305/typeQualifierDefault/springNullablePackage.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305NullabilityWarnings/migration/customMigration.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305NullabilityWarnings/migration/customMigration.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305NullabilityWarnings/migration/globalIgnore.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305NullabilityWarnings/migration/globalIgnore.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305NullabilityWarnings/migration/globalWarningMigrationIgnore.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305NullabilityWarnings/migration/globalWarningMigrationIgnore.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305NullabilityWarnings/migration/migrationError.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305NullabilityWarnings/migration/migrationError.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305NullabilityWarnings/migration/migrationIgnore.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305NullabilityWarnings/migration/migrationIgnore.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305NullabilityWarnings/migration/migrationWarning.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305NullabilityWarnings/migration/migrationWarning.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305NullabilityWarnings/migration/overrideConflicts.kt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305NullabilityWarnings/migration/overrideConflicts.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305NullabilityWarnings/migration/specialCollision.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305NullabilityWarnings/migration/specialCollision.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305NullabilityWarnings/migration/stateRefinement.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/jsr305NullabilityWarnings/migration/stateRefinement.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/lombokSimple.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/lombokSimple.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/rxjava.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/rxjava.txt (100%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/typeQualifierDefault/defaultAndNicknameMigrationPolicy.kt (99%) rename compiler/testData/{foreignAnnotations => diagnostics/foreignAnnotationsTests}/tests/typeQualifierDefault/defaultAndNicknameMigrationPolicy.txt (100%) rename compiler/testData/{foreignAnnotations/testAnnotations => diagnostics/helpers/jsr305_test_annotations}/MyMigrationNonnull.java (100%) rename compiler/testData/{foreignAnnotations/testAnnotations => diagnostics/helpers/jsr305_test_annotations}/MyMigrationNullable.java (100%) rename compiler/testData/{foreignAnnotations/testAnnotations => diagnostics/helpers/jsr305_test_annotations}/MyNonnull.java (100%) rename compiler/testData/{foreignAnnotations/testAnnotations => diagnostics/helpers/jsr305_test_annotations}/MyNullable.java (100%) delete mode 100644 compiler/testData/foreignAnnotations/java8Tests/jspecify/java/AnnotatedBoundsOfWildcard.java delete mode 100644 compiler/testData/foreignAnnotations/java8Tests/jspecify/java/Defaults.java delete mode 100644 compiler/testData/foreignAnnotations/java8Tests/jspecify/java/IgnoreAnnotations.java delete mode 100644 compiler/testData/foreignAnnotations/java8Tests/jspecify/java/NonPlatformTypeParameter.java delete mode 100644 compiler/testData/foreignAnnotations/java8Tests/jspecify/java/NullnessUnspecifiedTypeParameter.java delete mode 100644 compiler/testData/foreignAnnotations/java8Tests/jspecify/java/SelfType.java delete mode 100644 compiler/testData/foreignAnnotations/java8Tests/jspecify/java/Simple.java delete mode 100644 compiler/testData/foreignAnnotations/java8Tests/jspecify/java/TypeArgumentsFromParameterBounds.java delete mode 100644 compiler/testData/foreignAnnotations/java8Tests/jspecify/java/TypeParameterBounds.java delete mode 100644 compiler/testData/foreignAnnotations/java8Tests/jspecify/java/WildcardsWithDefault.java delete mode 100644 compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/IgnoreAnnotations.kt delete mode 100644 compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/NonPlatformTypeParameter.kt delete mode 100644 compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/NullnessUnspecifiedTypeParameter.kt delete mode 100644 compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/SelfType.kt delete mode 100644 compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/Simple.kt delete mode 100644 compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/TypeArgumentsFromParameterBounds.kt delete mode 100644 compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/TypeParameterBounds.kt delete mode 100644 compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/IgnoreAnnotations.kt delete mode 100644 compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/NonPlatformTypeParameter.kt delete mode 100644 compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/NullnessUnspecifiedTypeParameter.kt delete mode 100644 compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/SelfType.kt delete mode 100644 compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/Simple.kt delete mode 100644 compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/TypeArgumentsFromParameterBounds.kt delete mode 100644 compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/TypeParameterBounds.kt delete mode 100644 compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ClassTypeParameterBound.java delete mode 100644 compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ClassTypeParameterBoundWithWarnings.java delete mode 100644 compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ReturnType.java delete mode 100644 compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ReturnTypeWithWarnings.java delete mode 100644 compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ValueParameter.java delete mode 100644 compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ValueParameterWithWarnings.java rename third-party/{jdk8-annotations => java8-annotations}/javax/annotation/CheckForNull.java (100%) rename third-party/{jdk8-annotations => java8-annotations}/javax/annotation/Nonnull.java (100%) rename third-party/{jdk8-annotations => java8-annotations}/javax/annotation/Nullable.java (100%) rename third-party/{jdk8-annotations => java8-annotations}/javax/annotation/ParametersAreNonnullByDefault.java (100%) rename third-party/{jdk8-annotations => java8-annotations}/javax/annotation/meta/TypeQualifier.java (100%) rename third-party/{jdk8-annotations => java8-annotations}/javax/annotation/meta/TypeQualifierDefault.java (100%) rename third-party/{jdk8-annotations => java8-annotations}/javax/annotation/meta/TypeQualifierNickname.java (100%) rename third-party/{jdk8-annotations => java8-annotations}/javax/annotation/meta/TypeQualifierValidator.java (100%) rename third-party/{jdk8-annotations => java8-annotations}/javax/annotation/meta/When.java (100%) rename third-party/{jdk8-annotations => java8-annotations}/org/checkerframework/checker/nullness/qual/NonNull.java (100%) rename third-party/{jdk8-annotations => java8-annotations}/org/checkerframework/checker/nullness/qual/Nullable.java (100%) rename third-party/{jdk8-annotations => java8-annotations}/org/eclipse/jdt/annotation/NonNull.java (100%) rename third-party/{jdk8-annotations => java8-annotations}/org/eclipse/jdt/annotation/Nullable.java (100%) rename third-party/{jdk8-annotations => java8-annotations}/org/jetbrains/annotations/NotNull.java (100%) rename third-party/{jdk8-annotations => java8-annotations}/org/jetbrains/annotations/Nullable.java (100%) rename third-party/{jdk8-annotations => java8-annotations}/org/jspecify/nullness/NullMarked.java (100%) rename third-party/{jdk8-annotations => java8-annotations}/org/jspecify/nullness/Nullable.java (100%) rename third-party/{jdk8-annotations => java8-annotations}/org/jspecify/nullness/NullnessUnspecified.java (100%) diff --git a/compiler/testData/foreignAnnotations/java8Tests/checkerFramework.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/checkerFramework.kt similarity index 99% rename from compiler/testData/foreignAnnotations/java8Tests/checkerFramework.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/checkerFramework.kt index 356b008d995..866a4defba3 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/checkerFramework.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/checkerFramework.kt @@ -1,7 +1,6 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER // SOURCE_RETENTION_ANNOTATIONS // FILE: A.java - import org.checkerframework.checker.nullness.qual.*; public class A { @@ -22,7 +21,6 @@ public class A { } // FILE: main.kt - fun main(a: A, a1: A) { a.foo("", null)?.length a.foo("", null).length diff --git a/compiler/testData/foreignAnnotations/java8Tests/checkerFramework.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/checkerFramework.txt similarity index 100% rename from compiler/testData/foreignAnnotations/java8Tests/checkerFramework.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/checkerFramework.txt diff --git a/compiler/testData/foreignAnnotations/java8Tests/eclipse.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/eclipse.kt similarity index 99% rename from compiler/testData/foreignAnnotations/java8Tests/eclipse.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/eclipse.kt index b0377e9c1d7..63c216a65d2 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/eclipse.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/eclipse.kt @@ -1,7 +1,6 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER // SOURCE_RETENTION_ANNOTATIONS // FILE: A.java - import org.eclipse.jdt.annotation.*; public class A { @@ -22,7 +21,6 @@ public class A { } // FILE: main.kt - fun main(a: A, a1: A) { a.foo("", null)?.length a.foo("", null).length diff --git a/compiler/testData/foreignAnnotations/java8Tests/eclipse.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/eclipse.txt similarity index 100% rename from compiler/testData/foreignAnnotations/java8Tests/eclipse.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/eclipse.txt diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.fir.kt new file mode 100644 index 00000000000..a446bc18b3b --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.fir.kt @@ -0,0 +1,88 @@ +// JSPECIFY_STATE: strict + +// FILE: AnnotatedBoundsOfWildcard.java +import org.jspecify.nullness.*; + +@NullMarked +public class AnnotatedBoundsOfWildcard { + public void superAsIs(Test a) {} + public void superNotNull(Test a) {} + public void superNullable(Test a) {} + + public void extendsAsIs(Test a) {} + public void extendsNotNull(Test a) {} + public void extendsNullable(Test a) {} + + public void noBounds(Test a) {} +} + +// FILE: Base.java +public class Base {} + +// FILE: Derived.java +public class Derived extends Base {} + +// FILE: Test.java +import org.jspecify.nullness.*; + +@NullMarked +public class Test { } + +// FILE: main.kt +fun main( + aNotNullNotNullNotNull: Test, + aNotNullNotNullNull: Test, + aNotNullNullNotNull: Test, + aNotNullNullNull: Test, + + aAnyNotNullNotNullNotNull: Test, + aAnyNotNullNotNullNull: Test, + aAnyNotNullNullNotNull: Test, + aAnyNotNullNullNull: Test, + + b: AnnotatedBoundsOfWildcard +): Unit { + // jspecify_nullness_mismatch + b.superAsIs(aAnyNotNullNotNullNotNull) + // jspecify_nullness_mismatch + b.superAsIs(aAnyNotNullNotNullNull) + b.superAsIs(aAnyNotNullNullNotNull) + b.superAsIs(aAnyNotNullNullNull) + + b.superNotNull(aAnyNotNullNotNullNotNull) + b.superNotNull(aAnyNotNullNotNullNull) + b.superNotNull(aAnyNotNullNullNotNull) + b.superNotNull(aAnyNotNullNullNull) + + // jspecify_nullness_mismatch + b.superNullable(aAnyNotNullNotNullNotNull) + // jspecify_nullness_mismatch + b.superNullable(aAnyNotNullNotNullNull) + // jspecify_nullness_mismatch + b.superNullable(aAnyNotNullNullNotNull) + // jspecify_nullness_mismatch + b.superNullable(aAnyNotNullNullNull) + + b.extendsAsIs(aNotNullNotNullNotNull) + b.extendsAsIs(aNotNullNotNullNull) + b.extendsAsIs(aNotNullNullNotNull) + b.extendsAsIs(aNotNullNullNull) + + b.extendsNotNull(aNotNullNotNullNotNull) + // jspecify_nullness_mismatch + b.extendsNotNull(aNotNullNotNullNull) + // jspecify_nullness_mismatch + b.extendsNotNull(aNotNullNullNotNull) + // jspecify_nullness_mismatch + b.extendsNotNull(aNotNullNullNull) + + b.extendsNullable(aNotNullNotNullNotNull) + b.extendsNullable(aNotNullNotNullNull) + b.extendsNullable(aNotNullNullNotNull) + b.extendsNullable(aNotNullNullNull) + + b.noBounds(aNotNullNotNullNotNull) + b.noBounds(aNotNullNotNullNull) + b.noBounds(aNotNullNullNotNull) + b.noBounds(aNotNullNullNull) +} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.fir.txt new file mode 100644 index 00000000000..0dc4cd5bf45 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.fir.txt @@ -0,0 +1,38 @@ +package + +public fun main(/*0*/ aNotNullNotNullNotNull: Test, /*1*/ aNotNullNotNullNull: Test, /*2*/ aNotNullNullNotNull: Test, /*3*/ aNotNullNullNull: Test, /*4*/ aAnyNotNullNotNullNotNull: Test, /*5*/ aAnyNotNullNotNullNull: Test, /*6*/ aAnyNotNullNullNotNull: Test, /*7*/ aAnyNotNullNullNull: Test, /*8*/ b: AnnotatedBoundsOfWildcard): kotlin.Unit + +@org.jspecify.nullness.NullMarked public open class AnnotatedBoundsOfWildcard { + public constructor AnnotatedBoundsOfWildcard() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open fun extendsAsIs(/*0*/ a: Test): kotlin.Unit + public open fun extendsNotNull(/*0*/ a: Test): kotlin.Unit + public open fun extendsNullable(/*0*/ a: Test): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open fun noBounds(/*0*/ a: Test): kotlin.Unit + public open fun superAsIs(/*0*/ a: Test): kotlin.Unit + public open fun superNotNull(/*0*/ a: Test): kotlin.Unit + public open fun superNullable(/*0*/ a: Test): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public open class Base { + public constructor Base() + 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 open class Derived : Base { + public constructor Derived() + 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 +} + +@org.jspecify.nullness.NullMarked public open class Test { + public constructor Test() + 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 +} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.kt new file mode 100644 index 00000000000..6454fe49b75 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.kt @@ -0,0 +1,88 @@ +// JSPECIFY_STATE: strict + +// FILE: AnnotatedBoundsOfWildcard.java +import org.jspecify.nullness.*; + +@NullMarked +public class AnnotatedBoundsOfWildcard { + public void superAsIs(Test a) {} + public void superNotNull(Test a) {} + public void superNullable(Test a) {} + + public void extendsAsIs(Test a) {} + public void extendsNotNull(Test a) {} + public void extendsNullable(Test a) {} + + public void noBounds(Test a) {} +} + +// FILE: Base.java +public class Base {} + +// FILE: Derived.java +public class Derived extends Base {} + +// FILE: Test.java +import org.jspecify.nullness.*; + +@NullMarked +public class Test { } + +// FILE: main.kt +fun main( + aNotNullNotNullNotNull: Test, + aNotNullNotNullNull: Test, + aNotNullNullNotNull: Test, + aNotNullNullNull: Test, + + aAnyNotNullNotNullNotNull: Test, + aAnyNotNullNotNullNull: Test, + aAnyNotNullNullNotNull: Test, + aAnyNotNullNullNull: Test, + + b: AnnotatedBoundsOfWildcard +): Unit { + // jspecify_nullness_mismatch + b.superAsIs(aAnyNotNullNotNullNotNull) + // jspecify_nullness_mismatch + b.superAsIs(aAnyNotNullNotNullNull) + b.superAsIs(aAnyNotNullNullNotNull) + b.superAsIs(aAnyNotNullNullNull) + + b.superNotNull(aAnyNotNullNotNullNotNull) + b.superNotNull(aAnyNotNullNotNullNull) + b.superNotNull(aAnyNotNullNullNotNull) + b.superNotNull(aAnyNotNullNullNull) + + // jspecify_nullness_mismatch + b.superNullable(aAnyNotNullNotNullNotNull) + // jspecify_nullness_mismatch + b.superNullable(aAnyNotNullNotNullNull) + // jspecify_nullness_mismatch + b.superNullable(aAnyNotNullNullNotNull) + // jspecify_nullness_mismatch + b.superNullable(aAnyNotNullNullNull) + + b.extendsAsIs(aNotNullNotNullNotNull) + b.extendsAsIs(aNotNullNotNullNull) + b.extendsAsIs(aNotNullNullNotNull) + b.extendsAsIs(aNotNullNullNull) + + b.extendsNotNull(aNotNullNotNullNotNull) + // jspecify_nullness_mismatch + b.extendsNotNull(aNotNullNotNullNull) + // jspecify_nullness_mismatch + b.extendsNotNull(aNotNullNullNotNull) + // jspecify_nullness_mismatch + b.extendsNotNull(aNotNullNullNull) + + b.extendsNullable(aNotNullNotNullNotNull) + b.extendsNullable(aNotNullNotNullNull) + b.extendsNullable(aNotNullNullNotNull) + b.extendsNullable(aNotNullNullNull) + + b.noBounds(aNotNullNotNullNotNull) + b.noBounds(aNotNullNotNullNull) + b.noBounds(aNotNullNullNotNull) + b.noBounds(aNotNullNullNull) +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.txt new file mode 100644 index 00000000000..f1c2da5e670 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.txt @@ -0,0 +1,39 @@ +package + +public fun main(/*0*/ aNotNullNotNullNotNull: Test, /*1*/ aNotNullNotNullNull: Test, /*2*/ aNotNullNullNotNull: Test, /*3*/ aNotNullNullNull: Test, /*4*/ aAnyNotNullNotNullNotNull: Test, /*5*/ aAnyNotNullNotNullNull: Test, /*6*/ aAnyNotNullNullNotNull: Test, /*7*/ aAnyNotNullNullNull: Test, /*8*/ b: AnnotatedBoundsOfWildcard): kotlin.Unit + +@org.jspecify.nullness.NullMarked public open class AnnotatedBoundsOfWildcard { + public constructor AnnotatedBoundsOfWildcard() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open fun extendsAsIs(/*0*/ a: Test): kotlin.Unit + public open fun extendsNotNull(/*0*/ a: Test): kotlin.Unit + public open fun extendsNullable(/*0*/ a: Test): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open fun noBounds(/*0*/ a: Test): kotlin.Unit + public open fun superAsIs(/*0*/ a: Test): kotlin.Unit + public open fun superNotNull(/*0*/ a: Test): kotlin.Unit + public open fun superNullable(/*0*/ a: Test): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public open class Base { + public constructor Base() + 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 open class Derived : Base { + public constructor Derived() + 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 +} + +@org.jspecify.nullness.NullMarked public open class Test { + public constructor Test() + 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 +} + diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.fir.kt new file mode 100644 index 00000000000..0cfa09edac7 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.fir.kt @@ -0,0 +1,50 @@ +// JSPECIFY_STATE: strict + +// FILE: Defaults.java +import org.jspecify.nullness.*; + +@NullMarked +public class Defaults { + public Foo defaultField = null; + @Nullable public Foo field = null; + + public Foo everythingNotNullable(Foo x) { return null; } + + public @Nullable Foo everythingNullable(@Nullable Foo x) { return null; } + + public @NullnessUnspecified Foo everythingUnknown(@NullnessUnspecified Foo x) { return null; } + + public @Nullable Foo mixed(Foo x) { return null; } + + public Foo explicitlyNullnessUnspecified(@NullnessUnspecified Foo x) { return null; } +} + +// FILE: Foo.java +public class Foo { + public Object foo() { return null; } +} + +// FILE: main.kt +fun main(a: Defaults, x: Foo): Unit { + // jspecify_nullness_mismatch + a.everythingNotNullable(null).foo() + a.everythingNotNullable(x).foo() + + // jspecify_nullness_mismatch + a.everythingNullable(null).foo() + + a.everythingUnknown(null).foo() + + // jspecify_nullness_mismatch + a.mixed(null).foo() + // jspecify_nullness_mismatch + a.mixed(x).foo() + + a.explicitlyNullnessUnspecified(x).foo() + a.explicitlyNullnessUnspecified(null).foo() + + a.defaultField.foo() + + // jspecify_nullness_mismatch + a.field.foo() +} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.fir.txt new file mode 100644 index 00000000000..b2c18d47bf5 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.fir.txt @@ -0,0 +1,25 @@ +package + +public fun main(/*0*/ a: Defaults, /*1*/ x: Foo): kotlin.Unit + +@org.jspecify.nullness.NullMarked public open class Defaults { + public constructor Defaults() + public final var defaultField: Foo + @org.jspecify.nullness.Nullable public final var field: @org.jspecify.nullness.Nullable Foo? + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open fun everythingNotNullable(/*0*/ x: Foo): Foo + @org.jspecify.nullness.Nullable public open fun everythingNullable(/*0*/ @org.jspecify.nullness.Nullable x: @org.jspecify.nullness.Nullable Foo?): @org.jspecify.nullness.Nullable Foo? + @org.jspecify.nullness.NullnessUnspecified public open fun everythingUnknown(/*0*/ @org.jspecify.nullness.NullnessUnspecified x: @org.jspecify.nullness.NullnessUnspecified Foo!): @org.jspecify.nullness.NullnessUnspecified Foo! + public open fun explicitlyNullnessUnspecified(/*0*/ @org.jspecify.nullness.NullnessUnspecified x: @org.jspecify.nullness.NullnessUnspecified Foo!): Foo + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + @org.jspecify.nullness.Nullable public open fun mixed(/*0*/ x: Foo): @org.jspecify.nullness.Nullable Foo? + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public open class Foo { + public constructor Foo() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open fun foo(): kotlin.Any! + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.kt new file mode 100644 index 00000000000..8ac3346eaa1 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.kt @@ -0,0 +1,50 @@ +// JSPECIFY_STATE: strict + +// FILE: Defaults.java +import org.jspecify.nullness.*; + +@NullMarked +public class Defaults { + public Foo defaultField = null; + @Nullable public Foo field = null; + + public Foo everythingNotNullable(Foo x) { return null; } + + public @Nullable Foo everythingNullable(@Nullable Foo x) { return null; } + + public @NullnessUnspecified Foo everythingUnknown(@NullnessUnspecified Foo x) { return null; } + + public @Nullable Foo mixed(Foo x) { return null; } + + public Foo explicitlyNullnessUnspecified(@NullnessUnspecified Foo x) { return null; } +} + +// FILE: Foo.java +public class Foo { + public Object foo() { return null; } +} + +// FILE: main.kt +fun main(a: Defaults, x: Foo): Unit { + // jspecify_nullness_mismatch + a.everythingNotNullable(null).foo() + a.everythingNotNullable(x).foo() + + // jspecify_nullness_mismatch + a.everythingNullable(null).foo() + + a.everythingUnknown(null).foo() + + // jspecify_nullness_mismatch + a.mixed(null).foo() + // jspecify_nullness_mismatch + a.mixed(x).foo() + + a.explicitlyNullnessUnspecified(x).foo() + a.explicitlyNullnessUnspecified(null).foo() + + a.defaultField.foo() + + // jspecify_nullness_mismatch + a.field.foo() +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.txt new file mode 100644 index 00000000000..b68c64fe3a0 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.txt @@ -0,0 +1,26 @@ +package + +public fun main(/*0*/ a: Defaults, /*1*/ x: Foo): kotlin.Unit + +@org.jspecify.nullness.NullMarked public open class Defaults { + public constructor Defaults() + public final var defaultField: Foo + @org.jspecify.nullness.Nullable public final var field: @org.jspecify.nullness.Nullable Foo? + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open fun everythingNotNullable(/*0*/ x: Foo): Foo + @org.jspecify.nullness.Nullable public open fun everythingNullable(/*0*/ @org.jspecify.nullness.Nullable x: @org.jspecify.nullness.Nullable Foo?): @org.jspecify.nullness.Nullable Foo? + @org.jspecify.nullness.NullnessUnspecified public open fun everythingUnknown(/*0*/ @org.jspecify.nullness.NullnessUnspecified x: @org.jspecify.nullness.NullnessUnspecified Foo!): @org.jspecify.nullness.NullnessUnspecified Foo! + public open fun explicitlyNullnessUnspecified(/*0*/ @org.jspecify.nullness.NullnessUnspecified x: @org.jspecify.nullness.NullnessUnspecified Foo!): Foo + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + @org.jspecify.nullness.Nullable public open fun mixed(/*0*/ x: Foo): @org.jspecify.nullness.Nullable Foo? + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public open class Foo { + public constructor Foo() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open fun foo(): kotlin.Any! + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.fir.kt new file mode 100644 index 00000000000..d959bf5b316 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.fir.kt @@ -0,0 +1,48 @@ +// JSPECIFY_STATE: strict + +// FILE: IgnoreAnnotations.java +import org.jspecify.nullness.*; + +@NullMarked +public class IgnoreAnnotations { + @Nullable public Derived field = null; + + @Nullable + public Derived foo(Derived x, @NullnessUnspecified Base y) { + return null; + } + + public Derived everythingNotNullable(Derived x) { return null; } + + public @Nullable Derived everythingNullable(@Nullable Derived x) { return null; } + + public @NullnessUnspecified Derived everythingUnknown(@NullnessUnspecified Derived x) { return null; } +} + +// FILE: Base.java +public class Base { + void foo() {} +} + +// FILE: Derived.java +public class Derived extends Base { } + +// FILE: main.kt +fun main(a: IgnoreAnnotations, x: Derived): Unit { + // jspecify_nullness_mismatch + a.foo(x, null).foo() + // jspecify_nullness_mismatch + a.foo(null, x).foo() + + // jspecify_nullness_mismatch + a.field.foo() + + // jspecify_nullness_mismatch + a.everythingNotNullable(null).foo() + a.everythingNotNullable(x).foo() + + // jspecify_nullness_mismatch + a.everythingNullable(null).foo() + + a.everythingUnknown(null).foo() +} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.fir.txt new file mode 100644 index 00000000000..c569b882f62 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.fir.txt @@ -0,0 +1,31 @@ +package + +public fun main(/*0*/ a: IgnoreAnnotations, /*1*/ x: Derived): kotlin.Unit + +public open class Base { + public constructor Base() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public/*package*/ 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 +} + +public open class Derived : Base { + public constructor Derived() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public/*package*/ open override /*1*/ /*fake_override*/ fun foo(): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +@org.jspecify.nullness.NullMarked public open class IgnoreAnnotations { + public constructor IgnoreAnnotations() + @org.jspecify.nullness.Nullable public final var field: @org.jspecify.nullness.Nullable Derived? + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open fun everythingNotNullable(/*0*/ x: Derived): Derived + @org.jspecify.nullness.Nullable public open fun everythingNullable(/*0*/ @org.jspecify.nullness.Nullable x: @org.jspecify.nullness.Nullable Derived?): @org.jspecify.nullness.Nullable Derived? + @org.jspecify.nullness.NullnessUnspecified public open fun everythingUnknown(/*0*/ @org.jspecify.nullness.NullnessUnspecified x: @org.jspecify.nullness.NullnessUnspecified Derived!): @org.jspecify.nullness.NullnessUnspecified Derived! + @org.jspecify.nullness.Nullable public open fun foo(/*0*/ x: Derived, /*1*/ @org.jspecify.nullness.NullnessUnspecified y: @org.jspecify.nullness.NullnessUnspecified Base!): @org.jspecify.nullness.Nullable Derived? + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.kt new file mode 100644 index 00000000000..7dc46c25e76 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.kt @@ -0,0 +1,48 @@ +// JSPECIFY_STATE: strict + +// FILE: IgnoreAnnotations.java +import org.jspecify.nullness.*; + +@NullMarked +public class IgnoreAnnotations { + @Nullable public Derived field = null; + + @Nullable + public Derived foo(Derived x, @NullnessUnspecified Base y) { + return null; + } + + public Derived everythingNotNullable(Derived x) { return null; } + + public @Nullable Derived everythingNullable(@Nullable Derived x) { return null; } + + public @NullnessUnspecified Derived everythingUnknown(@NullnessUnspecified Derived x) { return null; } +} + +// FILE: Base.java +public class Base { + void foo() {} +} + +// FILE: Derived.java +public class Derived extends Base { } + +// FILE: main.kt +fun main(a: IgnoreAnnotations, x: Derived): Unit { + // jspecify_nullness_mismatch + a.foo(x, null).foo() + // jspecify_nullness_mismatch + a.foo(null, x).foo() + + // jspecify_nullness_mismatch + a.field.foo() + + // jspecify_nullness_mismatch + a.everythingNotNullable(null).foo() + a.everythingNotNullable(x).foo() + + // jspecify_nullness_mismatch + a.everythingNullable(null).foo() + + a.everythingUnknown(null).foo() +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.txt new file mode 100644 index 00000000000..10890003f07 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.txt @@ -0,0 +1,32 @@ +package + +public fun main(/*0*/ a: IgnoreAnnotations, /*1*/ x: Derived): kotlin.Unit + +public open class Base { + public constructor Base() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public/*package*/ 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 +} + +public open class Derived : Base { + public constructor Derived() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public/*package*/ open override /*1*/ /*fake_override*/ fun foo(): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +@org.jspecify.nullness.NullMarked public open class IgnoreAnnotations { + public constructor IgnoreAnnotations() + @org.jspecify.nullness.Nullable public final var field: @org.jspecify.nullness.Nullable Derived? + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open fun everythingNotNullable(/*0*/ x: Derived): Derived + @org.jspecify.nullness.Nullable public open fun everythingNullable(/*0*/ @org.jspecify.nullness.Nullable x: @org.jspecify.nullness.Nullable Derived?): @org.jspecify.nullness.Nullable Derived? + @org.jspecify.nullness.NullnessUnspecified public open fun everythingUnknown(/*0*/ @org.jspecify.nullness.NullnessUnspecified x: @org.jspecify.nullness.NullnessUnspecified Derived!): @org.jspecify.nullness.NullnessUnspecified Derived! + @org.jspecify.nullness.Nullable public open fun foo(/*0*/ x: Derived, /*1*/ @org.jspecify.nullness.NullnessUnspecified y: @org.jspecify.nullness.NullnessUnspecified Base!): @org.jspecify.nullness.Nullable Derived? + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.fir.kt new file mode 100644 index 00000000000..3900d6f6428 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.fir.kt @@ -0,0 +1,29 @@ +// !LANGUAGE: +ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated +// JSPECIFY_STATE: strict + +// FILE: NonPlatformTypeParameter.java +import org.jspecify.nullness.*; + +public class NonPlatformTypeParameter { + public void foo(T t) {} + public void bar(E e) {} +} + +// FILE: Test.java +public class Test {} + +// FILE: main.kt +fun main(a1: NonPlatformTypeParameter, a2: NonPlatformTypeParameter, x: T): Unit { + a1.foo(null) + a1.bar(null) + // jspecify_nullness_mismatch + a1.bar(null) + a1.bar(x) + + // jspecify_nullness_mismatch + a2.foo(null) + a2.bar(null) + // jspecify_nullness_mismatch + a2.bar(null) + a2.bar(x) +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.fir.txt new file mode 100644 index 00000000000..ac9d3a20f90 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.fir.txt @@ -0,0 +1,19 @@ +package + +public fun main(/*0*/ a1: NonPlatformTypeParameter, /*1*/ a2: NonPlatformTypeParameter, /*2*/ x: T): kotlin.Unit + +public open class NonPlatformTypeParameter { + public constructor NonPlatformTypeParameter() + public open fun bar(/*0*/ e: E): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open fun foo(/*0*/ 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 open class Test { + public constructor Test() + 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 +} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.kt new file mode 100644 index 00000000000..3900d6f6428 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.kt @@ -0,0 +1,29 @@ +// !LANGUAGE: +ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated +// JSPECIFY_STATE: strict + +// FILE: NonPlatformTypeParameter.java +import org.jspecify.nullness.*; + +public class NonPlatformTypeParameter { + public void foo(T t) {} + public void bar(E e) {} +} + +// FILE: Test.java +public class Test {} + +// FILE: main.kt +fun main(a1: NonPlatformTypeParameter, a2: NonPlatformTypeParameter, x: T): Unit { + a1.foo(null) + a1.bar(null) + // jspecify_nullness_mismatch + a1.bar(null) + a1.bar(x) + + // jspecify_nullness_mismatch + a2.foo(null) + a2.bar(null) + // jspecify_nullness_mismatch + a2.bar(null) + a2.bar(x) +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.txt new file mode 100644 index 00000000000..bd16bea0036 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.txt @@ -0,0 +1,20 @@ +package + +public fun main(/*0*/ a1: NonPlatformTypeParameter, /*1*/ a2: NonPlatformTypeParameter, /*2*/ x: T): kotlin.Unit + +public open class NonPlatformTypeParameter { + public constructor NonPlatformTypeParameter() + public open fun bar(/*0*/ e: E): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open fun foo(/*0*/ 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 open class Test { + public constructor Test() + 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 +} + diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.fir.kt new file mode 100644 index 00000000000..673cc3a63ce --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.fir.kt @@ -0,0 +1,38 @@ +// JSPECIFY_STATE: strict + +// FILE: NullnessUnspecifiedTypeParameter.java +import org.jspecify.nullness.*; + +@NullMarked +public class NullnessUnspecifiedTypeParameter { + public void foo(T t) {} + + public void bar(Test s, T t) {} // t should not become not nullable +} + +// FILE: Test.java +public class Test {} + +// FILE: main.kt +// jspecify_nullness_mismatch +fun main(a1: NullnessUnspecifiedTypeParameter, a2: NullnessUnspecifiedTypeParameter<Any?>, x: Test): Unit { + // jspecify_nullness_mismatch + a1.foo(null) + a1.foo(1) + + // jspecify_nullness_mismatch + a2.foo(null) + a2.foo(1) + + // jspecify_nullness_mismatch + a1.bar(null, null) + // jspecify_nullness_mismatch + a1.bar(x, null) + a1.bar(x, 1) + + // jspecify_nullness_mismatch + a2.bar(null, null) + // jspecify_nullness_mismatch + a2.bar(x, null) + a2.bar(x, 1) +} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.fir.txt new file mode 100644 index 00000000000..c0abf3b9ff1 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.fir.txt @@ -0,0 +1,19 @@ +package + +public fun main(/*0*/ a1: NullnessUnspecifiedTypeParameter, /*1*/ a2: NullnessUnspecifiedTypeParameter, /*2*/ x: Test): kotlin.Unit + +@org.jspecify.nullness.NullMarked public open class NullnessUnspecifiedTypeParameter { + public constructor NullnessUnspecifiedTypeParameter() + public open fun bar(/*0*/ s: Test, /*1*/ t: T): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open fun foo(/*0*/ 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 open class Test { + public constructor Test() + 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 +} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.kt new file mode 100644 index 00000000000..97227d59e56 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.kt @@ -0,0 +1,38 @@ +// JSPECIFY_STATE: strict + +// FILE: NullnessUnspecifiedTypeParameter.java +import org.jspecify.nullness.*; + +@NullMarked +public class NullnessUnspecifiedTypeParameter { + public void foo(T t) {} + + public void bar(Test s, T t) {} // t should not become not nullable +} + +// FILE: Test.java +public class Test {} + +// FILE: main.kt +// jspecify_nullness_mismatch +fun main(a1: NullnessUnspecifiedTypeParameter, a2: NullnessUnspecifiedTypeParameter<Any?>, x: Test): Unit { + // jspecify_nullness_mismatch + a1.foo(null) + a1.foo(1) + + // jspecify_nullness_mismatch + a2.foo(null) + a2.foo(1) + + // jspecify_nullness_mismatch + a1.bar(null, null) + // jspecify_nullness_mismatch + a1.bar(x, null) + a1.bar(x, 1) + + // jspecify_nullness_mismatch + a2.bar(null, null) + // jspecify_nullness_mismatch + a2.bar(x, null) + a2.bar(x, 1) +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.txt new file mode 100644 index 00000000000..41475b86b4b --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.txt @@ -0,0 +1,20 @@ +package + +public fun main(/*0*/ a1: NullnessUnspecifiedTypeParameter, /*1*/ a2: NullnessUnspecifiedTypeParameter, /*2*/ x: Test): kotlin.Unit + +@org.jspecify.nullness.NullMarked public open class NullnessUnspecifiedTypeParameter { + public constructor NullnessUnspecifiedTypeParameter() + public open fun bar(/*0*/ s: Test, /*1*/ t: T): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open fun foo(/*0*/ 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 open class Test { + public constructor Test() + 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 +} + diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.fir.kt new file mode 100644 index 00000000000..98ac27083e7 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.fir.kt @@ -0,0 +1,58 @@ +// JSPECIFY_STATE: strict + +// FILE: SelfType.java +import org.jspecify.nullness.*; + +@NullMarked +public class SelfType> { + public void foo(T t) {} +} + +// FILE: B.java +public class B extends SelfType {} + +// FILE: C.java +import org.jspecify.nullness.*; + +@NullMarked +public class C> extends SelfType {} + +// FILE: AK.java +public class AK extends SelfType {} + +// FILE: AKN.java +import org.jspecify.nullness.*; + +public class AKN extends SelfType<@Nullable AK> {} + +// FILE: BK.java +public class BK extends B {} + +// FILE: CK.java +public class CK extends C {} + +// FILE: CKN.java +import org.jspecify.nullness.*; + +public class CKN extends C<@Nullable CK> {} + +// FILE: main.kt +fun main(ak: AK, akn: AKN, bk: BK, ck: CK, ckn: CKN): Unit { + ak.foo(ak) + // jspecify_nullness_mismatch + ak.foo(null) + + // jspecify_nullness_mismatch + akn.foo(null) + + bk.foo(bk) + // jspecify_nullness_mismatch + bk.foo(null) + + ck.foo(ck) + // jspecify_nullness_mismatch + ck.foo(null) + + // jspecify_nullness_mismatch + ckn.foo(null) +} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.fir.txt new file mode 100644 index 00000000000..05a06758591 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.fir.txt @@ -0,0 +1,67 @@ +package + +public fun main(/*0*/ ak: AK, /*1*/ akn: AKN, /*2*/ bk: BK, /*3*/ ck: CK, /*4*/ ckn: CKN): kotlin.Unit + +public open class AK : SelfType { + public constructor AK() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun foo(/*0*/ t: AK): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public open class AKN : SelfType<@org.jspecify.nullness.Nullable AK!> { + public constructor AKN() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun foo(/*0*/ t: @org.jspecify.nullness.Nullable AK): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public open class B : SelfType { + public constructor B() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun foo(/*0*/ t: B): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public open class BK : B { + public constructor BK() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun foo(/*0*/ t: B): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +@org.jspecify.nullness.NullMarked public open class C> : SelfType { + public constructor C>() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun foo(/*0*/ t: E): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public open class CK : C { + public constructor CK() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun foo(/*0*/ t: CK): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public open class CKN : C<@org.jspecify.nullness.Nullable CK!> { + public constructor CKN() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun foo(/*0*/ t: @org.jspecify.nullness.Nullable CK): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +@org.jspecify.nullness.NullMarked public open class SelfType> { + public constructor SelfType>() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open fun foo(/*0*/ t: T): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.kt new file mode 100644 index 00000000000..2dba93d8f0a --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.kt @@ -0,0 +1,58 @@ +// JSPECIFY_STATE: strict + +// FILE: SelfType.java +import org.jspecify.nullness.*; + +@NullMarked +public class SelfType> { + public void foo(T t) {} +} + +// FILE: B.java +public class B extends SelfType {} + +// FILE: C.java +import org.jspecify.nullness.*; + +@NullMarked +public class C> extends SelfType {} + +// FILE: AK.java +public class AK extends SelfType {} + +// FILE: AKN.java +import org.jspecify.nullness.*; + +public class AKN extends SelfType<@Nullable AK> {} + +// FILE: BK.java +public class BK extends B {} + +// FILE: CK.java +public class CK extends C {} + +// FILE: CKN.java +import org.jspecify.nullness.*; + +public class CKN extends C<@Nullable CK> {} + +// FILE: main.kt +fun main(ak: AK, akn: AKN, bk: BK, ck: CK, ckn: CKN): Unit { + ak.foo(ak) + // jspecify_nullness_mismatch + ak.foo(null) + + // jspecify_nullness_mismatch + akn.foo(null) + + bk.foo(bk) + // jspecify_nullness_mismatch + bk.foo(null) + + ck.foo(ck) + // jspecify_nullness_mismatch + ck.foo(null) + + // jspecify_nullness_mismatch + ckn.foo(null) +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.txt new file mode 100644 index 00000000000..cb7d6eba87d --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.txt @@ -0,0 +1,68 @@ +package + +public fun main(/*0*/ ak: AK, /*1*/ akn: AKN, /*2*/ bk: BK, /*3*/ ck: CK, /*4*/ ckn: CKN): kotlin.Unit + +public open class AK : SelfType { + public constructor AK() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun foo(/*0*/ t: AK): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public open class AKN : SelfType<@org.jspecify.nullness.Nullable AK!> { + public constructor AKN() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun foo(/*0*/ t: @org.jspecify.nullness.Nullable AK): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public open class B : SelfType { + public constructor B() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun foo(/*0*/ t: B): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public open class BK : B { + public constructor BK() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun foo(/*0*/ t: B): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +@org.jspecify.nullness.NullMarked public open class C> : SelfType { + public constructor C>() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun foo(/*0*/ t: E): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public open class CK : C { + public constructor CK() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun foo(/*0*/ t: CK): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public open class CKN : C<@org.jspecify.nullness.Nullable CK!> { + public constructor CKN() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun foo(/*0*/ t: @org.jspecify.nullness.Nullable CK): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +@org.jspecify.nullness.NullMarked public open class SelfType> { + public constructor SelfType>() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open fun foo(/*0*/ t: T): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.fir.kt new file mode 100644 index 00000000000..edbd1fbe8b5 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.fir.kt @@ -0,0 +1,39 @@ +// JSPECIFY_STATE: strict + +// FILE: Simple.java +import org.jspecify.nullness.*; + +@NullMarked +public class Simple { + @Nullable public Derived field = null; + + @Nullable + public Derived foo(Derived x, @NullnessUnspecified Base y) { + return null; + } + + public Derived bar() { + return null; + } +} + +// FILE: Base.java +public class Base {} + +// FILE: Derived.java +public class Derived extends Base { + void foo() {} +} + +// FILE: main.kt +fun main(a: Simple, x: Derived): Unit { + // jspecify_nullness_mismatch + a.foo(x, null).foo() + // jspecify_nullness_mismatch + a.foo(null, x).foo() + + a.bar().foo() + + // jspecify_nullness_mismatch + a.field.foo() +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.fir.txt new file mode 100644 index 00000000000..6bc0a068e0a --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.fir.txt @@ -0,0 +1,28 @@ +package + +public fun main(/*0*/ a: Simple, /*1*/ x: Derived): kotlin.Unit + +public open class Base { + public constructor Base() + 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 open class Derived : Base { + public constructor Derived() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public/*package*/ 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 +} + +@org.jspecify.nullness.NullMarked public open class Simple { + public constructor Simple() + @org.jspecify.nullness.Nullable public final var field: @org.jspecify.nullness.Nullable Derived? + public open fun bar(): Derived + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + @org.jspecify.nullness.Nullable public open fun foo(/*0*/ x: Derived, /*1*/ @org.jspecify.nullness.NullnessUnspecified y: @org.jspecify.nullness.NullnessUnspecified Base!): @org.jspecify.nullness.Nullable Derived? + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.kt new file mode 100644 index 00000000000..edbd1fbe8b5 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.kt @@ -0,0 +1,39 @@ +// JSPECIFY_STATE: strict + +// FILE: Simple.java +import org.jspecify.nullness.*; + +@NullMarked +public class Simple { + @Nullable public Derived field = null; + + @Nullable + public Derived foo(Derived x, @NullnessUnspecified Base y) { + return null; + } + + public Derived bar() { + return null; + } +} + +// FILE: Base.java +public class Base {} + +// FILE: Derived.java +public class Derived extends Base { + void foo() {} +} + +// FILE: main.kt +fun main(a: Simple, x: Derived): Unit { + // jspecify_nullness_mismatch + a.foo(x, null).foo() + // jspecify_nullness_mismatch + a.foo(null, x).foo() + + a.bar().foo() + + // jspecify_nullness_mismatch + a.field.foo() +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.txt new file mode 100644 index 00000000000..18d82bc6747 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.txt @@ -0,0 +1,29 @@ +package + +public fun main(/*0*/ a: Simple, /*1*/ x: Derived): kotlin.Unit + +public open class Base { + public constructor Base() + 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 open class Derived : Base { + public constructor Derived() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public/*package*/ 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 +} + +@org.jspecify.nullness.NullMarked public open class Simple { + public constructor Simple() + @org.jspecify.nullness.Nullable public final var field: @org.jspecify.nullness.Nullable Derived? + public open fun bar(): Derived + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + @org.jspecify.nullness.Nullable public open fun foo(/*0*/ x: Derived, /*1*/ @org.jspecify.nullness.NullnessUnspecified y: @org.jspecify.nullness.NullnessUnspecified Base!): @org.jspecify.nullness.Nullable Derived? + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.fir.kt new file mode 100644 index 00000000000..9c1ac210ab8 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.fir.kt @@ -0,0 +1,49 @@ +// JSPECIFY_STATE: strict + +// FILE: TypeArgumentsFromParameterBounds.java +import org.jspecify.nullness.*; + +@NullMarked +public class TypeArgumentsFromParameterBounds {} + +// FILE: A.java +import org.jspecify.nullness.*; + +@NullMarked +public class A { + public void bar(TypeArgumentsFromParameterBounds a) {} +} + +// FILE: B.java +import org.jspecify.nullness.*; + +public class B { + public void bar(TypeArgumentsFromParameterBounds a) {} +} + +// FILE: Test.java +public class Test {} + +// FILE: main.kt +fun main( + aNotNullNotNullNotNull: TypeArgumentsFromParameterBounds, + aNotNullNotNullNull: TypeArgumentsFromParameterBounds, + aNotNullNullNotNull: TypeArgumentsFromParameterBounds, + aNotNullNullNull: TypeArgumentsFromParameterBounds, + a: A, b: B +): Unit { + a.bar(aNotNullNotNullNotNull) + // jspecify_nullness_mismatch + a.bar(aNotNullNotNullNull) + // jspecify_nullness_mismatch + a.bar(aNotNullNullNotNull) + // jspecify_nullness_mismatch + a.bar(aNotNullNullNull) + + // jspecify_nullness_mismatch + b.bar(aNotNullNotNullNotNull) + // jspecify_nullness_mismatch + b.bar(aNotNullNotNullNull) + b.bar(aNotNullNullNotNull) + b.bar(aNotNullNullNull) +} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.fir.txt new file mode 100644 index 00000000000..bae935aa22e --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.fir.txt @@ -0,0 +1,33 @@ +package + +public fun main(/*0*/ aNotNullNotNullNotNull: TypeArgumentsFromParameterBounds, /*1*/ aNotNullNotNullNull: TypeArgumentsFromParameterBounds, /*2*/ aNotNullNullNotNull: TypeArgumentsFromParameterBounds, /*3*/ aNotNullNullNull: TypeArgumentsFromParameterBounds, /*4*/ a: A, /*5*/ b: B): kotlin.Unit + +@org.jspecify.nullness.NullMarked public open class A { + public constructor A() + public open fun bar(/*0*/ a: TypeArgumentsFromParameterBounds): kotlin.Unit + 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 open class B { + public constructor B() + public open fun bar(/*0*/ a: TypeArgumentsFromParameterBounds!): kotlin.Unit + 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 open class Test { + public constructor Test() + 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 +} + +@org.jspecify.nullness.NullMarked public open class TypeArgumentsFromParameterBounds { + public constructor TypeArgumentsFromParameterBounds() + 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 +} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.kt new file mode 100644 index 00000000000..95da98f4ea7 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.kt @@ -0,0 +1,49 @@ +// JSPECIFY_STATE: strict + +// FILE: TypeArgumentsFromParameterBounds.java +import org.jspecify.nullness.*; + +@NullMarked +public class TypeArgumentsFromParameterBounds {} + +// FILE: A.java +import org.jspecify.nullness.*; + +@NullMarked +public class A { + public void bar(TypeArgumentsFromParameterBounds a) {} +} + +// FILE: B.java +import org.jspecify.nullness.*; + +public class B { + public void bar(TypeArgumentsFromParameterBounds a) {} +} + +// FILE: Test.java +public class Test {} + +// FILE: main.kt +fun main( + aNotNullNotNullNotNull: TypeArgumentsFromParameterBounds, + aNotNullNotNullNull: TypeArgumentsFromParameterBounds, + aNotNullNullNotNull: TypeArgumentsFromParameterBounds, + aNotNullNullNull: TypeArgumentsFromParameterBounds, + a: A, b: B +): Unit { + a.bar(aNotNullNotNullNotNull) + // jspecify_nullness_mismatch + a.bar(aNotNullNotNullNull) + // jspecify_nullness_mismatch + a.bar(aNotNullNullNotNull) + // jspecify_nullness_mismatch + a.bar(aNotNullNullNull) + + // jspecify_nullness_mismatch + b.bar(aNotNullNotNullNotNull) + // jspecify_nullness_mismatch + b.bar(aNotNullNotNullNull) + b.bar(aNotNullNullNotNull) + b.bar(aNotNullNullNull) +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.txt new file mode 100644 index 00000000000..caedf24968c --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.txt @@ -0,0 +1,34 @@ +package + +public fun main(/*0*/ aNotNullNotNullNotNull: TypeArgumentsFromParameterBounds, /*1*/ aNotNullNotNullNull: TypeArgumentsFromParameterBounds, /*2*/ aNotNullNullNotNull: TypeArgumentsFromParameterBounds, /*3*/ aNotNullNullNull: TypeArgumentsFromParameterBounds, /*4*/ a: A, /*5*/ b: B): kotlin.Unit + +@org.jspecify.nullness.NullMarked public open class A { + public constructor A() + public open fun bar(/*0*/ a: TypeArgumentsFromParameterBounds): kotlin.Unit + 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 open class B { + public constructor B() + public open fun bar(/*0*/ a: TypeArgumentsFromParameterBounds!): kotlin.Unit + 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 open class Test { + public constructor Test() + 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 +} + +@org.jspecify.nullness.NullMarked public open class TypeArgumentsFromParameterBounds { + public constructor TypeArgumentsFromParameterBounds() + 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 +} + diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.fir.kt new file mode 100644 index 00000000000..9d813421a33 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.fir.kt @@ -0,0 +1,47 @@ +// JSPECIFY_STATE: strict + +// FILE: A.java +import org.jspecify.nullness.*; + +@NullMarked +public class A { + public void foo(@NullnessUnspecified T t) {} + public void bar(E e) {} +} + +// FILE: B.java +import org.jspecify.nullness.*; +@NullMarked +public class B { + public void foo(T t) {} + public void bar(E e) {} +} + +// FILE: Test.java +public class Test {} + +// FILE: main.kt +// jspecify_nullness_mismatch +fun main(a1: A<Any?>, a2: A, b1: B<Any?>, b2: B, x: T): Unit { + a1.foo(null) + // jspecify_nullness_mismatch + a1.bar<T?>(null) + a1.bar(x) + + a2.foo(null) + // jspecify_nullness_mismatch + a2.bar<T?>(null) + a2.bar(x) + + // jspecify_nullness_mismatch + b1.foo(null) + // jspecify_nullness_mismatch + b1.bar<T?>(null) + b1.bar(x) + + // jspecify_nullness_mismatch + b2.foo(null) + // jspecify_nullness_mismatch + b2.bar<T?>(null) + b2.bar(x) +} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.fir.txt new file mode 100644 index 00000000000..67c24662220 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.fir.txt @@ -0,0 +1,28 @@ +package + +public fun main(/*0*/ a1: A, /*1*/ a2: A, /*2*/ b1: B, /*3*/ b2: B, /*4*/ x: T): kotlin.Unit + +@org.jspecify.nullness.NullMarked public open class A { + public constructor A() + public open fun bar(/*0*/ e: E): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open fun foo(/*0*/ @org.jspecify.nullness.NullnessUnspecified t: @org.jspecify.nullness.NullnessUnspecified T!): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +@org.jspecify.nullness.NullMarked public open class B { + public constructor B() + public open fun bar(/*0*/ e: E): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open fun foo(/*0*/ 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 open class Test { + public constructor Test() + 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 +} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.kt new file mode 100644 index 00000000000..b932a35b721 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.kt @@ -0,0 +1,47 @@ +// JSPECIFY_STATE: strict + +// FILE: A.java +import org.jspecify.nullness.*; + +@NullMarked +public class A { + public void foo(@NullnessUnspecified T t) {} + public void bar(E e) {} +} + +// FILE: B.java +import org.jspecify.nullness.*; +@NullMarked +public class B { + public void foo(T t) {} + public void bar(E e) {} +} + +// FILE: Test.java +public class Test {} + +// FILE: main.kt +// jspecify_nullness_mismatch +fun main(a1: A<Any?>, a2: A, b1: B<Any?>, b2: B, x: T): Unit { + a1.foo(null) + // jspecify_nullness_mismatch + a1.bar<T?>(null) + a1.bar(x) + + a2.foo(null) + // jspecify_nullness_mismatch + a2.bar<T?>(null) + a2.bar(x) + + // jspecify_nullness_mismatch + b1.foo(null) + // jspecify_nullness_mismatch + b1.bar<T?>(null) + b1.bar(x) + + // jspecify_nullness_mismatch + b2.foo(null) + // jspecify_nullness_mismatch + b2.bar<T?>(null) + b2.bar(x) +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.txt new file mode 100644 index 00000000000..d5655b46456 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.txt @@ -0,0 +1,29 @@ +package + +public fun main(/*0*/ a1: A, /*1*/ a2: A, /*2*/ b1: B, /*3*/ b2: B, /*4*/ x: T): kotlin.Unit + +@org.jspecify.nullness.NullMarked public open class A { + public constructor A() + public open fun bar(/*0*/ e: E): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open fun foo(/*0*/ @org.jspecify.nullness.NullnessUnspecified t: @org.jspecify.nullness.NullnessUnspecified T!): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +@org.jspecify.nullness.NullMarked public open class B { + public constructor B() + public open fun bar(/*0*/ e: E): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open fun foo(/*0*/ 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 open class Test { + public constructor Test() + 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 +} + diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.fir.kt new file mode 100644 index 00000000000..aeff6ee6245 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.fir.kt @@ -0,0 +1,37 @@ +// JSPECIFY_STATE: strict + +// FILE: WildcardsWithDefault.java +import org.jspecify.nullness.*; + +@NullMarked +public class WildcardsWithDefault { + public void noBoundsNotNull(A a) {} + public void noBoundsNullable(A a) {} +} + +// FILE: A.java +import org.jspecify.nullness.*; + +public class A {} + +// FILE: main.kt +fun main( + aNotNullNotNullNotNull: A, + aNotNullNotNullNull: A, + aNotNullNullNotNull: A, + aNotNullNullNull: A, + b: WildcardsWithDefault +): Unit { + b.noBoundsNotNull(aNotNullNotNullNotNull) + // jspecify_nullness_mismatch + b.noBoundsNotNull(aNotNullNotNullNull) + // jspecify_nullness_mismatch + b.noBoundsNotNull(aNotNullNullNotNull) + // jspecify_nullness_mismatch + b.noBoundsNotNull(aNotNullNullNull) + + b.noBoundsNullable(aNotNullNotNullNotNull) + b.noBoundsNullable(aNotNullNotNullNull) + b.noBoundsNullable(aNotNullNullNotNull) + b.noBoundsNullable(aNotNullNullNull) +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.fir.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.fir.txt new file mode 100644 index 00000000000..378cb62443e --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.fir.txt @@ -0,0 +1,19 @@ +package + +public fun main(/*0*/ aNotNullNotNullNotNull: A, /*1*/ aNotNullNotNullNull: A, /*2*/ aNotNullNullNotNull: A, /*3*/ aNotNullNullNull: A, /*4*/ b: WildcardsWithDefault): kotlin.Unit + +public open class A { + public constructor A() + 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 +} + +@org.jspecify.nullness.NullMarked public open class WildcardsWithDefault { + public constructor WildcardsWithDefault() + 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 fun noBoundsNotNull(/*0*/ a: A): kotlin.Unit + public open fun noBoundsNullable(/*0*/ a: A): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.kt new file mode 100644 index 00000000000..aeff6ee6245 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.kt @@ -0,0 +1,37 @@ +// JSPECIFY_STATE: strict + +// FILE: WildcardsWithDefault.java +import org.jspecify.nullness.*; + +@NullMarked +public class WildcardsWithDefault { + public void noBoundsNotNull(A a) {} + public void noBoundsNullable(A a) {} +} + +// FILE: A.java +import org.jspecify.nullness.*; + +public class A {} + +// FILE: main.kt +fun main( + aNotNullNotNullNotNull: A, + aNotNullNotNullNull: A, + aNotNullNullNotNull: A, + aNotNullNullNull: A, + b: WildcardsWithDefault +): Unit { + b.noBoundsNotNull(aNotNullNotNullNotNull) + // jspecify_nullness_mismatch + b.noBoundsNotNull(aNotNullNotNullNull) + // jspecify_nullness_mismatch + b.noBoundsNotNull(aNotNullNullNotNull) + // jspecify_nullness_mismatch + b.noBoundsNotNull(aNotNullNullNull) + + b.noBoundsNullable(aNotNullNotNullNotNull) + b.noBoundsNullable(aNotNullNotNullNull) + b.noBoundsNullable(aNotNullNullNotNull) + b.noBoundsNullable(aNotNullNullNull) +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.txt new file mode 100644 index 00000000000..bc7a7517225 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.txt @@ -0,0 +1,20 @@ +package + +public fun main(/*0*/ aNotNullNotNullNotNull: A, /*1*/ aNotNullNotNullNull: A, /*2*/ aNotNullNullNotNull: A, /*3*/ aNotNullNullNull: A, /*4*/ b: WildcardsWithDefault): kotlin.Unit + +public open class A { + public constructor A() + 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 +} + +@org.jspecify.nullness.NullMarked public open class WildcardsWithDefault { + public constructor WildcardsWithDefault() + 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 fun noBoundsNotNull(/*0*/ a: A): kotlin.Unit + public open fun noBoundsNullable(/*0*/ a: A): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/AnnotatedBoundsOfWildcard.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.fir.kt similarity index 62% rename from compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/AnnotatedBoundsOfWildcard.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.fir.kt index 7a9d98c1df6..850db9087d8 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/AnnotatedBoundsOfWildcard.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.fir.kt @@ -1,6 +1,34 @@ -// JAVA_SOURCES: AnnotatedBoundsOfWildcard.java -// JSPECIFY_STATE warn +// JSPECIFY_MUTE +// FILE: AnnotatedBoundsOfWildcard.java +import org.jspecify.nullness.*; + +@NullMarked +public class AnnotatedBoundsOfWildcard { + public void superAsIs(Test a) {} + public void superNotNull(Test a) {} + public void superNullable(Test a) {} + + public void extendsAsIs(Test a) {} + public void extendsNotNull(Test a) {} + public void extendsNullable(Test a) {} + + public void noBounds(Test a) {} +} + +// FILE: Base.java +public class Base {} + +// FILE: Derived.java +public class Derived extends Base {} + +// FILE: Test.java +import org.jspecify.nullness.*; + +@NullMarked +public class Test { } + +// FILE: main.kt fun main( aNotNullNotNullNotNull: Test, aNotNullNotNullNull: Test, diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/AnnotatedBoundsOfWildcard.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.fir.txt similarity index 61% rename from compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/AnnotatedBoundsOfWildcard.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.fir.txt index ae2c7ff14d5..19b0721b871 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/AnnotatedBoundsOfWildcard.txt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.fir.txt @@ -5,12 +5,12 @@ public fun main(/*0*/ aNotNullNotNullNotNull: Test, / @org.jspecify.nullness.NullMarked public open class AnnotatedBoundsOfWildcard { public constructor AnnotatedBoundsOfWildcard() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open fun extendsAsIs(/*0*/ a: Test!): kotlin.Unit + public open fun extendsAsIs(/*0*/ a: Test!): kotlin.Unit public open fun extendsNotNull(/*0*/ a: Test!): kotlin.Unit public open fun extendsNullable(/*0*/ a: Test!): kotlin.Unit public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open fun noBounds(/*0*/ a: Test<*, *, *>!): kotlin.Unit - public open fun superAsIs(/*0*/ a: Test!): kotlin.Unit + public open fun noBounds(/*0*/ a: Test!): kotlin.Unit + public open fun superAsIs(/*0*/ a: Test!): kotlin.Unit public open fun superNotNull(/*0*/ a: Test!): kotlin.Unit public open fun superNullable(/*0*/ a: Test!): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String @@ -36,11 +36,3 @@ public open class Derived : Base { public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } - -@org.jspecify.nullness.NullMarked public open class Use { - public constructor Use() - 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 fun main(/*0*/ aNotNullNotNullNotNull: Test!, /*1*/ aNotNullNotNullNull: Test!, /*2*/ aNotNullNullNotNull: Test!, /*3*/ aNotNullNullNull: Test!, /*4*/ aObjectNotNullNotNullNotNull: Test!, /*5*/ aObjectNotNullNotNullNull: Test!, /*6*/ aObjectNotNullNullNotNull: Test!, /*7*/ aObjectNotNullNullNull: Test!, /*8*/ b: AnnotatedBoundsOfWildcard!): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/AnnotatedBoundsOfWildcard.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.kt similarity index 62% rename from compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/AnnotatedBoundsOfWildcard.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.kt index ab1646a43cb..850db9087d8 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/AnnotatedBoundsOfWildcard.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.kt @@ -1,5 +1,34 @@ -// JAVA_SOURCES: AnnotatedBoundsOfWildcard.java +// JSPECIFY_MUTE +// FILE: AnnotatedBoundsOfWildcard.java +import org.jspecify.nullness.*; + +@NullMarked +public class AnnotatedBoundsOfWildcard { + public void superAsIs(Test a) {} + public void superNotNull(Test a) {} + public void superNullable(Test a) {} + + public void extendsAsIs(Test a) {} + public void extendsNotNull(Test a) {} + public void extendsNullable(Test a) {} + + public void noBounds(Test a) {} +} + +// FILE: Base.java +public class Base {} + +// FILE: Derived.java +public class Derived extends Base {} + +// FILE: Test.java +import org.jspecify.nullness.*; + +@NullMarked +public class Test { } + +// FILE: main.kt fun main( aNotNullNotNullNotNull: Test, aNotNullNotNullNull: Test, diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/AnnotatedBoundsOfWildcard.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.txt similarity index 61% rename from compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/AnnotatedBoundsOfWildcard.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.txt index ae2c7ff14d5..944ebff7fbd 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/AnnotatedBoundsOfWildcard.txt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.txt @@ -5,12 +5,12 @@ public fun main(/*0*/ aNotNullNotNullNotNull: Test, / @org.jspecify.nullness.NullMarked public open class AnnotatedBoundsOfWildcard { public constructor AnnotatedBoundsOfWildcard() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open fun extendsAsIs(/*0*/ a: Test!): kotlin.Unit + public open fun extendsAsIs(/*0*/ a: Test!): kotlin.Unit public open fun extendsNotNull(/*0*/ a: Test!): kotlin.Unit public open fun extendsNullable(/*0*/ a: Test!): kotlin.Unit public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open fun noBounds(/*0*/ a: Test<*, *, *>!): kotlin.Unit - public open fun superAsIs(/*0*/ a: Test!): kotlin.Unit + public open fun noBounds(/*0*/ a: Test!): kotlin.Unit + public open fun superAsIs(/*0*/ a: Test!): kotlin.Unit public open fun superNotNull(/*0*/ a: Test!): kotlin.Unit public open fun superNullable(/*0*/ a: Test!): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String @@ -37,10 +37,3 @@ public open class Derived : Base { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } -@org.jspecify.nullness.NullMarked public open class Use { - public constructor Use() - 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 fun main(/*0*/ aNotNullNotNullNotNull: Test!, /*1*/ aNotNullNotNullNull: Test!, /*2*/ aNotNullNullNotNull: Test!, /*3*/ aNotNullNullNull: Test!, /*4*/ aObjectNotNullNotNullNotNull: Test!, /*5*/ aObjectNotNullNotNullNull: Test!, /*6*/ aObjectNotNullNullNotNull: Test!, /*7*/ aObjectNotNullNullNull: Test!, /*8*/ b: AnnotatedBoundsOfWildcard!): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/Defaults.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Defaults.fir.kt similarity index 51% rename from compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/Defaults.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Defaults.fir.kt index ecda36ec32d..d8a0910a49c 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/Defaults.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Defaults.fir.kt @@ -1,17 +1,42 @@ -// JAVA_SOURCES: Defaults.java -// JSPECIFY_STATE warn +// FILE: Defaults.java +import org.jspecify.nullness.*; + +@NullMarked +public class Defaults { + public Foo defaultField = null; + @Nullable public Foo field = null; + + public Foo everythingNotNullable(Foo x) { return null; } + + public @Nullable Foo everythingNullable(@Nullable Foo x) { return null; } + + public @NullnessUnspecified Foo everythingUnknown(@NullnessUnspecified Foo x) { return null; } + + public @Nullable Foo mixed(Foo x) { return null; } + + public Foo explicitlyNullnessUnspecified(@NullnessUnspecified Foo x) { return null; } +} + +// FILE: Foo.java +public class Foo { + public Object foo() { return null; } +} + +// FILE: main.kt fun main(a: Defaults, x: Foo): Unit { // jspecify_nullness_mismatch a.everythingNotNullable(null).foo() a.everythingNotNullable(x).foo() + // jspecify_nullness_mismatch a.everythingNullable(null).foo() a.everythingUnknown(null).foo() // jspecify_nullness_mismatch a.mixed(null).foo() + // jspecify_nullness_mismatch a.mixed(x).foo() a.explicitlyNullnessUnspecified(x).foo() @@ -19,5 +44,6 @@ fun main(a: Defaults, x: Foo): Unit { a.defaultField.foo() + // jspecify_nullness_mismatch a.field.foo() -} \ No newline at end of file +} diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/Defaults.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Defaults.fir.txt similarity index 79% rename from compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/Defaults.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Defaults.fir.txt index 6e34faeb043..39b1a4af2a1 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/Defaults.txt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Defaults.fir.txt @@ -23,13 +23,3 @@ public open class Foo { public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } - -public open class Use { - public constructor Use() - 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/*package*/ open fun main(/*0*/ a: Defaults!, /*1*/ x: Foo!): kotlin.Unit -} diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/Defaults.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Defaults.kt similarity index 51% rename from compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/Defaults.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Defaults.kt index aa66a016549..decabac6a75 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/Defaults.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Defaults.kt @@ -1,16 +1,42 @@ -// JAVA_SOURCES: Defaults.java +// FILE: Defaults.java +import org.jspecify.nullness.*; + +@NullMarked +public class Defaults { + public Foo defaultField = null; + @Nullable public Foo field = null; + + public Foo everythingNotNullable(Foo x) { return null; } + + public @Nullable Foo everythingNullable(@Nullable Foo x) { return null; } + + public @NullnessUnspecified Foo everythingUnknown(@NullnessUnspecified Foo x) { return null; } + + public @Nullable Foo mixed(Foo x) { return null; } + + public Foo explicitlyNullnessUnspecified(@NullnessUnspecified Foo x) { return null; } +} + +// FILE: Foo.java +public class Foo { + public Object foo() { return null; } +} + +// FILE: main.kt fun main(a: Defaults, x: Foo): Unit { // jspecify_nullness_mismatch a.everythingNotNullable(null).foo() a.everythingNotNullable(x).foo() + // jspecify_nullness_mismatch a.everythingNullable(null).foo() a.everythingUnknown(null).foo() // jspecify_nullness_mismatch a.mixed(null).foo() + // jspecify_nullness_mismatch a.mixed(x).foo() a.explicitlyNullnessUnspecified(x).foo() @@ -18,5 +44,6 @@ fun main(a: Defaults, x: Foo): Unit { a.defaultField.foo() + // jspecify_nullness_mismatch a.field.foo() } \ No newline at end of file diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/Defaults.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Defaults.txt similarity index 79% rename from compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/Defaults.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Defaults.txt index 6e34faeb043..110f4bed969 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/Defaults.txt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Defaults.txt @@ -24,12 +24,3 @@ public open class Foo { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } -public open class Use { - public constructor Use() - 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/*package*/ open fun main(/*0*/ a: Defaults!, /*1*/ x: Foo!): kotlin.Unit -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.fir.kt new file mode 100644 index 00000000000..e9dbc240304 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.fir.kt @@ -0,0 +1,47 @@ + +// FILE: IgnoreAnnotations.java +import org.jspecify.nullness.*; + +@NullMarked +public class IgnoreAnnotations { + @Nullable public Derived field = null; + + @Nullable + public Derived foo(Derived x, @NullnessUnspecified Base y) { + return null; + } + + public Derived everythingNotNullable(Derived x) { return null; } + + public @Nullable Derived everythingNullable(@Nullable Derived x) { return null; } + + public @NullnessUnspecified Derived everythingUnknown(@NullnessUnspecified Derived x) { return null; } +} + +// FILE: Base.java +public class Base { + void foo() {} +} + +// FILE: Derived.java +public class Derived extends Base { } + +// FILE: main.kt +fun main(a: IgnoreAnnotations, x: Derived): Unit { + // jspecify_nullness_mismatch + a.foo(x, null).foo() + // jspecify_nullness_mismatch + a.foo(null, x).foo() + + // jspecify_nullness_mismatch + a.field.foo() + + // jspecify_nullness_mismatch + a.everythingNotNullable(null).foo() + a.everythingNotNullable(x).foo() + + // jspecify_nullness_mismatch + a.everythingNullable(null).foo() + + a.everythingUnknown(null).foo() +} \ No newline at end of file diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/IgnoreAnnotations.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.fir.txt similarity index 82% rename from compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/IgnoreAnnotations.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.fir.txt index 7de3d6e3112..48975fb4dcf 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/IgnoreAnnotations.txt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.fir.txt @@ -29,13 +29,3 @@ public open class Derived : Base { public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } - -public open class Use { - public constructor Use() - 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/*package*/ open fun main(/*0*/ a: IgnoreAnnotations!, /*1*/ x: Derived!): kotlin.Unit -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.kt new file mode 100644 index 00000000000..e9dbc240304 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.kt @@ -0,0 +1,47 @@ + +// FILE: IgnoreAnnotations.java +import org.jspecify.nullness.*; + +@NullMarked +public class IgnoreAnnotations { + @Nullable public Derived field = null; + + @Nullable + public Derived foo(Derived x, @NullnessUnspecified Base y) { + return null; + } + + public Derived everythingNotNullable(Derived x) { return null; } + + public @Nullable Derived everythingNullable(@Nullable Derived x) { return null; } + + public @NullnessUnspecified Derived everythingUnknown(@NullnessUnspecified Derived x) { return null; } +} + +// FILE: Base.java +public class Base { + void foo() {} +} + +// FILE: Derived.java +public class Derived extends Base { } + +// FILE: main.kt +fun main(a: IgnoreAnnotations, x: Derived): Unit { + // jspecify_nullness_mismatch + a.foo(x, null).foo() + // jspecify_nullness_mismatch + a.foo(null, x).foo() + + // jspecify_nullness_mismatch + a.field.foo() + + // jspecify_nullness_mismatch + a.everythingNotNullable(null).foo() + a.everythingNotNullable(x).foo() + + // jspecify_nullness_mismatch + a.everythingNullable(null).foo() + + a.everythingUnknown(null).foo() +} \ No newline at end of file diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/IgnoreAnnotations.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.txt similarity index 82% rename from compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/IgnoreAnnotations.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.txt index 7de3d6e3112..61cbeca0771 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/IgnoreAnnotations.txt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.txt @@ -30,12 +30,3 @@ public open class Derived : Base { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } -public open class Use { - public constructor Use() - 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/*package*/ open fun main(/*0*/ a: IgnoreAnnotations!, /*1*/ x: Derived!): kotlin.Unit -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.fir.kt new file mode 100644 index 00000000000..de788ad31c8 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.fir.kt @@ -0,0 +1,29 @@ +// !LANGUAGE: +ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated +// JSPECIFY_MUTE + +// FILE: NonPlatformTypeParameter.java +import org.jspecify.nullness.*; + +public class NonPlatformTypeParameter { + public void foo(T t) {} + public void bar(E e) {} +} + +// FILE: Test.java +public class Test {} + +// FILE: main.kt +fun main(a1: NonPlatformTypeParameter, a2: NonPlatformTypeParameter, x: T): Unit { + a1.foo(null) + a1.bar(null) + // jspecify_nullness_mismatch + a1.bar(null) + a1.bar(x) + + // jspecify_nullness_mismatch + a2.foo(null) + a2.bar(null) + // jspecify_nullness_mismatch + a2.bar(null) + a2.bar(x) +} \ No newline at end of file diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/NonPlatformTypeParameter.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.fir.txt similarity index 66% rename from compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/NonPlatformTypeParameter.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.fir.txt index 8a40c5fd435..3e3674f724a 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/NonPlatformTypeParameter.txt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.fir.txt @@ -17,11 +17,3 @@ public open class Test { public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } - -@org.jspecify.nullness.NullMarked public open class Use { - public constructor Use() - 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 fun main(/*0*/ a1: NonPlatformTypeParameter<@org.jspecify.nullness.Nullable kotlin.Any!>!, /*1*/ a2: NonPlatformTypeParameter!, /*2*/ x: T!): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.kt new file mode 100644 index 00000000000..de788ad31c8 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.kt @@ -0,0 +1,29 @@ +// !LANGUAGE: +ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated +// JSPECIFY_MUTE + +// FILE: NonPlatformTypeParameter.java +import org.jspecify.nullness.*; + +public class NonPlatformTypeParameter { + public void foo(T t) {} + public void bar(E e) {} +} + +// FILE: Test.java +public class Test {} + +// FILE: main.kt +fun main(a1: NonPlatformTypeParameter, a2: NonPlatformTypeParameter, x: T): Unit { + a1.foo(null) + a1.bar(null) + // jspecify_nullness_mismatch + a1.bar(null) + a1.bar(x) + + // jspecify_nullness_mismatch + a2.foo(null) + a2.bar(null) + // jspecify_nullness_mismatch + a2.bar(null) + a2.bar(x) +} \ No newline at end of file diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/NonPlatformTypeParameter.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.txt similarity index 66% rename from compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/NonPlatformTypeParameter.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.txt index 8a40c5fd435..11a79d536a8 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/NonPlatformTypeParameter.txt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.txt @@ -18,10 +18,3 @@ public open class Test { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } -@org.jspecify.nullness.NullMarked public open class Use { - public constructor Use() - 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 fun main(/*0*/ a1: NonPlatformTypeParameter<@org.jspecify.nullness.Nullable kotlin.Any!>!, /*1*/ a2: NonPlatformTypeParameter!, /*2*/ x: T!): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.fir.kt new file mode 100644 index 00000000000..998d0da1678 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.fir.kt @@ -0,0 +1,38 @@ +// JSPECIFY_MUTE + +// FILE: NullnessUnspecifiedTypeParameter.java +import org.jspecify.nullness.*; + +@NullMarked +public class NullnessUnspecifiedTypeParameter { + public void foo(T t) {} + + public void bar(Test s, T t) {} // t should not become not nullable +} + +// FILE: Test.java +public class Test {} + +// FILE: main.kt +// jspecify_nullness_mismatch +fun main(a1: NullnessUnspecifiedTypeParameter, a2: NullnessUnspecifiedTypeParameter<Any?>, x: Test): Unit { + // jspecify_nullness_mismatch + a1.foo(null) + a1.foo(1) + + // jspecify_nullness_mismatch + a2.foo(null) + a2.foo(1) + + // jspecify_nullness_mismatch + a1.bar(null, null) + // jspecify_nullness_mismatch + a1.bar(x, null) + a1.bar(x, 1) + + // jspecify_nullness_mismatch + a2.bar(null, null) + // jspecify_nullness_mismatch + a2.bar(x, null) + a2.bar(x, 1) +} diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/NullnessUnspecifiedTypeParameter.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.fir.txt similarity index 66% rename from compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/NullnessUnspecifiedTypeParameter.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.fir.txt index 0aa27f558d0..163bebaf51d 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/NullnessUnspecifiedTypeParameter.txt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.fir.txt @@ -17,11 +17,3 @@ public open class Test { public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } - -public open class Use { - public constructor Use() - 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/*package*/ open fun main(/*0*/ a1: NullnessUnspecifiedTypeParameter!, /*1*/ a2: NullnessUnspecifiedTypeParameter<@org.jspecify.nullness.Nullable kotlin.Any!>!, /*2*/ x: Test!): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.kt new file mode 100644 index 00000000000..97e0039bd71 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.kt @@ -0,0 +1,38 @@ +// JSPECIFY_MUTE + +// FILE: NullnessUnspecifiedTypeParameter.java +import org.jspecify.nullness.*; + +@NullMarked +public class NullnessUnspecifiedTypeParameter { + public void foo(T t) {} + + public void bar(Test s, T t) {} // t should not become not nullable +} + +// FILE: Test.java +public class Test {} + +// FILE: main.kt +// jspecify_nullness_mismatch +fun main(a1: NullnessUnspecifiedTypeParameter, a2: NullnessUnspecifiedTypeParameter<Any?>, x: Test): Unit { + // jspecify_nullness_mismatch + a1.foo(null) + a1.foo(1) + + // jspecify_nullness_mismatch + a2.foo(null) + a2.foo(1) + + // jspecify_nullness_mismatch + a1.bar(null, null) + // jspecify_nullness_mismatch + a1.bar(x, null) + a1.bar(x, 1) + + // jspecify_nullness_mismatch + a2.bar(null, null) + // jspecify_nullness_mismatch + a2.bar(x, null) + a2.bar(x, 1) +} \ No newline at end of file diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/NullnessUnspecifiedTypeParameter.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.txt similarity index 66% rename from compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/NullnessUnspecifiedTypeParameter.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.txt index 0aa27f558d0..7c801cda016 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/NullnessUnspecifiedTypeParameter.txt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.txt @@ -18,10 +18,3 @@ public open class Test { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } -public open class Use { - public constructor Use() - 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/*package*/ open fun main(/*0*/ a1: NullnessUnspecifiedTypeParameter!, /*1*/ a2: NullnessUnspecifiedTypeParameter<@org.jspecify.nullness.Nullable kotlin.Any!>!, /*2*/ x: Test!): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.fir.kt new file mode 100644 index 00000000000..82513de91a5 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.fir.kt @@ -0,0 +1,58 @@ +// JSPECIFY_MUTE + +// FILE: SelfType.java +import org.jspecify.nullness.*; + +@NullMarked +public class SelfType> { + public void foo(T t) {} +} + +// FILE: B.java +public class B extends SelfType {} + +// FILE: C.java +import org.jspecify.nullness.*; + +@NullMarked +public class C> extends SelfType {} + +// FILE: AK.java +public class AK extends SelfType {} + +// FILE: AKN.java +import org.jspecify.nullness.*; + +public class AKN extends SelfType<@Nullable AK> {} + +// FILE: BK.java +public class BK extends B {} + +// FILE: CK.java +public class CK extends C {} + +// FILE: CKN.java +import org.jspecify.nullness.*; + +public class CKN extends C<@Nullable CK> {} + +// FILE: main.kt +fun main(ak: AK, akn: AKN, bk: BK, ck: CK, ckn: CKN): Unit { + ak.foo(ak) + // jspecify_nullness_mismatch + ak.foo(null) + + // jspecify_nullness_mismatch + akn.foo(null) + + bk.foo(bk) + // jspecify_nullness_mismatch + bk.foo(null) + + ck.foo(ck) + // jspecify_nullness_mismatch + ck.foo(null) + + // jspecify_nullness_mismatch + ckn.foo(null) +} \ No newline at end of file diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/SelfType.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.fir.txt similarity index 93% rename from compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/SelfType.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.fir.txt index c7e26add7f5..13dcbe9573f 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/SelfType.txt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.fir.txt @@ -34,7 +34,7 @@ public open class BK : B { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } -public open class C!> : SelfType { +@org.jspecify.nullness.NullMarked public open class C!> : SelfType { public constructor C!>() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun foo(/*0*/ t: E!): kotlin.Unit @@ -55,11 +55,10 @@ public open class CKN : C<@org.jspecify.nullness.Nullable CK!> { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun foo(/*0*/ t: @org.jspecify.nullness.Nullable CK!): kotlin.Unit public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open fun main(/*0*/ ak: AK!, /*1*/ akn: AKN!, /*2*/ bk: BK!, /*3*/ ck: CK!, /*4*/ ckn: CKN!): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } -public open class SelfType!> { +@org.jspecify.nullness.NullMarked public open class SelfType!> { public constructor SelfType!>() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open fun foo(/*0*/ t: T!): kotlin.Unit diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.kt new file mode 100644 index 00000000000..82513de91a5 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.kt @@ -0,0 +1,58 @@ +// JSPECIFY_MUTE + +// FILE: SelfType.java +import org.jspecify.nullness.*; + +@NullMarked +public class SelfType> { + public void foo(T t) {} +} + +// FILE: B.java +public class B extends SelfType {} + +// FILE: C.java +import org.jspecify.nullness.*; + +@NullMarked +public class C> extends SelfType {} + +// FILE: AK.java +public class AK extends SelfType {} + +// FILE: AKN.java +import org.jspecify.nullness.*; + +public class AKN extends SelfType<@Nullable AK> {} + +// FILE: BK.java +public class BK extends B {} + +// FILE: CK.java +public class CK extends C {} + +// FILE: CKN.java +import org.jspecify.nullness.*; + +public class CKN extends C<@Nullable CK> {} + +// FILE: main.kt +fun main(ak: AK, akn: AKN, bk: BK, ck: CK, ckn: CKN): Unit { + ak.foo(ak) + // jspecify_nullness_mismatch + ak.foo(null) + + // jspecify_nullness_mismatch + akn.foo(null) + + bk.foo(bk) + // jspecify_nullness_mismatch + bk.foo(null) + + ck.foo(ck) + // jspecify_nullness_mismatch + ck.foo(null) + + // jspecify_nullness_mismatch + ckn.foo(null) +} \ No newline at end of file diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/SelfType.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.txt similarity index 93% rename from compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/SelfType.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.txt index c7e26add7f5..be8558b2e1f 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/SelfType.txt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.txt @@ -34,7 +34,7 @@ public open class BK : B { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } -public open class C!> : SelfType { +@org.jspecify.nullness.NullMarked public open class C!> : SelfType { public constructor C!>() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun foo(/*0*/ t: E!): kotlin.Unit @@ -55,14 +55,14 @@ public open class CKN : C<@org.jspecify.nullness.Nullable CK!> { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun foo(/*0*/ t: @org.jspecify.nullness.Nullable CK!): kotlin.Unit public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open fun main(/*0*/ ak: AK!, /*1*/ akn: AKN!, /*2*/ bk: BK!, /*3*/ ck: CK!, /*4*/ ckn: CKN!): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } -public open class SelfType!> { +@org.jspecify.nullness.NullMarked public open class SelfType!> { public constructor SelfType!>() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open fun foo(/*0*/ t: T!): kotlin.Unit public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } + diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.fir.kt new file mode 100644 index 00000000000..ae70daf30b9 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.fir.kt @@ -0,0 +1,38 @@ + +// FILE: Simple.java +import org.jspecify.nullness.*; + +@NullMarked +public class Simple { + @Nullable public Derived field = null; + + @Nullable + public Derived foo(Derived x, @NullnessUnspecified Base y) { + return null; + } + + public Derived bar() { + return null; + } +} + +// FILE: Base.java +public class Base {} + +// FILE: Derived.java +public class Derived extends Base { + void foo() {} +} + +// FILE: main.kt +fun main(a: Simple, x: Derived): Unit { + // jspecify_nullness_mismatch + a.foo(x, null).foo() + // jspecify_nullness_mismatch + a.foo(null, x).foo() + + a.bar().foo() + + // jspecify_nullness_mismatch + a.field.foo() +} diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/Simple.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.fir.txt similarity index 76% rename from compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/Simple.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.fir.txt index 22a0b1f519f..2c5e02f7f60 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/Simple.txt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.fir.txt @@ -26,13 +26,3 @@ public open class Derived : Base { public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } - -@org.jspecify.nullness.NullMarked public open class Use { - public constructor Use() - 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 open fun main(/*0*/ a: Simple!, /*1*/ x: Derived!): kotlin.Unit -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.kt new file mode 100644 index 00000000000..ef56fed8c79 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.kt @@ -0,0 +1,38 @@ + +// FILE: Simple.java +import org.jspecify.nullness.*; + +@NullMarked +public class Simple { + @Nullable public Derived field = null; + + @Nullable + public Derived foo(Derived x, @NullnessUnspecified Base y) { + return null; + } + + public Derived bar() { + return null; + } +} + +// FILE: Base.java +public class Base {} + +// FILE: Derived.java +public class Derived extends Base { + void foo() {} +} + +// FILE: main.kt +fun main(a: Simple, x: Derived): Unit { + // jspecify_nullness_mismatch + a.foo(x, null).foo() + // jspecify_nullness_mismatch + a.foo(null, x).foo() + + a.bar().foo() + + // jspecify_nullness_mismatch + a.field.foo() +} \ No newline at end of file diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/Simple.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.txt similarity index 76% rename from compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/Simple.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.txt index 22a0b1f519f..41c457dfdb8 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/Simple.txt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.txt @@ -27,12 +27,3 @@ public open class Derived : Base { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } -@org.jspecify.nullness.NullMarked public open class Use { - public constructor Use() - 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 open fun main(/*0*/ a: Simple!, /*1*/ x: Derived!): kotlin.Unit -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.fir.kt new file mode 100644 index 00000000000..f4643f099da --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.fir.kt @@ -0,0 +1,49 @@ +// JSPECIFY_MUTE + +// FILE: TypeArgumentsFromParameterBounds.java +import org.jspecify.nullness.*; + +@NullMarked +public class TypeArgumentsFromParameterBounds {} + +// FILE: A.java +import org.jspecify.nullness.*; + +@NullMarked +public class A { + public void bar(TypeArgumentsFromParameterBounds a) {} +} + +// FILE: B.java +import org.jspecify.nullness.*; + +public class B { + public void bar(TypeArgumentsFromParameterBounds a) {} +} + +// FILE: Test.java +public class Test {} + +// FILE: main.kt +fun main( + aNotNullNotNullNotNull: TypeArgumentsFromParameterBounds, + aNotNullNotNullNull: TypeArgumentsFromParameterBounds, + aNotNullNullNotNull: TypeArgumentsFromParameterBounds, + aNotNullNullNull: TypeArgumentsFromParameterBounds, + a: A, b: B +): Unit { + a.bar(aNotNullNotNullNotNull) + // jspecify_nullness_mismatch + a.bar(aNotNullNotNullNull) + // jspecify_nullness_mismatch + a.bar(aNotNullNullNotNull) + // jspecify_nullness_mismatch + a.bar(aNotNullNullNull) + + // jspecify_nullness_mismatch + b.bar(aNotNullNotNullNotNull) + // jspecify_nullness_mismatch + b.bar(aNotNullNotNullNull) + b.bar(aNotNullNullNotNull) + b.bar(aNotNullNullNull) +} \ No newline at end of file diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/TypeArgumentsFromParameterBounds.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.fir.txt similarity index 57% rename from compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/TypeArgumentsFromParameterBounds.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.fir.txt index 914a7c0671b..3b976ffbc39 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/TypeArgumentsFromParameterBounds.txt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.fir.txt @@ -1,25 +1,17 @@ package -public fun main(/*0*/ aNotNullNotNullNotNull: TypeArgumentsFromParameterBounds, /*1*/ aNotNullNotNullNull: TypeArgumentsFromParameterBounds, /*2*/ aNotNullNullNotNull: TypeArgumentsFromParameterBounds, /*3*/ aNotNullNullNull: TypeArgumentsFromParameterBounds, /*4*/ a: A, /*5*/ b: B, /*6*/ c: C): kotlin.Unit +public fun main(/*0*/ aNotNullNotNullNotNull: TypeArgumentsFromParameterBounds, /*1*/ aNotNullNotNullNull: TypeArgumentsFromParameterBounds, /*2*/ aNotNullNullNotNull: TypeArgumentsFromParameterBounds, /*3*/ aNotNullNullNull: TypeArgumentsFromParameterBounds, /*4*/ a: A, /*5*/ b: B): kotlin.Unit -public open class A { +@org.jspecify.nullness.NullMarked public open class A { public constructor A() - public open fun bar(/*0*/ a: TypeArgumentsFromParameterBounds<@org.jspecify.nullness.Nullable Test!, @org.jspecify.nullness.Nullable Test!, @org.jspecify.nullness.Nullable Test!>!): kotlin.Unit - 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 -} - -@org.jspecify.nullness.NullMarked public open class B { - public constructor B() public open fun bar(/*0*/ a: TypeArgumentsFromParameterBounds!): kotlin.Unit 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 open class C { - public constructor C() +public open class B { + public constructor B() public open fun bar(/*0*/ a: TypeArgumentsFromParameterBounds!): kotlin.Unit public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int @@ -39,13 +31,3 @@ public open class Test { public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } - -@org.jspecify.nullness.NullMarked public open class Use { - public constructor Use() - 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 open fun main(/*0*/ aNotNullNotNullNotNull: TypeArgumentsFromParameterBounds!, /*1*/ aNotNullNotNullNull: TypeArgumentsFromParameterBounds!, /*2*/ aNotNullNullNotNull: TypeArgumentsFromParameterBounds!, /*3*/ aNotNullNullNull: TypeArgumentsFromParameterBounds!, /*4*/ a: A!, /*5*/ b: B!, /*6*/ c: C!): kotlin.Unit -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.kt new file mode 100644 index 00000000000..f4643f099da --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.kt @@ -0,0 +1,49 @@ +// JSPECIFY_MUTE + +// FILE: TypeArgumentsFromParameterBounds.java +import org.jspecify.nullness.*; + +@NullMarked +public class TypeArgumentsFromParameterBounds {} + +// FILE: A.java +import org.jspecify.nullness.*; + +@NullMarked +public class A { + public void bar(TypeArgumentsFromParameterBounds a) {} +} + +// FILE: B.java +import org.jspecify.nullness.*; + +public class B { + public void bar(TypeArgumentsFromParameterBounds a) {} +} + +// FILE: Test.java +public class Test {} + +// FILE: main.kt +fun main( + aNotNullNotNullNotNull: TypeArgumentsFromParameterBounds, + aNotNullNotNullNull: TypeArgumentsFromParameterBounds, + aNotNullNullNotNull: TypeArgumentsFromParameterBounds, + aNotNullNullNull: TypeArgumentsFromParameterBounds, + a: A, b: B +): Unit { + a.bar(aNotNullNotNullNotNull) + // jspecify_nullness_mismatch + a.bar(aNotNullNotNullNull) + // jspecify_nullness_mismatch + a.bar(aNotNullNullNotNull) + // jspecify_nullness_mismatch + a.bar(aNotNullNullNull) + + // jspecify_nullness_mismatch + b.bar(aNotNullNotNullNotNull) + // jspecify_nullness_mismatch + b.bar(aNotNullNotNullNull) + b.bar(aNotNullNullNotNull) + b.bar(aNotNullNullNull) +} \ No newline at end of file diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/TypeArgumentsFromParameterBounds.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.txt similarity index 57% rename from compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/TypeArgumentsFromParameterBounds.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.txt index 914a7c0671b..4478b67eabf 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/TypeArgumentsFromParameterBounds.txt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.txt @@ -1,25 +1,17 @@ package -public fun main(/*0*/ aNotNullNotNullNotNull: TypeArgumentsFromParameterBounds, /*1*/ aNotNullNotNullNull: TypeArgumentsFromParameterBounds, /*2*/ aNotNullNullNotNull: TypeArgumentsFromParameterBounds, /*3*/ aNotNullNullNull: TypeArgumentsFromParameterBounds, /*4*/ a: A, /*5*/ b: B, /*6*/ c: C): kotlin.Unit +public fun main(/*0*/ aNotNullNotNullNotNull: TypeArgumentsFromParameterBounds, /*1*/ aNotNullNotNullNull: TypeArgumentsFromParameterBounds, /*2*/ aNotNullNullNotNull: TypeArgumentsFromParameterBounds, /*3*/ aNotNullNullNull: TypeArgumentsFromParameterBounds, /*4*/ a: A, /*5*/ b: B): kotlin.Unit -public open class A { +@org.jspecify.nullness.NullMarked public open class A { public constructor A() - public open fun bar(/*0*/ a: TypeArgumentsFromParameterBounds<@org.jspecify.nullness.Nullable Test!, @org.jspecify.nullness.Nullable Test!, @org.jspecify.nullness.Nullable Test!>!): kotlin.Unit - 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 -} - -@org.jspecify.nullness.NullMarked public open class B { - public constructor B() public open fun bar(/*0*/ a: TypeArgumentsFromParameterBounds!): kotlin.Unit 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 open class C { - public constructor C() +public open class B { + public constructor B() public open fun bar(/*0*/ a: TypeArgumentsFromParameterBounds!): kotlin.Unit public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int @@ -40,12 +32,3 @@ public open class Test { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } -@org.jspecify.nullness.NullMarked public open class Use { - public constructor Use() - 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 open fun main(/*0*/ aNotNullNotNullNotNull: TypeArgumentsFromParameterBounds!, /*1*/ aNotNullNotNullNull: TypeArgumentsFromParameterBounds!, /*2*/ aNotNullNullNotNull: TypeArgumentsFromParameterBounds!, /*3*/ aNotNullNullNull: TypeArgumentsFromParameterBounds!, /*4*/ a: A!, /*5*/ b: B!, /*6*/ c: C!): kotlin.Unit -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.fir.kt new file mode 100644 index 00000000000..8ac35fd76ea --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.fir.kt @@ -0,0 +1,47 @@ +// JSPECIFY_MUTE + +// FILE: A.java +import org.jspecify.nullness.*; + +@NullMarked +public class A { + public void foo(@NullnessUnspecified T t) {} + public void bar(E e) {} +} + +// FILE: B.java +import org.jspecify.nullness.*; +@NullMarked +public class B { + public void foo(T t) {} + public void bar(E e) {} +} + +// FILE: Test.java +public class Test {} + +// FILE: main.kt +// jspecify_nullness_mismatch +fun main(a1: A<Any?>, a2: A, b1: B<Any?>, b2: B, x: T): Unit { + a1.foo(null) + // jspecify_nullness_mismatch + a1.bar(null) + a1.bar(x) + + a2.foo(null) + // jspecify_nullness_mismatch + a2.bar(null) + a2.bar(x) + + // jspecify_nullness_mismatch + b1.foo(null) + // jspecify_nullness_mismatch + b1.bar(null) + b1.bar(x) + + // jspecify_nullness_mismatch + b2.foo(null) + // jspecify_nullness_mismatch + b2.bar(null) + b2.bar(x) +} diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/TypeParameterBounds.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.fir.txt similarity index 71% rename from compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/TypeParameterBounds.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.fir.txt index 619d8944a67..68809cb4e1f 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/TypeParameterBounds.txt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.fir.txt @@ -26,11 +26,3 @@ public open class Test { public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } - -@org.jspecify.nullness.NullMarked public open class TypeParameterBounds { - public constructor TypeParameterBounds() - 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/*package*/ open fun main(/*0*/ a1: A<@org.jspecify.nullness.Nullable kotlin.Any!>!, /*1*/ a2: A!, /*2*/ b1: B<@org.jspecify.nullness.Nullable kotlin.Any!>!, /*3*/ b2: B!, /*4*/ x: T!): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.kt new file mode 100644 index 00000000000..64a3e932bc3 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.kt @@ -0,0 +1,47 @@ +// JSPECIFY_MUTE + +// FILE: A.java +import org.jspecify.nullness.*; + +@NullMarked +public class A { + public void foo(@NullnessUnspecified T t) {} + public void bar(E e) {} +} + +// FILE: B.java +import org.jspecify.nullness.*; +@NullMarked +public class B { + public void foo(T t) {} + public void bar(E e) {} +} + +// FILE: Test.java +public class Test {} + +// FILE: main.kt +// jspecify_nullness_mismatch +fun main(a1: A<Any?>, a2: A, b1: B<Any?>, b2: B, x: T): Unit { + a1.foo(null) + // jspecify_nullness_mismatch + a1.bar(null) + a1.bar(x) + + a2.foo(null) + // jspecify_nullness_mismatch + a2.bar(null) + a2.bar(x) + + // jspecify_nullness_mismatch + b1.foo(null) + // jspecify_nullness_mismatch + b1.bar(null) + b1.bar(x) + + // jspecify_nullness_mismatch + b2.foo(null) + // jspecify_nullness_mismatch + b2.bar(null) + b2.bar(x) +} \ No newline at end of file diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/TypeParameterBounds.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.txt similarity index 71% rename from compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/TypeParameterBounds.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.txt index 619d8944a67..76b1239b0a8 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/TypeParameterBounds.txt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.txt @@ -27,10 +27,3 @@ public open class Test { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } -@org.jspecify.nullness.NullMarked public open class TypeParameterBounds { - public constructor TypeParameterBounds() - 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/*package*/ open fun main(/*0*/ a1: A<@org.jspecify.nullness.Nullable kotlin.Any!>!, /*1*/ a2: A!, /*2*/ b1: B<@org.jspecify.nullness.Nullable kotlin.Any!>!, /*3*/ b2: B!, /*4*/ x: T!): kotlin.Unit - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/WildcardsWithDefault.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.fir.kt similarity index 59% rename from compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/WildcardsWithDefault.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.fir.kt index 13155237aea..e829d871a8f 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/WildcardsWithDefault.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.fir.kt @@ -1,5 +1,20 @@ -// JAVA_SOURCES: WildcardsWithDefault.java +// JSPECIFY_MUTE +// FILE: WildcardsWithDefault.java +import org.jspecify.nullness.*; + +@NullMarked +public class WildcardsWithDefault { + public void noBoundsNotNull(A a) {} + public void noBoundsNullable(A a) {} +} + +// FILE: A.java +import org.jspecify.nullness.*; + +public class A {} + +// FILE: main.kt fun main( aNotNullNotNullNotNull: A, aNotNullNotNullNull: A, @@ -7,8 +22,8 @@ fun main( aNotNullNullNull: A, b: WildcardsWithDefault ): Unit { - // jspecify_nullness_mismatch b.noBoundsNotNull(aNotNullNotNullNotNull) + // jspecify_nullness_mismatch b.noBoundsNotNull(aNotNullNotNullNull) // jspecify_nullness_mismatch b.noBoundsNotNull(aNotNullNullNotNull) diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/WildcardsWithDefault.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.fir.txt similarity index 60% rename from compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/WildcardsWithDefault.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.fir.txt index 7b1bc5bb428..132ecb62505 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/WildcardsWithDefault.txt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.fir.txt @@ -9,21 +9,11 @@ public open class A!, /*1*/ aNotNullNotNullNull: A!, /*2*/ aNotNullNullNotNull: A!, /*3*/ aNotNullNullNull: A!, /*4*/ b: WildcardsWithDefault!): kotlin.Unit -} - @org.jspecify.nullness.NullMarked public open class WildcardsWithDefault { public constructor WildcardsWithDefault() 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 fun noBoundsNotNull(/*0*/ a: A<*, *, *>!): kotlin.Unit - public open fun noBoundsNullable(/*0*/ a: A<*, *, *>!): kotlin.Unit + public open fun noBoundsNullable(/*0*/ a: A!): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/WildcardsWithDefault.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.kt similarity index 59% rename from compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/WildcardsWithDefault.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.kt index eeb88cdf08a..e829d871a8f 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/WildcardsWithDefault.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.kt @@ -1,6 +1,20 @@ -// JAVA_SOURCES: WildcardsWithDefault.java -// JSPECIFY_STATE warn +// JSPECIFY_MUTE +// FILE: WildcardsWithDefault.java +import org.jspecify.nullness.*; + +@NullMarked +public class WildcardsWithDefault { + public void noBoundsNotNull(A a) {} + public void noBoundsNullable(A a) {} +} + +// FILE: A.java +import org.jspecify.nullness.*; + +public class A {} + +// FILE: main.kt fun main( aNotNullNotNullNotNull: A, aNotNullNotNullNull: A, @@ -8,8 +22,8 @@ fun main( aNotNullNullNull: A, b: WildcardsWithDefault ): Unit { - // jspecify_nullness_mismatch b.noBoundsNotNull(aNotNullNotNullNotNull) + // jspecify_nullness_mismatch b.noBoundsNotNull(aNotNullNotNullNull) // jspecify_nullness_mismatch b.noBoundsNotNull(aNotNullNullNotNull) diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/WildcardsWithDefault.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.txt similarity index 60% rename from compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/WildcardsWithDefault.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.txt index 7b1bc5bb428..5bbeb3a608a 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/WildcardsWithDefault.txt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.txt @@ -9,21 +9,12 @@ public open class A!, /*1*/ aNotNullNotNullNull: A!, /*2*/ aNotNullNullNotNull: A!, /*3*/ aNotNullNullNull: A!, /*4*/ b: WildcardsWithDefault!): kotlin.Unit -} - @org.jspecify.nullness.NullMarked public open class WildcardsWithDefault { public constructor WildcardsWithDefault() 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 fun noBoundsNotNull(/*0*/ a: A<*, *, *>!): kotlin.Unit - public open fun noBoundsNullable(/*0*/ a: A<*, *, *>!): kotlin.Unit + public open fun noBoundsNullable(/*0*/ a: A!): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } + diff --git a/compiler/testData/foreignAnnotations/java8Tests/jsr305/defaultAnnotationAppliedToType.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/defaultAnnotationAppliedToType.kt similarity index 98% rename from compiler/testData/foreignAnnotations/java8Tests/jsr305/defaultAnnotationAppliedToType.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/defaultAnnotationAppliedToType.kt index b456190a040..979dfdc53fa 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/jsr305/defaultAnnotationAppliedToType.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/defaultAnnotationAppliedToType.kt @@ -1,9 +1,9 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER // SKIP_JAVAC // SOURCE_RETENTION_ANNOTATIONS +// JSR305_GLOBAL_REPORT: strict // FILE: spr/NonNullApi.java - package spr; import java.lang.annotation.Documented; @@ -23,7 +23,6 @@ public @interface NonNullApi { } // FILE: spr/NullableApi.java - package spr; import java.lang.annotation.Documented; @@ -44,7 +43,6 @@ public @interface NullableApi { } // FILE: A.java - import spr.*; import java.util.*; @@ -58,7 +56,6 @@ public class A { } // FILE: main.kt - fun main(a: A) { a.foo("").length a.foo(null)?.length diff --git a/compiler/testData/foreignAnnotations/java8Tests/jsr305/defaultAnnotationAppliedToType.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/defaultAnnotationAppliedToType.txt similarity index 100% rename from compiler/testData/foreignAnnotations/java8Tests/jsr305/defaultAnnotationAppliedToType.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/defaultAnnotationAppliedToType.txt diff --git a/compiler/testData/foreignAnnotations/java8Tests/jsr305/defaultAnnotationAppliedToTypeForCompiledJava.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/defaultAnnotationAppliedToTypeForCompiledJava.kt similarity index 98% rename from compiler/testData/foreignAnnotations/java8Tests/jsr305/defaultAnnotationAppliedToTypeForCompiledJava.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/defaultAnnotationAppliedToTypeForCompiledJava.kt index e507782179b..34ef4c49f09 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/jsr305/defaultAnnotationAppliedToTypeForCompiledJava.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/defaultAnnotationAppliedToTypeForCompiledJava.kt @@ -1,9 +1,9 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER // SKIP_JAVAC // SOURCE_RETENTION_ANNOTATIONS +// JSR305_GLOBAL_REPORT: strict // FILE: spr/NonNullApi.java - package spr; import java.lang.annotation.Documented; @@ -23,7 +23,6 @@ public @interface NonNullApi { } // FILE: spr/NullableApi.java - package spr; import java.lang.annotation.Documented; @@ -44,7 +43,6 @@ public @interface NullableApi { } // FILE: A.java - import spr.*; import java.util.*; @@ -56,7 +54,6 @@ public class A { } // FILE: main.kt - fun main(a: A) { a.foo("").length a.foo(null)?.length diff --git a/compiler/testData/foreignAnnotations/java8Tests/jsr305/defaultAnnotationAppliedToTypeForCompiledJava.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/defaultAnnotationAppliedToTypeForCompiledJava.txt similarity index 100% rename from compiler/testData/foreignAnnotations/java8Tests/jsr305/defaultAnnotationAppliedToTypeForCompiledJava.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/defaultAnnotationAppliedToTypeForCompiledJava.txt diff --git a/compiler/testData/foreignAnnotations/java8Tests/jsr305/springNullableWithTypeUse.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/springNullableWithTypeUse.kt similarity index 98% rename from compiler/testData/foreignAnnotations/java8Tests/jsr305/springNullableWithTypeUse.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/springNullableWithTypeUse.kt index b6053f12fd8..79296525360 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/jsr305/springNullableWithTypeUse.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/springNullableWithTypeUse.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER +// JSR305_GLOBAL_REPORT: strict // FILE: spr/Nullable.java - package spr; import java.lang.annotation.Documented; @@ -22,7 +22,6 @@ public @interface Nullable { } // FILE: spr/NonNullApi.java - package spr; import java.lang.annotation.Documented; @@ -42,7 +41,6 @@ public @interface NonNullApi { } // FILE: A.java - import spr.*; @NonNullApi @@ -64,7 +62,6 @@ public class A { } // FILE: main.kt - fun main(a: A) { a.foo("", null)?.length a.foo("", null).length diff --git a/compiler/testData/foreignAnnotations/java8Tests/jsr305/springNullableWithTypeUse.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/springNullableWithTypeUse.txt similarity index 100% rename from compiler/testData/foreignAnnotations/java8Tests/jsr305/springNullableWithTypeUse.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/springNullableWithTypeUse.txt diff --git a/compiler/testData/foreignAnnotations/java8Tests/jsr305/typeArguments.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/typeArguments.kt similarity index 98% rename from compiler/testData/foreignAnnotations/java8Tests/jsr305/typeArguments.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/typeArguments.kt index c7c896bc587..53ab6c86e4d 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/jsr305/typeArguments.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/typeArguments.kt @@ -3,8 +3,9 @@ // RENDER_PACKAGE: test // SOURCE_RETENTION_ANNOTATIONS // WITH_RUNTIME -// FILE: spr/Nullable.java +// JSR305_GLOBAL_REPORT: strict +// FILE: spr/Nullable.java package spr; import java.lang.annotation.Documented; @@ -25,7 +26,6 @@ public @interface Nullable { } // FILE: spr/NonNullApi.java - package spr; import java.lang.annotation.Documented; @@ -45,12 +45,10 @@ public @interface NonNullApi { } // FILE: test/package-info.java - @spr.NonNullApi() package test; // FILE: test/L.java - package test; public class L, S> { @@ -62,7 +60,6 @@ public class L, S> { } // FILE: test/A.java - package test; import spr.*; @@ -77,7 +74,6 @@ public class A { } // FILE: main.kt - import test.L fun main(a: test.A, l: L, Int?>, l1: L, Int>) { diff --git a/compiler/testData/foreignAnnotations/java8Tests/jsr305/typeArguments.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/typeArguments.txt similarity index 100% rename from compiler/testData/foreignAnnotations/java8Tests/jsr305/typeArguments.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/typeArguments.txt diff --git a/compiler/testData/foreignAnnotations/java8Tests/jsr305/typeUseVsMethodConflict.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/typeUseVsMethodConflict.kt similarity index 98% rename from compiler/testData/foreignAnnotations/java8Tests/jsr305/typeUseVsMethodConflict.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/typeUseVsMethodConflict.kt index a5e561a8b84..a18cdcbf352 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/jsr305/typeUseVsMethodConflict.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/typeUseVsMethodConflict.kt @@ -1,9 +1,9 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER // SKIP_JAVAC // SOURCE_RETENTION_ANNOTATIONS +// JSR305_GLOBAL_REPORT: strict // FILE: spr/NonNullApi.java - package spr; import java.lang.annotation.Documented; @@ -23,7 +23,6 @@ public @interface NonNullApi { } // FILE: spr/NullableApi.java - package spr; import java.lang.annotation.Documented; @@ -44,7 +43,6 @@ public @interface NullableApi { } // FILE: A.java - import spr.*; import java.util.*; @@ -58,7 +56,6 @@ public class A { } // FILE: main.kt - fun main(a: A) { a.foo("").length a.foo(null)?.length diff --git a/compiler/testData/foreignAnnotations/java8Tests/jsr305/typeUseVsMethodConflict.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/typeUseVsMethodConflict.txt similarity index 100% rename from compiler/testData/foreignAnnotations/java8Tests/jsr305/typeUseVsMethodConflict.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/typeUseVsMethodConflict.txt diff --git a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ClassTypeParameterBound.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/classTypeParameterBound.fir.kt similarity index 73% rename from compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ClassTypeParameterBound.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/classTypeParameterBound.fir.kt index 4dfa84a3587..b76c1edd98f 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ClassTypeParameterBound.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/classTypeParameterBound.fir.kt @@ -2,6 +2,17 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE // SKIP_TXT +// FILE: ClassTypeParameterBound.java +// INCLUDE_JAVA_AS_BINARY + +import org.jetbrains.annotations.NotNull; + +public class ClassTypeParameterBound { + ClassTypeParameterBound(T x) { } + ClassTypeParameterBound() { } +} + +// FILE: main.kt fun main(x: ClassTypeParameterBound<String?>, y: ClassTypeParameterBound, a: String?, b: String) { val x2 = ClassTypeParameterBound<String?>() val y2 = ClassTypeParameterBound() diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/classTypeParameterBound.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/classTypeParameterBound.kt new file mode 100644 index 00000000000..b76c1edd98f --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/classTypeParameterBound.kt @@ -0,0 +1,25 @@ +// !LANGUAGE: +TypeEnhancementImprovementsInStrictMode +ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated +// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE +// SKIP_TXT + +// FILE: ClassTypeParameterBound.java +// INCLUDE_JAVA_AS_BINARY + +import org.jetbrains.annotations.NotNull; + +public class ClassTypeParameterBound { + ClassTypeParameterBound(T x) { } + ClassTypeParameterBound() { } +} + +// FILE: main.kt +fun main(x: ClassTypeParameterBound<String?>, y: ClassTypeParameterBound, a: String?, b: String) { + val x2 = ClassTypeParameterBound<String?>() + val y2 = ClassTypeParameterBound() + + val x3 = ClassTypeParameterBound(a) + val y3 = ClassTypeParameterBound(b) + + val x4: ClassTypeParameterBound<String?> = ClassTypeParameterBound() + val y4: ClassTypeParameterBound = ClassTypeParameterBound() +} diff --git a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ClassTypeParameterBoundWithWarnings.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/classTypeParameterBoundWithWarnings.fir.kt similarity index 71% rename from compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ClassTypeParameterBoundWithWarnings.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/classTypeParameterBoundWithWarnings.fir.kt index 184846a4b67..ac9d2cb1105 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ClassTypeParameterBoundWithWarnings.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/classTypeParameterBoundWithWarnings.fir.kt @@ -2,7 +2,17 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE // SKIP_TXT -// TODO: report warnings "UPPER_BOUND_VIOLATED" +// FILE: ClassTypeParameterBoundWithWarnings.java +// INCLUDE_JAVA_AS_BINARY + +import org.jetbrains.annotations.NotNull; + +public class ClassTypeParameterBoundWithWarnings { + ClassTypeParameterBoundWithWarnings() { } + ClassTypeParameterBoundWithWarnings(T x) { } +} + +// FILE: main.kt fun main(x: ClassTypeParameterBoundWithWarnings<String?>, y: ClassTypeParameterBoundWithWarnings, a: String?, b: String) { val x2 = ClassTypeParameterBoundWithWarnings() val y2 = ClassTypeParameterBoundWithWarnings() diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/classTypeParameterBoundWithWarnings.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/classTypeParameterBoundWithWarnings.kt new file mode 100644 index 00000000000..ac9d2cb1105 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/classTypeParameterBoundWithWarnings.kt @@ -0,0 +1,25 @@ +// !LANGUAGE: +ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated +// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE +// SKIP_TXT + +// FILE: ClassTypeParameterBoundWithWarnings.java +// INCLUDE_JAVA_AS_BINARY + +import org.jetbrains.annotations.NotNull; + +public class ClassTypeParameterBoundWithWarnings { + ClassTypeParameterBoundWithWarnings() { } + ClassTypeParameterBoundWithWarnings(T x) { } +} + +// FILE: main.kt +fun main(x: ClassTypeParameterBoundWithWarnings<String?>, y: ClassTypeParameterBoundWithWarnings, a: String?, b: String) { + val x2 = ClassTypeParameterBoundWithWarnings() + val y2 = ClassTypeParameterBoundWithWarnings() + + val x3 = ClassTypeParameterBoundWithWarnings(a) + val y3 = ClassTypeParameterBoundWithWarnings(b) + + val x4: ClassTypeParameterBoundWithWarnings<String?> = ClassTypeParameterBoundWithWarnings() + val y4: ClassTypeParameterBoundWithWarnings = ClassTypeParameterBoundWithWarnings() +} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/returnType.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/returnType.fir.kt new file mode 100644 index 00000000000..342a26b0ad9 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/returnType.fir.kt @@ -0,0 +1,65 @@ +// !LANGUAGE: +TypeEnhancementImprovementsInStrictMode +ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated +// !DIAGNOSTICS: -UNUSED_PARAMETER +// SKIP_TXT + +// FILE: ReturnType.java +// INCLUDE_JAVA_AS_BINARY + +import org.jetbrains.annotations.*; + +public class ReturnType { + public interface A {} + + public A<@Nullable String, @Nullable T> foo1() { return null; } + public A<@Nullable String, @NotNull T> foo2() { return null; } + public A<@NotNull String, @NotNull T> foo3 = null; + public @NotNull T [] foo4 = null; + public ReturnType<@Nullable String> foo41 = null; + public T foo411 = null; + public @Nullable String [] foo5() { return null; } +} + +// FILE: main.kt +fun takeNotNullStringAndKNullable(x: ReturnType.A) {} +fun takeNullableStringAndKNullable(x: ReturnType.A) {} +fun takeNotNullStringAndNotNullK(x: ReturnType.A) {} +fun takeNullableStringAndNotNullK(x: ReturnType.A) {} +fun takeNotNullString(x: String) {} + +fun takeArrayOfNotNullString(x: Array) {} +fun takeArrayOfNullableString(x: Array) {} +fun takeArrayOfNotNullK(x: Array) {} +fun takeArrayOfNullableK(x: Array) {} + +fun main(a: ReturnType) { + val x1 = a.foo1() + takeNotNullStringAndKNullable(x1) + takeNullableStringAndKNullable(x1) + takeNotNullStringAndNotNullK(x1) + takeNullableStringAndNotNullK(x1) + takeNotNullString(a.foo41.foo411) + + val x2 = a.foo2() + takeNotNullStringAndKNullable(x2) + takeNullableStringAndKNullable(x2) + takeNotNullStringAndNotNullK(x2) + takeNullableStringAndNotNullK(x2) + + val x3 = a.foo3 + takeNotNullStringAndKNullable(x3) + takeNullableStringAndKNullable(x3) + takeNotNullStringAndNotNullK(x3) + takeNullableStringAndNotNullK(x3) + + val x4 = a.foo4 + takeArrayOfNotNullString(x4) + takeArrayOfNullableString(x4) + takeArrayOfNotNullK(x4) + takeArrayOfNullableK(x4) + + val x5 = a.foo5() + takeArrayOfNotNullString(x5) + takeArrayOfNullableString(x5) + takeArrayOfNotNullK(x5) + takeArrayOfNullableK(x5) +} diff --git a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ReturnType.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/returnType.kt similarity index 80% rename from compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ReturnType.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/returnType.kt index 018d98a6c99..f2facf7d2a2 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ReturnType.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/returnType.kt @@ -2,6 +2,24 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER // SKIP_TXT +// FILE: ReturnType.java +// INCLUDE_JAVA_AS_BINARY + +import org.jetbrains.annotations.*; + +public class ReturnType { + public interface A {} + + public A<@Nullable String, @Nullable T> foo1() { return null; } + public A<@Nullable String, @NotNull T> foo2() { return null; } + public A<@NotNull String, @NotNull T> foo3 = null; + public @NotNull T [] foo4 = null; + public ReturnType<@Nullable String> foo41 = null; + public T foo411 = null; + public @Nullable String [] foo5() { return null; } +} + +// FILE: main.kt fun takeNotNullStringAndKNullable(x: ReturnType.A) {} fun takeNullableStringAndKNullable(x: ReturnType.A) {} fun takeNotNullStringAndNotNullK(x: ReturnType.A) {} @@ -13,26 +31,25 @@ fun takeArrayOfNullableString(x: Array) {} fun takeArrayOfNotNullK(x: Array) {} fun takeArrayOfNullableK(x: Array) {} -// FILE: main.kt fun main(a: ReturnType) { val x1 = ..ReturnType.A<@org.jetbrains.annotations.Nullable kotlin.String?, @org.jetbrains.annotations.Nullable R?>?)")!>a.foo1() takeNotNullStringAndKNullable(x1) takeNullableStringAndKNullable(x1) - takeNotNullStringAndNotNullK(", "ReturnType.A!")!>x1) + takeNotNullStringAndNotNullK(; ReturnType.A!")!>x1) takeNullableStringAndNotNullK(x1) takeNotNullString(a.foo41.foo411) val x2 = ..ReturnType.A<@org.jetbrains.annotations.Nullable kotlin.String?, @org.jetbrains.annotations.NotNull R!!>?)")!>a.foo2() takeNotNullStringAndKNullable(x2) takeNullableStringAndKNullable(x2) - takeNotNullStringAndNotNullK(", "ReturnType.A!")!>x2) + takeNotNullStringAndNotNullK(; ReturnType.A!")!>x2) takeNullableStringAndNotNullK(x2) val x3 = ..ReturnType.A<@org.jetbrains.annotations.NotNull kotlin.String, @org.jetbrains.annotations.NotNull R!!>?)")!>a.foo3 takeNotNullStringAndKNullable(x3) takeNullableStringAndKNullable(x3) takeNotNullStringAndNotNullK(x3) - takeNullableStringAndNotNullK(", "ReturnType.A!")!>x3) + takeNullableStringAndNotNullK(; ReturnType.A!")!>x3) val x4 = ..kotlin.Array?)")!>a.foo4 takeArrayOfNotNullString(x4) diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/returnTypeWithWarnings.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/returnTypeWithWarnings.fir.kt new file mode 100644 index 00000000000..3ddf3de6953 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/returnTypeWithWarnings.fir.kt @@ -0,0 +1,65 @@ +// !LANGUAGE: +ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated +// !DIAGNOSTICS: -UNUSED_PARAMETER +// SKIP_TXT + +// FILE: ReturnTypeWithWarnings.java +// INCLUDE_JAVA_AS_BINARY + +import org.jetbrains.annotations.*; + +public class ReturnTypeWithWarnings { + public interface A {} + + public A<@Nullable String, @Nullable T> foo1() { return null; } + public A<@Nullable String, @NotNull T> foo2() { return null; } + public A<@NotNull String, @NotNull T> foo3 = null; + public @NotNull T [] foo4 = null; + public ReturnTypeWithWarnings<@Nullable String> foo41 = null; + public T foo411 = null; + public @Nullable String [] foo5() { return null; } +} + +// FILE: main.kt +fun takeNotNullStringAndKNullable(x: ReturnTypeWithWarnings.A) {} +fun takeNullableStringAndKNullable(x: ReturnTypeWithWarnings.A) {} +fun takeNotNullStringAndNotNullK(x: ReturnTypeWithWarnings.A) {} +fun takeNullableStringAndNotNullK(x: ReturnTypeWithWarnings.A) {} +fun takeNotNullString(x: String) {} + +fun takeArrayOfNotNullString(x: Array) {} +fun takeArrayOfNullableString(x: Array) {} +fun takeArrayOfNotNullK(x: Array) {} +fun takeArrayOfNullableK(x: Array) {} + +fun main(a: ReturnTypeWithWarnings) { + val x1 = a.foo1() + takeNotNullStringAndKNullable(x1) + takeNullableStringAndKNullable(x1) + takeNotNullStringAndNotNullK(x1) + takeNullableStringAndNotNullK(x1) + takeNotNullString(a.foo41.foo411) + + val x2 = a.foo2() + takeNotNullStringAndKNullable(x2) + takeNullableStringAndKNullable(x2) + takeNotNullStringAndNotNullK(x2) + takeNullableStringAndNotNullK(x2) + + val x3 = a.foo3 + takeNotNullStringAndKNullable(x3) + takeNullableStringAndKNullable(x3) + takeNotNullStringAndNotNullK(x3) + takeNullableStringAndNotNullK(x3) + + val x4 = a.foo4 + takeArrayOfNotNullString(x4) + takeArrayOfNullableString(x4) + takeArrayOfNotNullK(x4) + takeArrayOfNullableK(x4) + + val x5 = a.foo5() + takeArrayOfNotNullString(x5) + takeArrayOfNullableString(x5) + takeArrayOfNotNullK(x5) + takeArrayOfNullableK(x5) +} diff --git a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ReturnTypeWithWarnings.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/returnTypeWithWarnings.kt similarity index 72% rename from compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ReturnTypeWithWarnings.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/returnTypeWithWarnings.kt index 85355f00247..544c25af6dd 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ReturnTypeWithWarnings.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/returnTypeWithWarnings.kt @@ -2,6 +2,24 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER // SKIP_TXT +// FILE: ReturnTypeWithWarnings.java +// INCLUDE_JAVA_AS_BINARY + +import org.jetbrains.annotations.*; + +public class ReturnTypeWithWarnings { + public interface A {} + + public A<@Nullable String, @Nullable T> foo1() { return null; } + public A<@Nullable String, @NotNull T> foo2() { return null; } + public A<@NotNull String, @NotNull T> foo3 = null; + public @NotNull T [] foo4 = null; + public ReturnTypeWithWarnings<@Nullable String> foo41 = null; + public T foo411 = null; + public @Nullable String [] foo5() { return null; } +} + +// FILE: main.kt fun takeNotNullStringAndKNullable(x: ReturnTypeWithWarnings.A) {} fun takeNullableStringAndKNullable(x: ReturnTypeWithWarnings.A) {} fun takeNotNullStringAndNotNullK(x: ReturnTypeWithWarnings.A) {} @@ -13,32 +31,31 @@ fun takeArrayOfNullableString(x: Array) {} fun takeArrayOfNotNullK(x: Array) {} fun takeArrayOfNullableK(x: Array) {} -// FILE: main.kt fun main(a: ReturnTypeWithWarnings) { val x1 = ..ReturnTypeWithWarnings.A<(@org.jetbrains.annotations.Nullable kotlin.String..@org.jetbrains.annotations.Nullable kotlin.String?), (@org.jetbrains.annotations.Nullable R..@org.jetbrains.annotations.Nullable R?)>?)")!>a.foo1() - takeNotNullStringAndKNullable(", "ReturnTypeWithWarnings.A!")!>x1) + takeNotNullStringAndKNullable(; ReturnTypeWithWarnings.A!")!>x1) takeNullableStringAndKNullable(x1) - takeNotNullStringAndNotNullK(", "ReturnTypeWithWarnings.A!"), TYPE_MISMATCH("Any", "R!"), TYPE_MISMATCH("Any", "R!")!>x1) + takeNotNullStringAndNotNullK(; ReturnTypeWithWarnings.A!"), TYPE_MISMATCH("Any; R!"), TYPE_MISMATCH("Any; R!")!>x1) takeNullableStringAndNotNullK(x1) - takeNotNullString(a.foo41.foo411) + takeNotNullString(a.foo41.foo411) val x2 = ..ReturnTypeWithWarnings.A<(@org.jetbrains.annotations.Nullable kotlin.String..@org.jetbrains.annotations.Nullable kotlin.String?), (@org.jetbrains.annotations.NotNull R..@org.jetbrains.annotations.NotNull R?)>?)")!>a.foo2() - takeNotNullStringAndKNullable(", "ReturnTypeWithWarnings.A!")!>x2) - takeNullableStringAndKNullable(", "ReturnTypeWithWarnings.A!")!>x2) - takeNotNullStringAndNotNullK(", "ReturnTypeWithWarnings.A!"), TYPE_MISMATCH("Any", "R!"), TYPE_MISMATCH("Any", "R!")!>x2) + takeNotNullStringAndKNullable(; ReturnTypeWithWarnings.A!")!>x2) + takeNullableStringAndKNullable(; ReturnTypeWithWarnings.A!")!>x2) + takeNotNullStringAndNotNullK(; ReturnTypeWithWarnings.A!"), TYPE_MISMATCH("Any; R!"), TYPE_MISMATCH("Any; R!")!>x2) takeNullableStringAndNotNullK(x2) val x3 = ..ReturnTypeWithWarnings.A<(@org.jetbrains.annotations.NotNull kotlin.String..@org.jetbrains.annotations.NotNull kotlin.String?), (@org.jetbrains.annotations.NotNull R..@org.jetbrains.annotations.NotNull R?)>?)")!>a.foo3 - takeNotNullStringAndKNullable(", "ReturnTypeWithWarnings.A!")!>x3) - takeNullableStringAndKNullable(", "ReturnTypeWithWarnings.A!")!>x3) + takeNotNullStringAndKNullable(; ReturnTypeWithWarnings.A!")!>x3) + takeNullableStringAndKNullable(; ReturnTypeWithWarnings.A!")!>x3) takeNotNullStringAndNotNullK(x3) - takeNullableStringAndNotNullK(", "ReturnTypeWithWarnings.A!"), TYPE_MISMATCH("Any", "R!"), TYPE_MISMATCH("Any", "R!")!>x3) + takeNullableStringAndNotNullK(; ReturnTypeWithWarnings.A!"), TYPE_MISMATCH("Any; R!"), TYPE_MISMATCH("Any; R!")!>x3) val x4 = ..kotlin.Array)")!>a.foo4 takeArrayOfNotNullString(x4) takeArrayOfNullableString(x4) takeArrayOfNotNullK(x4) - takeArrayOfNullableK(", "Array<(out) R!!>")!>x4) + takeArrayOfNullableK(; Array<(out) R!!>")!>x4) val x5 = ?..kotlin.Array?)")!>a.foo5() takeArrayOfNotNullString(x5) diff --git a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ValueParameter.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/valueParameter.fir.kt similarity index 79% rename from compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ValueParameter.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/valueParameter.fir.kt index e07d64b9aa3..4c974c79007 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ValueParameter.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/valueParameter.fir.kt @@ -2,6 +2,24 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -CAST_NEVER_SUCCEEDS // SKIP_TXT +// FILE: ValueParameter.java +// INCLUDE_JAVA_AS_BINARY + +import org.jetbrains.annotations.*; + +public class ValueParameter { + public interface A {} + + public void foo1(A<@Nullable String, @Nullable T> x) { } + public void foo2(A<@Nullable String, @NotNull T> x) { } + public void foo3(A<@NotNull String, @NotNull T> x) { } + public void foo4(@NotNull T [] x) { } + public void foo41(@Nullable String x) { } + public void foo411(T x) { } + public void foo5(@Nullable String [] x) { } +} + +// FILE: main.kt fun getNotNullStringAndKNullable() = null as ValueParameter.A fun getNullableStringAndKNullable() = null as ValueParameter.A fun getNotNullStringAndNotNullK() = null as ValueParameter.A @@ -13,7 +31,6 @@ fun getArrayOfNullableString() = null as Array fun getArrayOfNotNullK() = null as Array fun getArrayOfNullableK() = null as Array -// FILE: main.kt fun main(a: ValueParameter) { a.foo1(getNotNullStringAndKNullable()) a.foo1(getNullableStringAndKNullable()) diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/valueParameter.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/valueParameter.kt new file mode 100644 index 00000000000..4c974c79007 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/valueParameter.kt @@ -0,0 +1,62 @@ +// !LANGUAGE: +TypeEnhancementImprovementsInStrictMode +ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated +// !DIAGNOSTICS: -UNUSED_PARAMETER -CAST_NEVER_SUCCEEDS +// SKIP_TXT + +// FILE: ValueParameter.java +// INCLUDE_JAVA_AS_BINARY + +import org.jetbrains.annotations.*; + +public class ValueParameter { + public interface A {} + + public void foo1(A<@Nullable String, @Nullable T> x) { } + public void foo2(A<@Nullable String, @NotNull T> x) { } + public void foo3(A<@NotNull String, @NotNull T> x) { } + public void foo4(@NotNull T [] x) { } + public void foo41(@Nullable String x) { } + public void foo411(T x) { } + public void foo5(@Nullable String [] x) { } +} + +// FILE: main.kt +fun getNotNullStringAndKNullable() = null as ValueParameter.A +fun getNullableStringAndKNullable() = null as ValueParameter.A +fun getNotNullStringAndNotNullK() = null as ValueParameter.A +fun getNullableStringAndNotNullK() = null as ValueParameter.A +fun getNotNullString() = null as String + +fun getArrayOfNotNullString() = null as Array +fun getArrayOfNullableString() = null as Array +fun getArrayOfNotNullK() = null as Array +fun getArrayOfNullableK() = null as Array + +fun main(a: ValueParameter) { + a.foo1(getNotNullStringAndKNullable()) + a.foo1(getNullableStringAndKNullable()) + a.foo1(getNotNullStringAndNotNullK()) + a.foo1(getNullableStringAndNotNullK()) + + a.foo2(getNotNullStringAndKNullable()) + a.foo2(getNullableStringAndKNullable()) + a.foo2(getNotNullStringAndNotNullK()) + a.foo2(getNullableStringAndNotNullK()) + + a.foo3(getNotNullStringAndKNullable()) + a.foo3(getNullableStringAndKNullable()) + a.foo3(getNotNullStringAndNotNullK()) + a.foo3(getNullableStringAndNotNullK()) + + a.foo4(getArrayOfNotNullString()) + a.foo4(getArrayOfNullableString()) + a.foo4(getArrayOfNotNullK()) + a.foo4(getArrayOfNullableK()) + + a.foo5(getArrayOfNotNullString()) + a.foo5(getArrayOfNullableString()) + a.foo5(getArrayOfNotNullK()) + a.foo5(getArrayOfNullableK()) + + a.foo41(getNotNullString()) + a.foo411(getNotNullString()) +} diff --git a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ValueParameterWithWarnings.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/valueParameterWithWarnings.fir.kt similarity index 81% rename from compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ValueParameterWithWarnings.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/valueParameterWithWarnings.fir.kt index 95819ad9598..1a3ed2b3937 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ValueParameterWithWarnings.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/valueParameterWithWarnings.fir.kt @@ -2,6 +2,24 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -CAST_NEVER_SUCCEEDS // SKIP_TXT +// FILE: ValueParameterWithWarnings.java +// INCLUDE_JAVA_AS_BINARY + +import org.jetbrains.annotations.*; + +public class ValueParameterWithWarnings { + public interface A {} + + public void foo1(A<@Nullable String, @Nullable T> x) { } + public void foo2(A<@Nullable String, @NotNull T> x) { } + public void foo3(A<@NotNull String, @NotNull T> x) { } + public void foo4(@NotNull T [] x) { } + public void foo41(@Nullable String x) { } + public void foo411(T x) { } + public void foo5(@Nullable String [] x) { } +} + +// FILE: main.kt fun getNotNullStringAndKNullable() = null as ValueParameterWithWarnings.A fun getNullableStringAndKNullable() = null as ValueParameterWithWarnings.A fun getNotNullStringAndNotNullK() = null as ValueParameterWithWarnings.A @@ -13,7 +31,6 @@ fun getArrayOfNullableString() = null as Array fun getArrayOfNotNullK() = null as Array fun getArrayOfNullableK() = null as Array -// FILE: main.kt fun main(a: ValueParameterWithWarnings) { a.foo1(getNotNullStringAndKNullable()) a.foo1(getNullableStringAndKNullable()) diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/valueParameterWithWarnings.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/valueParameterWithWarnings.kt new file mode 100644 index 00000000000..1a3ed2b3937 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/valueParameterWithWarnings.kt @@ -0,0 +1,62 @@ +// !LANGUAGE: +ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated +// !DIAGNOSTICS: -UNUSED_PARAMETER -CAST_NEVER_SUCCEEDS +// SKIP_TXT + +// FILE: ValueParameterWithWarnings.java +// INCLUDE_JAVA_AS_BINARY + +import org.jetbrains.annotations.*; + +public class ValueParameterWithWarnings { + public interface A {} + + public void foo1(A<@Nullable String, @Nullable T> x) { } + public void foo2(A<@Nullable String, @NotNull T> x) { } + public void foo3(A<@NotNull String, @NotNull T> x) { } + public void foo4(@NotNull T [] x) { } + public void foo41(@Nullable String x) { } + public void foo411(T x) { } + public void foo5(@Nullable String [] x) { } +} + +// FILE: main.kt +fun getNotNullStringAndKNullable() = null as ValueParameterWithWarnings.A +fun getNullableStringAndKNullable() = null as ValueParameterWithWarnings.A +fun getNotNullStringAndNotNullK() = null as ValueParameterWithWarnings.A +fun getNullableStringAndNotNullK() = null as ValueParameterWithWarnings.A +fun getNotNullString() = null as String + +fun getArrayOfNotNullString() = null as Array +fun getArrayOfNullableString() = null as Array +fun getArrayOfNotNullK() = null as Array +fun getArrayOfNullableK() = null as Array + +fun main(a: ValueParameterWithWarnings) { + a.foo1(getNotNullStringAndKNullable()) + a.foo1(getNullableStringAndKNullable()) + a.foo1(getNotNullStringAndNotNullK()) + a.foo1(getNullableStringAndNotNullK()) + + a.foo2(getNotNullStringAndKNullable()) + a.foo2(getNullableStringAndKNullable()) + a.foo2(getNotNullStringAndNotNullK()) + a.foo2(getNullableStringAndNotNullK()) + + a.foo3(getNotNullStringAndKNullable()) + a.foo3(getNullableStringAndKNullable()) + a.foo3(getNotNullStringAndNotNullK()) + a.foo3(getNullableStringAndNotNullK()) + + a.foo4(getArrayOfNotNullString()) + a.foo4(getArrayOfNullableString()) + a.foo4(getArrayOfNotNullK()) + a.foo4(getArrayOfNullableK()) + + a.foo5(getArrayOfNotNullString()) + a.foo5(getArrayOfNullableString()) + a.foo5(getArrayOfNotNullK()) + a.foo5(getArrayOfNullableK()) + + a.foo41(getNotNullString()) + a.foo411(getNotNullString()) +} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/annotatedTypeArguments.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/annotatedTypeArguments.fir.kt new file mode 100644 index 00000000000..25d923df9ca --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/annotatedTypeArguments.fir.kt @@ -0,0 +1,38 @@ +// JAVAC_EXPECTED_FILE +// FILE: AnnotatedTypeArguments.java +import org.checkerframework.checker.nullness.qual.*; + +interface P {} +interface L {} +interface S {} + +class AnnotatedTypeArguments { + + class A { + L, S>> foo(L, S>> x) {return null;} + } + + class B extends A { + // some complicated type tree + // return type and argument's type differ only by nullability of outermost type + @Nullable + L, @NonNull S>> foo(@NonNull L, @NonNull S>> x) {return null;} + } + + class C extends B { + // signature should be the same as in A + L, S>> foo(L, S>> x) {return null;} + } + + class D1 extends C { + // signature should be the same as in A, but annotated String-type should be platform + L, S>> foo(L, S>> x) {return null;} + } + + class D2 extends C { + // return type refined to not-nullable + // argument type here same as in A except outermost type (it becomes flexible because of conflict) + @NonNull + L, S>> foo(@Nullable L, S>> x) {return null;} + } +} diff --git a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/annotatedTypeArguments.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/annotatedTypeArguments.fir.txt similarity index 100% rename from compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/annotatedTypeArguments.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/annotatedTypeArguments.fir.txt diff --git a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/annotatedTypeArguments.javac.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/annotatedTypeArguments.javac.txt similarity index 100% rename from compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/annotatedTypeArguments.javac.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/annotatedTypeArguments.javac.txt diff --git a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/annotatedTypeArguments.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/annotatedTypeArguments.kt similarity index 99% rename from compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/annotatedTypeArguments.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/annotatedTypeArguments.kt index 8e3a2e7193f..25d923df9ca 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/annotatedTypeArguments.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/annotatedTypeArguments.kt @@ -1,6 +1,5 @@ // JAVAC_EXPECTED_FILE // FILE: AnnotatedTypeArguments.java - import org.checkerframework.checker.nullness.qual.*; interface P {} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/annotatedTypeArguments.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/annotatedTypeArguments.txt new file mode 100644 index 00000000000..9cee33afe67 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/annotatedTypeArguments.txt @@ -0,0 +1,48 @@ +package + +public/*package*/ open class AnnotatedTypeArguments { + public/*package*/ constructor AnnotatedTypeArguments() + 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/*package*/ open inner class A { + public/*package*/ constructor A() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public/*package*/ open fun foo(/*0*/ x: L!, S<*>!>!>!): L!, S<*>!>!>! + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + + public/*package*/ open inner class B : AnnotatedTypeArguments.A { + public/*package*/ constructor B() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + @org.checkerframework.checker.nullness.qual.Nullable public/*package*/ open override /*1*/ fun foo(/*0*/ @org.checkerframework.checker.nullness.qual.NonNull x: @org.checkerframework.checker.nullness.qual.NonNull L, @org.checkerframework.checker.nullness.qual.NonNull S<*>>!>): @org.checkerframework.checker.nullness.qual.Nullable L, @org.checkerframework.checker.nullness.qual.NonNull S<*>>!>? + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + + public/*package*/ open inner class C : AnnotatedTypeArguments.B { + public/*package*/ constructor C() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public/*package*/ open override /*1*/ fun foo(/*0*/ x: L, S<*>>!>): L, S<*>>!>? + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + + public/*package*/ open inner class D1 : AnnotatedTypeArguments.C { + public/*package*/ constructor D1() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public/*package*/ open override /*1*/ fun foo(/*0*/ x: L, S<*>>!>): L, S<*>>!>? + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + + public/*package*/ open inner class D2 : AnnotatedTypeArguments.C { + public/*package*/ constructor D2() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + @org.checkerframework.checker.nullness.qual.NonNull public/*package*/ open override /*1*/ fun foo(/*0*/ @org.checkerframework.checker.nullness.qual.Nullable x: @org.checkerframework.checker.nullness.qual.Nullable L, S<*>>!>!): @org.checkerframework.checker.nullness.qual.NonNull L, S<*>>!> + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } +} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/methodWithTypeParameter.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/methodWithTypeParameter.fir.kt new file mode 100644 index 00000000000..612eae0693d --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/methodWithTypeParameter.fir.kt @@ -0,0 +1,54 @@ +// JAVAC_EXPECTED_FILE +// FILE: Outer.java +import org.checkerframework.checker.nullness.qual.*; + +interface X {} +interface Y {} + +class Outer { + class A { + V foo(K x) { return null; } + + X bar(Y x) { return null; } + } + + class B extends A { + // OK, non-platform types + @Override + @NonNull + T2 foo(@Nullable T1 x) { return null; } + + // Parameter type is fully non-flexible (OK) + // Return type is `X?`. + // The reason is that we do not treat it as equal to return type of A.bar because they are base on different type parameters, + // so type enhancing happens only for outermost type. + // TODO: We should properly compare equality with specific local equality axioms (as when calculating overriden descriptors) + @Override + @Nullable + X<@Nullable R> bar(@NonNull Y<@NonNull R> x) { return null; } + } + + class C extends B { + // OK, non-platform types + @Override + J foo(I x) { return null; } + + // Parameter type is fully non-flexible (OK) + // Return type is `X?`, same is in B + @Override + X bar(Y x) { return null; } + } + + class D extends C { + // Return type is not-nullable, covariantly overridden, OK + // Parameter type is flexible, because of conflict with supertype, OK + @Override + @NonNull + W foo(@Nullable U x) { return null; } + + + @Override + @NonNull + X<@NonNull F> bar(@Nullable Y<@Nullable F> x) { return null; } + } +} diff --git a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/methodWithTypeParameter.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/methodWithTypeParameter.fir.txt similarity index 100% rename from compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/methodWithTypeParameter.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/methodWithTypeParameter.fir.txt diff --git a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/methodWithTypeParameter.javac.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/methodWithTypeParameter.javac.txt similarity index 100% rename from compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/methodWithTypeParameter.javac.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/methodWithTypeParameter.javac.txt diff --git a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/methodWithTypeParameter.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/methodWithTypeParameter.kt similarity index 99% rename from compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/methodWithTypeParameter.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/methodWithTypeParameter.kt index ae014ffe8a6..612eae0693d 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/methodWithTypeParameter.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/methodWithTypeParameter.kt @@ -1,6 +1,5 @@ // JAVAC_EXPECTED_FILE // FILE: Outer.java - import org.checkerframework.checker.nullness.qual.*; interface X {} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/methodWithTypeParameter.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/methodWithTypeParameter.txt new file mode 100644 index 00000000000..3f6c9954188 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/methodWithTypeParameter.txt @@ -0,0 +1,44 @@ +package + +public/*package*/ open class Outer { + public/*package*/ constructor Outer() + 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/*package*/ open inner class A { + public/*package*/ constructor A() + public/*package*/ open fun bar(/*0*/ x: Y!): X! + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public/*package*/ open fun foo(/*0*/ x: K!): V! + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + + public/*package*/ open inner class B : Outer.A { + public/*package*/ constructor B() + @java.lang.Override @org.checkerframework.checker.nullness.qual.Nullable public/*package*/ open override /*1*/ fun bar(/*0*/ @org.checkerframework.checker.nullness.qual.NonNull x: @org.checkerframework.checker.nullness.qual.NonNull Y<@org.checkerframework.checker.nullness.qual.NonNull R>): @org.checkerframework.checker.nullness.qual.Nullable X<@org.checkerframework.checker.nullness.qual.Nullable R!>? + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + @java.lang.Override @org.checkerframework.checker.nullness.qual.NonNull public/*package*/ open override /*1*/ fun foo(/*0*/ @org.checkerframework.checker.nullness.qual.Nullable x: @org.checkerframework.checker.nullness.qual.Nullable T1?): @org.checkerframework.checker.nullness.qual.NonNull T2 + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + + public/*package*/ open inner class C : Outer.B { + public/*package*/ constructor C() + @java.lang.Override public/*package*/ open override /*1*/ fun bar(/*0*/ x: Y): X? + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + @java.lang.Override public/*package*/ open override /*1*/ fun foo(/*0*/ x: I?): J + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + + public/*package*/ open inner class D : Outer.C { + public/*package*/ constructor D() + @java.lang.Override @org.checkerframework.checker.nullness.qual.NonNull public/*package*/ open override /*1*/ fun bar(/*0*/ @org.checkerframework.checker.nullness.qual.Nullable x: @org.checkerframework.checker.nullness.qual.Nullable Y<@org.checkerframework.checker.nullness.qual.Nullable F!>!): @org.checkerframework.checker.nullness.qual.NonNull X<@org.checkerframework.checker.nullness.qual.NonNull F!> + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + @java.lang.Override @org.checkerframework.checker.nullness.qual.NonNull public/*package*/ open override /*1*/ fun foo(/*0*/ @org.checkerframework.checker.nullness.qual.Nullable x: @org.checkerframework.checker.nullness.qual.Nullable U?): @org.checkerframework.checker.nullness.qual.NonNull W + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } +} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/notNullVarargsOverrides.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/notNullVarargsOverrides.fir.kt new file mode 100644 index 00000000000..7ae642b8032 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/notNullVarargsOverrides.fir.kt @@ -0,0 +1,21 @@ +// SOURCE_RETENTION_ANNOTATIONS +// FILE: BaseClass.java +import org.checkerframework.checker.nullness.qual.*; + +public class BaseClass { + public void loadCache(@NonNull Object... args) {} +} + +// FILE: main.kt +class A : BaseClass() { + // org.checkerframework.checker.nullness.qual.NonNull has @Target TYPE_USE, so it affects only elements type + override fun loadCache(vararg args: Any?) { + super.loadCache(*args) + } +} + +class B : BaseClass() { + override fun loadCache(vararg args: Any) { + super.loadCache(*args) + } +} diff --git a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/notNullVarargsOverrides.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/notNullVarargsOverrides.fir.txt similarity index 100% rename from compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/notNullVarargsOverrides.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/notNullVarargsOverrides.fir.txt diff --git a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/notNullVarargsOverrides.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/notNullVarargsOverrides.kt similarity index 99% rename from compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/notNullVarargsOverrides.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/notNullVarargsOverrides.kt index 54447f6dc80..7ae642b8032 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/notNullVarargsOverrides.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/notNullVarargsOverrides.kt @@ -7,7 +7,6 @@ public class BaseClass { } // FILE: main.kt - class A : BaseClass() { // org.checkerframework.checker.nullness.qual.NonNull has @Target TYPE_USE, so it affects only elements type override fun loadCache(vararg args: Any?) { diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/notNullVarargsOverrides.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/notNullVarargsOverrides.txt new file mode 100644 index 00000000000..e93bffc23b6 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/notNullVarargsOverrides.txt @@ -0,0 +1,26 @@ +package + +public final class A : BaseClass { + public constructor A() + 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 loadCache(/*0*/ @org.checkerframework.checker.nullness.qual.NonNull vararg args: @org.checkerframework.checker.nullness.qual.NonNull kotlin.Any /*kotlin.Array<(out) @org.checkerframework.checker.nullness.qual.NonNull kotlin.Any>*/): kotlin.Unit + public open fun loadCache(/*0*/ vararg args: kotlin.Any? /*kotlin.Array*/): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class B : BaseClass { + public constructor B() + 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*/ fun loadCache(/*0*/ vararg args: kotlin.Any /*kotlin.Array*/): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public open class BaseClass { + public constructor BaseClass() + 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 fun loadCache(/*0*/ @org.checkerframework.checker.nullness.qual.NonNull vararg args: @org.checkerframework.checker.nullness.qual.NonNull kotlin.Any /*kotlin.Array<(out) @org.checkerframework.checker.nullness.qual.NonNull kotlin.Any>*/): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/nullableVarargsOverrides.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/nullableVarargsOverrides.fir.kt new file mode 100644 index 00000000000..1edf4df72cd --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/nullableVarargsOverrides.fir.kt @@ -0,0 +1,21 @@ +// SOURCE_RETENTION_ANNOTATIONS +// FILE: BaseClass.java +import org.checkerframework.checker.nullness.qual.*; + +public class BaseClass { + public void loadCache(@Nullable Object... args) {} +} + +// FILE: main.kt +class A : BaseClass() { + override fun loadCache(vararg args: Any?) { + super.loadCache(*args) + } +} + +class B : BaseClass() { + // org.checkerframework.checker.nullness.qual.Nullable has @Target TYPE_USE, so it affects only elements type + override fun loadCache(vararg args: Any) { + super.loadCache(*args) + } +} diff --git a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/nullableVarargsOverrides.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/nullableVarargsOverrides.fir.txt similarity index 100% rename from compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/nullableVarargsOverrides.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/nullableVarargsOverrides.fir.txt diff --git a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/nullableVarargsOverrides.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/nullableVarargsOverrides.kt similarity index 99% rename from compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/nullableVarargsOverrides.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/nullableVarargsOverrides.kt index 6d9493a06ad..1edf4df72cd 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/nullableVarargsOverrides.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/nullableVarargsOverrides.kt @@ -7,7 +7,6 @@ public class BaseClass { } // FILE: main.kt - class A : BaseClass() { override fun loadCache(vararg args: Any?) { super.loadCache(*args) diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/nullableVarargsOverrides.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/nullableVarargsOverrides.txt new file mode 100644 index 00000000000..9b20edfe5cd --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/nullableVarargsOverrides.txt @@ -0,0 +1,26 @@ +package + +public final class A : BaseClass { + public constructor A() + 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*/ fun loadCache(/*0*/ vararg args: kotlin.Any? /*kotlin.Array*/): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class B : BaseClass { + public constructor B() + 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 loadCache(/*0*/ @org.checkerframework.checker.nullness.qual.Nullable vararg args: @org.checkerframework.checker.nullness.qual.Nullable kotlin.Any? /*kotlin.Array<(out) @org.checkerframework.checker.nullness.qual.Nullable kotlin.Any?>!*/): kotlin.Unit + public open fun loadCache(/*0*/ vararg args: kotlin.Any /*kotlin.Array*/): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public open class BaseClass { + public constructor BaseClass() + 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 fun loadCache(/*0*/ @org.checkerframework.checker.nullness.qual.Nullable vararg args: @org.checkerframework.checker.nullness.qual.Nullable kotlin.Any? /*kotlin.Array<(out) @org.checkerframework.checker.nullness.qual.Nullable kotlin.Any?>!*/): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeDifferentConstructor.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeDifferentConstructor.fir.kt new file mode 100644 index 00000000000..cba2ba66427 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeDifferentConstructor.fir.kt @@ -0,0 +1,37 @@ +// JAVAC_EXPECTED_FILE +// FILE: Outer.java +import org.checkerframework.checker.nullness.qual.*; + +interface Base {} +interface Derived extends Base {} + +class Outer { + class A { + @Nullable Base<@NonNull String> foo() { return null; } + } + + class B extends A { + @Override + Base foo() { return null; } + } + + class C extends A { + @Override + @NonNull Base foo() { return null; } + } + + class D extends A { + @Override + Derived foo() { return null; } + } + + class E extends A { + @Override + @NonNull Derived foo() { return null; } + } + + class F extends A { + @Override + @NonNull Derived<@NonNull String> foo() { return null; } + } +} diff --git a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/returnTypeDifferentConstructor.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeDifferentConstructor.fir.txt similarity index 100% rename from compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/returnTypeDifferentConstructor.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeDifferentConstructor.fir.txt diff --git a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/returnTypeDifferentConstructor.javac.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeDifferentConstructor.javac.txt similarity index 100% rename from compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/returnTypeDifferentConstructor.javac.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeDifferentConstructor.javac.txt diff --git a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/returnTypeDifferentConstructor.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeDifferentConstructor.kt similarity index 99% rename from compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/returnTypeDifferentConstructor.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeDifferentConstructor.kt index 0ba8da1dd1e..cba2ba66427 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/returnTypeDifferentConstructor.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeDifferentConstructor.kt @@ -1,6 +1,5 @@ // JAVAC_EXPECTED_FILE // FILE: Outer.java - import org.checkerframework.checker.nullness.qual.*; interface Base {} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeDifferentConstructor.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeDifferentConstructor.txt new file mode 100644 index 00000000000..fcd3a73fa92 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeDifferentConstructor.txt @@ -0,0 +1,56 @@ +package + +public/*package*/ open class Outer { + public/*package*/ constructor Outer() + 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/*package*/ open inner class A { + public/*package*/ constructor A() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + @org.checkerframework.checker.nullness.qual.Nullable public/*package*/ open fun foo(): @org.checkerframework.checker.nullness.qual.Nullable Base<@org.checkerframework.checker.nullness.qual.NonNull kotlin.String>? + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + + public/*package*/ open inner class B : Outer.A { + public/*package*/ constructor B() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + @java.lang.Override public/*package*/ open override /*1*/ fun foo(): Base? + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + + public/*package*/ open inner class C : Outer.A { + public/*package*/ constructor C() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + @java.lang.Override @org.checkerframework.checker.nullness.qual.NonNull public/*package*/ open override /*1*/ fun foo(): @org.checkerframework.checker.nullness.qual.NonNull Base + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + + public/*package*/ open inner class D : Outer.A { + public/*package*/ constructor D() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + @java.lang.Override public/*package*/ open override /*1*/ fun foo(): Derived? + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + + public/*package*/ open inner class E : Outer.A { + public/*package*/ constructor E() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + @java.lang.Override @org.checkerframework.checker.nullness.qual.NonNull public/*package*/ open override /*1*/ fun foo(): @org.checkerframework.checker.nullness.qual.NonNull Derived + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + + public/*package*/ open inner class F : Outer.A { + public/*package*/ constructor F() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + @java.lang.Override @org.checkerframework.checker.nullness.qual.NonNull public/*package*/ open override /*1*/ fun foo(): @org.checkerframework.checker.nullness.qual.NonNull Derived<@org.checkerframework.checker.nullness.qual.NonNull kotlin.String!> + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } +} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeOverrideInKotlin.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeOverrideInKotlin.fir.kt new file mode 100644 index 00000000000..7c0c378dcc3 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeOverrideInKotlin.fir.kt @@ -0,0 +1,31 @@ +// SOURCE_RETENTION_ANNOTATIONS +// FILE: Base.java +public interface Base {} +// FILE: A.java +import org.checkerframework.checker.nullness.qual.*; + +public class A { + @Nullable Base<@NonNull String> foo() { return null; } +} + +// FILE: a.kt +interface Derived : Base {} + +fun bar1(): Derived = null!! +fun bar2(): Derived = null!! + +class B : A() { + override fun foo(): Base { return bar1(); } +} + +class C1 : A() { + override fun foo(): Derived { return bar1(); } +} + +class C2 : A() { + override fun foo(): Derived? { return bar1(); } +} + +class C3 : A() { + override fun foo(): Derived { return bar2(); } +} diff --git a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/returnTypeOverrideInKotlin.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeOverrideInKotlin.fir.txt similarity index 100% rename from compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/returnTypeOverrideInKotlin.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeOverrideInKotlin.fir.txt diff --git a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/returnTypeOverrideInKotlin.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeOverrideInKotlin.kt similarity index 99% rename from compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/returnTypeOverrideInKotlin.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeOverrideInKotlin.kt index 1779f2ff832..7c0c378dcc3 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/returnTypeOverrideInKotlin.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeOverrideInKotlin.kt @@ -2,7 +2,6 @@ // FILE: Base.java public interface Base {} // FILE: A.java - import org.checkerframework.checker.nullness.qual.*; public class A { @@ -10,7 +9,6 @@ public class A { } // FILE: a.kt - interface Derived : Base {} fun bar1(): Derived = null!! diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeOverrideInKotlin.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeOverrideInKotlin.txt new file mode 100644 index 00000000000..bedd264fb31 --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeOverrideInKotlin.txt @@ -0,0 +1,56 @@ +package + +public fun bar1(): Derived +public fun bar2(): Derived + +public open class A { + public constructor A() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + @org.checkerframework.checker.nullness.qual.Nullable public/*package*/ open fun foo(): @org.checkerframework.checker.nullness.qual.Nullable Base<@org.checkerframework.checker.nullness.qual.NonNull kotlin.String>? + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class B : A { + public constructor B() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + protected open override /*1*/ fun foo(): Base + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public interface Base { + 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 final class C1 : A { + public constructor C1() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + protected open override /*1*/ fun foo(): Derived + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class C2 : A { + public constructor C2() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + protected open override /*1*/ fun foo(): Derived? + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class C3 : A { + public constructor C3() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + protected open override /*1*/ fun foo(): Derived + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public interface Derived : Base { + 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 +} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/simple.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/simple.fir.kt new file mode 100644 index 00000000000..31002a7bded --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/simple.fir.kt @@ -0,0 +1,7 @@ +// FILE: A.java +import org.checkerframework.checker.nullness.qual.*; +import java.util.*; + +class A { + List<@NonNull String> foo() { return null; } +} diff --git a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/simple.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/simple.fir.txt similarity index 100% rename from compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/simple.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/simple.fir.txt diff --git a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/simple.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/simple.kt similarity index 99% rename from compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/simple.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/simple.kt index 4b52e7f51b2..31002a7bded 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/simple.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/simple.kt @@ -1,5 +1,4 @@ // FILE: A.java - import org.checkerframework.checker.nullness.qual.*; import java.util.*; diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/simple.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/simple.txt new file mode 100644 index 00000000000..f9e9dcf1c1b --- /dev/null +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/simple.txt @@ -0,0 +1,9 @@ +package + +public/*package*/ open class A { + public/*package*/ constructor A() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public/*package*/ open fun foo(): kotlin.collections.(Mutable)List<@org.checkerframework.checker.nullness.qual.NonNull kotlin.String>! + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/foreignAnnotations/java8Tests/typeUseOnObject.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeUseOnObject.kt similarity index 99% rename from compiler/testData/foreignAnnotations/java8Tests/typeUseOnObject.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeUseOnObject.kt index 5c924aa92a9..4f28e4b9751 100644 --- a/compiler/testData/foreignAnnotations/java8Tests/typeUseOnObject.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeUseOnObject.kt @@ -10,7 +10,6 @@ public class B { } // FILE: main.kt - fun main() { A() B.assertNonNull(null) diff --git a/compiler/testData/foreignAnnotations/java8Tests/typeUseOnObject.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeUseOnObject.txt similarity index 100% rename from compiler/testData/foreignAnnotations/java8Tests/typeUseOnObject.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeUseOnObject.txt diff --git a/compiler/testData/foreignAnnotations/tests/androidRecently.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/androidRecently.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/androidRecently.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/androidRecently.kt index 87db9d10e37..14ecb6de0ef 100644 --- a/compiler/testData/foreignAnnotations/tests/androidRecently.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/androidRecently.kt @@ -1,6 +1,6 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -// FILE: A.java +// FILE: A.java import androidx.annotation.*; public class A { @@ -24,7 +24,6 @@ public class A { } // FILE: main.kt - fun main(a: A, a1: A) { a.foo("", null)?.length a.foo("", null).length diff --git a/compiler/testData/foreignAnnotations/tests/androidRecently.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/androidRecently.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/androidRecently.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/androidRecently.txt diff --git a/compiler/testData/foreignAnnotations/tests/androidSdk.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/androidSdk.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/androidSdk.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/androidSdk.kt index 1e6fe093ed7..8189d2a84fe 100644 --- a/compiler/testData/foreignAnnotations/tests/androidSdk.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/androidSdk.kt @@ -1,6 +1,6 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -// FILE: A.java +// FILE: A.java import android.annotation.*; public class A { @@ -21,7 +21,6 @@ public class A { } // FILE: main.kt - fun main(a: A, a1: A) { a.foo("", null)?.length a.foo("", null).length diff --git a/compiler/testData/foreignAnnotations/tests/androidSdk.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/androidSdk.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/androidSdk.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/androidSdk.txt diff --git a/compiler/testData/foreignAnnotations/tests/android_support.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/android_support.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/android_support.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/android_support.kt index a68833667d6..dd861ee242a 100644 --- a/compiler/testData/foreignAnnotations/tests/android_support.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/android_support.kt @@ -1,6 +1,6 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -// FILE: A.java +// FILE: A.java import android.support.annotation.*; public class A { @@ -21,7 +21,6 @@ public class A { } // FILE: main.kt - fun main(a: A, a1: A) { a.foo("", null)?.length a.foo("", null).length diff --git a/compiler/testData/foreignAnnotations/tests/android_support.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/android_support.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/android_support.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/android_support.txt diff --git a/compiler/testData/foreignAnnotations/tests/androidx.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/androidx.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/androidx.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/androidx.kt index 190f221bb4b..5d41f35846e 100644 --- a/compiler/testData/foreignAnnotations/tests/androidx.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/androidx.kt @@ -1,6 +1,6 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -// FILE: A.java +// FILE: A.java import androidx.annotation.*; public class A { @@ -21,7 +21,6 @@ public class A { } // FILE: main.kt - fun main(a: A, a1: A) { a.foo("", null)?.length a.foo("", null).length diff --git a/compiler/testData/foreignAnnotations/tests/androidx.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/androidx.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/androidx.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/androidx.txt diff --git a/compiler/testData/foreignAnnotations/tests/aosp.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/aosp.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/aosp.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/aosp.kt index b4dd6a2731a..2d91a7b10e5 100644 --- a/compiler/testData/foreignAnnotations/tests/aosp.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/aosp.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER // SOURCE_RETENTION_ANNOTATIONS -// FILE: A.java +// FILE: A.java import com.android.annotations.*; public class A { @@ -22,7 +22,6 @@ public class A { } // FILE: main.kt - fun main(a: A, a1: A) { a.foo("", null)?.length a.foo("", null).length diff --git a/compiler/testData/foreignAnnotations/tests/aosp.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/aosp.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/aosp.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/aosp.txt diff --git a/compiler/testData/foreignAnnotations/tests/checkerFramework.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/checkerFramework.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/checkerFramework.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/checkerFramework.kt index 6649ad634c6..2b70cb1710e 100644 --- a/compiler/testData/foreignAnnotations/tests/checkerFramework.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/checkerFramework.kt @@ -1,6 +1,6 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -// FILE: A.java +// FILE: A.java import org.checkerframework.checker.nullness.compatqual.*; public class A { @@ -19,7 +19,6 @@ public class A { } // FILE: main.kt - fun main(a: A) { a.foo("", null)?.length a.foo("", null).length diff --git a/compiler/testData/foreignAnnotations/tests/checkerFramework.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/checkerFramework.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/checkerFramework.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/checkerFramework.txt diff --git a/compiler/testData/foreignAnnotations/tests/eclipse.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/eclipse.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/eclipse.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/eclipse.kt index 86c6c7bae33..2a6541730d6 100644 --- a/compiler/testData/foreignAnnotations/tests/eclipse.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/eclipse.kt @@ -1,6 +1,6 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -// FILE: A.java +// FILE: A.java import org.eclipse.jdt.annotation.*; public class A { @@ -21,7 +21,6 @@ public class A { } // FILE: main.kt - fun main(a: A, a1: A) { a.foo("", null)?.length a.foo("", null).length diff --git a/compiler/testData/foreignAnnotations/tests/eclipse.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/eclipse.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/eclipse.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/eclipse.txt diff --git a/compiler/testData/foreignAnnotations/tests/findBugsSimple.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/findBugsSimple.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/findBugsSimple.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/findBugsSimple.kt index 9728a0a5068..b3a90e96cd9 100644 --- a/compiler/testData/foreignAnnotations/tests/findBugsSimple.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/findBugsSimple.kt @@ -1,6 +1,6 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -// FILE: A.java +// FILE: A.java import edu.umd.cs.findbugs.annotations.*; public class A { @@ -18,7 +18,6 @@ public class A { } // FILE: main.kt - fun main(a: A) { a.foo("", null)?.length a.foo("", null).length diff --git a/compiler/testData/foreignAnnotations/tests/findBugsSimple.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/findBugsSimple.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/findBugsSimple.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/findBugsSimple.txt diff --git a/compiler/testData/foreignAnnotations/tests/irrelevantQualifierNicknames.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/irrelevantQualifierNicknames.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/irrelevantQualifierNicknames.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/irrelevantQualifierNicknames.kt index dd7406c28c8..0279fb66222 100644 --- a/compiler/testData/foreignAnnotations/tests/irrelevantQualifierNicknames.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/irrelevantQualifierNicknames.kt @@ -66,7 +66,6 @@ public @interface UnknownQualifierNicknameDefault { } // FILE: A.java - import javax.annotation.*; @UnknownQualifierDefault @@ -79,7 +78,6 @@ public class A { } // FILE: main.kt - fun main() { A.B.foo(null).hashCode() } diff --git a/compiler/testData/foreignAnnotations/tests/irrelevantQualifierNicknames.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/irrelevantQualifierNicknames.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/irrelevantQualifierNicknames.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/irrelevantQualifierNicknames.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/ignore/parametersAreNonnullByDefault.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/ignore/parametersAreNonnullByDefault.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/ignore/parametersAreNonnullByDefault.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/ignore/parametersAreNonnullByDefault.kt index 699d56e42b0..41ffb44a453 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/ignore/parametersAreNonnullByDefault.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/ignore/parametersAreNonnullByDefault.kt @@ -2,7 +2,6 @@ // JSR305_GLOBAL_REPORT: ignore // FILE: A.java - import javax.annotation.*; @ParametersAreNonnullByDefault @@ -20,7 +19,6 @@ public class A { } // FILE: main.kt - fun main(a: A) { // foo is platform a.foo("", "", null)?.length diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/ignore/parametersAreNonnullByDefault.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/ignore/parametersAreNonnullByDefault.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/ignore/parametersAreNonnullByDefault.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/ignore/parametersAreNonnullByDefault.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nonNullNever.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nonNullNever.kt similarity index 96% rename from compiler/testData/foreignAnnotations/tests/jsr305/nonNullNever.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nonNullNever.kt index a9b585a3f0e..845f4ff5300 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nonNullNever.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nonNullNever.kt @@ -1,4 +1,6 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER +// JSR305_GLOBAL_REPORT: strict + // FILE: MyNullable.java import javax.annotation.*; import java.lang.annotation.Documented; @@ -17,7 +19,6 @@ public @interface MyNullable { } // FILE: A.java - import javax.annotation.*; import javax.annotation.meta.When; @@ -30,7 +31,6 @@ public class A { } } // FILE: main.kt - fun main(a: A) { a.foo("", null)?.length a.foo("", null).length diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nonNullNever.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nonNullNever.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nonNullNever.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nonNullNever.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityNicknames.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityNicknames.kt similarity index 98% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityNicknames.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityNicknames.kt index a91e5bb322f..03750f1ebc3 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityNicknames.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityNicknames.kt @@ -1,4 +1,6 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER +// JSR305_GLOBAL_REPORT: strict + // FILE: MyNullable.java import javax.annotation.*; import java.lang.annotation.Documented; @@ -51,7 +53,6 @@ public @interface MyNonnull { } // FILE: A.java - import javax.annotation.*; public class A { @@ -74,7 +75,6 @@ public class A { } // FILE: main.kt - fun main(a: A) { a.foo("", null)?.length a.foo("", null).length diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityNicknames.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityNicknames.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityNicknames.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityNicknames.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/elvis.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/elvis.kt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/elvis.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/elvis.kt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/elvis.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/elvis.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/elvis.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/elvis.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/arithmetic.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/arithmetic.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/arithmetic.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/arithmetic.kt index 553a9ed4f19..f9a999be37f 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/arithmetic.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/arithmetic.kt @@ -1,7 +1,6 @@ // JSR305_GLOBAL_REPORT: warn // FILE: J.java - public class J { @MyNonnull public static Integer staticNN; @@ -11,7 +10,6 @@ public class J { } // FILE: k.kt - fun test() { var platformNN = J.staticNN var platformN = J.staticN diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/arithmetic.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/arithmetic.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/arithmetic.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/arithmetic.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/array.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/array.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/array.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/array.kt index 250f5d751d0..916c22e9a71 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/array.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/array.kt @@ -1,7 +1,6 @@ // JSR305_GLOBAL_REPORT: warn // FILE: J.java - public class J { @MyNonnull public static Integer[] staticNN; @@ -11,7 +10,6 @@ public class J { } // FILE: k.kt - fun test() { val platformNN = J.staticNN val platformN = J.staticN diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/array.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/array.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/array.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/array.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/assignToVar.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/assignToVar.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/assignToVar.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/assignToVar.kt index 7f242acc517..637c7d11b02 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/assignToVar.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/assignToVar.kt @@ -1,7 +1,6 @@ // JSR305_GLOBAL_REPORT: warn // FILE: J.java - public class J { @MyNonnull public static J staticNN; @@ -11,7 +10,6 @@ public class J { } // FILE: k.kt - var v: J = J() var n: J? = J() diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/assignToVar.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/assignToVar.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/assignToVar.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/assignToVar.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/conditions.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/conditions.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/conditions.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/conditions.kt index 1fa019d5b35..ac57dcbb578 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/conditions.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/conditions.kt @@ -2,7 +2,6 @@ // JSR305_GLOBAL_REPORT: warn // FILE: J.java - public class J { @MyNonnull public static Boolean staticNN; @@ -12,7 +11,6 @@ public class J { } // FILE: k.kt - fun test() { val platformNN = J.staticNN val platformN = J.staticN diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/conditions.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/conditions.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/conditions.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/conditions.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/dataFlowInfo.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/dataFlowInfo.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/dataFlowInfo.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/dataFlowInfo.kt index ee206e827cf..e0c7fb49245 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/dataFlowInfo.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/dataFlowInfo.kt @@ -2,7 +2,6 @@ // JSR305_GLOBAL_REPORT: warn // FILE: J.java - public class J { @MyNonnull public static J staticNN; @@ -11,7 +10,6 @@ public class J { } // FILE: k.kt - fun test() { val n = J.staticN foo(n) diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/dataFlowInfo.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/dataFlowInfo.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/dataFlowInfo.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/dataFlowInfo.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/defaultParameters.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/defaultParameters.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/defaultParameters.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/defaultParameters.kt index 9e7593d52a1..b2a5ad9e675 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/defaultParameters.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/defaultParameters.kt @@ -2,7 +2,6 @@ // JSR305_GLOBAL_REPORT: warn // FILE: J.java - public class J { @MyNonnull public static J staticNN; @@ -12,7 +11,6 @@ public class J { } // FILE: k.kt - fun test() { val platformNN = J.staticNN val platformN = J.staticN diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/defaultParameters.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/defaultParameters.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/defaultParameters.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/defaultParameters.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegatedProperties.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegatedProperties.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegatedProperties.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegatedProperties.kt index a2dff017faf..9c9b22490a6 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegatedProperties.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegatedProperties.kt @@ -1,7 +1,6 @@ // JSR305_GLOBAL_REPORT: warn // FILE: J.java - public class J { public interface DP { @@ -17,7 +16,6 @@ public class J { } // FILE: k.kt - var A by J.staticNN var B by J.staticN var C by J.staticJ diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegatedProperties.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegatedProperties.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegatedProperties.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegatedProperties.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegation.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegation.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegation.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegation.kt index 01103a43cc4..832e76f18b1 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegation.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegation.kt @@ -1,7 +1,6 @@ // JSR305_GLOBAL_REPORT: warn // FULL_JDK // FILE: J.java - import java.util.*; public class J { @@ -13,7 +12,6 @@ public class J { } // FILE: k.kt - class A : List by J.staticNN class B : List by J.staticN class C : List by J.staticJ diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegation.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegation.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegation.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegation.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceExtension.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceExtension.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceExtension.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceExtension.kt index bfb6cfd93db..7b91f3df218 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceExtension.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceExtension.kt @@ -2,7 +2,6 @@ // JSR305_GLOBAL_REPORT: warn // FILE: J.java - public class J { @MyNonnull public static J staticNN; @@ -12,7 +11,6 @@ public class J { } // FILE: k.kt - fun test() { val platformNN = J.staticNN val platformN = J.staticN diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceExtension.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceExtension.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceExtension.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceExtension.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceMember.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceMember.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceMember.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceMember.kt index 207a8578d78..b71348bb98f 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceMember.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceMember.kt @@ -2,7 +2,6 @@ // JSR305_GLOBAL_REPORT: warn // FILE: J.java - public class J { @MyNonnull public static J staticNN; @@ -14,7 +13,6 @@ public class J { } // FILE: k.kt - fun test() { // @NotNull platform type val platformNN = J.staticNN diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceMember.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceMember.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceMember.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceMember.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/expectedType.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/expectedType.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/expectedType.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/expectedType.kt index deb8609a588..9d83d843259 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/expectedType.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/expectedType.kt @@ -2,7 +2,6 @@ // JSR305_GLOBAL_REPORT: warn // FILE: J.java - public class J { @MyNonnull public static J staticNN; @@ -12,7 +11,6 @@ public class J { } // FILE: k.kt - fun test() { val platformNN = J.staticNN val platformN = J.staticN diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/expectedType.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/expectedType.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/expectedType.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/expectedType.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/for.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/for.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/for.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/for.kt index 5d5cf0bc3d0..f214375d99e 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/for.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/for.kt @@ -1,7 +1,6 @@ // JSR305_GLOBAL_REPORT: warn // FILE: J.java - import java.util.*; public class J { @@ -13,7 +12,6 @@ public class J { } // FILE: k.kt - fun test() { val platformNN = J.staticNN val platformN = J.staticN diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/for.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/for.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/for.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/for.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/functionArguments.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/functionArguments.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/functionArguments.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/functionArguments.kt index 766ddce2c58..a069f2308a3 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/functionArguments.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/functionArguments.kt @@ -2,7 +2,6 @@ // JSR305_GLOBAL_REPORT: warn // FILE: J.java - public class J { @MyNonnull public static J staticNN; @@ -12,7 +11,6 @@ public class J { } // FILE: k.kt - fun test() { foo(J.staticNN) foo(J.staticN) diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/functionArguments.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/functionArguments.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/functionArguments.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/functionArguments.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/invoke.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/invoke.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/invoke.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/invoke.kt index 56f66ef3048..fae92d9ccc8 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/invoke.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/invoke.kt @@ -1,7 +1,6 @@ // JSR305_GLOBAL_REPORT: warn // FILE: J.java - public class J { public interface Invoke { void invoke(); @@ -15,7 +14,6 @@ public class J { } // FILE: k.kt - fun test() { J.staticNN() J.staticN() diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/invoke.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/invoke.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/invoke.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/invoke.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/kt6829.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/kt6829.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/kt6829.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/kt6829.kt index 6c4cd9997c8..c43870db728 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/kt6829.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/kt6829.kt @@ -4,7 +4,6 @@ // KT-6829 False warning on map to @Nullable // FILE: J.java - public class J { @MyNullable @@ -12,7 +11,6 @@ public class J { } // FILE: k.kt - fun foo(collection: Collection) { val mapped = collection.map { it.method() } mapped[0].length diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/kt6829.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/kt6829.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/kt6829.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/kt6829.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/multiDeclaration.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/multiDeclaration.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/multiDeclaration.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/multiDeclaration.kt index db8b11f6fc6..7a61452d09b 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/multiDeclaration.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/multiDeclaration.kt @@ -2,7 +2,6 @@ // JSR305_GLOBAL_REPORT: warn // FILE: J.java - public class J { public interface Multi { String component1(); @@ -17,7 +16,6 @@ public class J { } // FILE: k.kt - fun test() { val platformNN = J.staticNN val platformN = J.staticN diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/multiDeclaration.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/multiDeclaration.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/multiDeclaration.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/multiDeclaration.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/passToJava.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/passToJava.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/passToJava.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/passToJava.kt index 0942cef64a1..8701e20d510 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/passToJava.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/passToJava.kt @@ -2,7 +2,6 @@ // FILE: J.java - public class J { @MyNonnull public static J staticNN; @@ -25,7 +24,6 @@ public class J { } // FILE: k.kt - fun test(n: J?, nn: J) { // @NotNull platform type val platformNN = J.staticNN diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/passToJava.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/passToJava.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/passToJava.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/passToJava.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/primitiveArray.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/primitiveArray.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/primitiveArray.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/primitiveArray.kt index 4d7e339f976..d54a562fb51 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/primitiveArray.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/primitiveArray.kt @@ -1,7 +1,6 @@ // JSR305_GLOBAL_REPORT: warn // FILE: J.java - public class J { @MyNonnull public static int[] staticNN; @@ -11,7 +10,6 @@ public class J { } // FILE: k.kt - fun test() { val platformNN = J.staticNN val platformN = J.staticN diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/primitiveArray.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/primitiveArray.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/primitiveArray.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/primitiveArray.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/throw.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/throw.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/throw.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/throw.kt index d1f329b07ec..d67bd4792d3 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/throw.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/throw.kt @@ -1,7 +1,6 @@ // JSR305_GLOBAL_REPORT: warn // FILE: J.java - public class J { @MyNonnull public static Exception staticNN; @@ -11,7 +10,6 @@ public class J { } // FILE: k.kt - fun test() { throw J.staticNN } diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/throw.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/throw.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/throw.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/throw.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/uselessElvisRightIsNull.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/uselessElvisRightIsNull.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/uselessElvisRightIsNull.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/uselessElvisRightIsNull.kt index ed18465e1d4..b5026357ea3 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/uselessElvisRightIsNull.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/uselessElvisRightIsNull.kt @@ -2,27 +2,23 @@ // JSR305_GLOBAL_REPORT: warn // 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) diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/uselessElvisRightIsNull.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/uselessElvisRightIsNull.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/uselessElvisRightIsNull.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/uselessElvisRightIsNull.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/localInference.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/localInference.kt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/localInference.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/localInference.kt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/localInference.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/localInference.txt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/localInference.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/localInference.txt index db00c64c2d7..3c9c8a88254 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/localInference.txt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/localInference.txt @@ -48,3 +48,4 @@ public open class PlainJava { public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } + diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/nullabilityGenerics.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/nullabilityGenerics.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/nullabilityGenerics.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/nullabilityGenerics.kt index e56fd38df52..99211f13d32 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/nullabilityGenerics.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/nullabilityGenerics.kt @@ -21,7 +21,6 @@ public class A { } // FILE: main.kt - class X(t: T?) { init { diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/nullabilityGenerics.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/nullabilityGenerics.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/nullabilityGenerics.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/nullabilityGenerics.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/nullabilityNicknames.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/nullabilityNicknames.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/nullabilityNicknames.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/nullabilityNicknames.kt index e0a88b0452c..f148f993611 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/nullabilityNicknames.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/nullabilityNicknames.kt @@ -53,7 +53,6 @@ public @interface MyNonnull { } // FILE: A.java - import javax.annotation.*; public class A { @@ -76,7 +75,6 @@ public class A { } // FILE: main.kt - fun main(a: A) { a.foo("", null)?.length a.foo("", null).length diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/nullabilityNicknames.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/nullabilityNicknames.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/nullabilityNicknames.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/nullabilityNicknames.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/safeCalls.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/safeCalls.kt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/safeCalls.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/safeCalls.kt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/safeCalls.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/safeCalls.txt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/safeCalls.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/safeCalls.txt index debefc5db28..48e5b67c252 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/safeCalls.txt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/safeCalls.txt @@ -41,3 +41,4 @@ public open class PlainJava { public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } + diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/simple.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/simple.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/simple.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/simple.kt index 59063f744a1..14d2cd8a792 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/simple.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/simple.kt @@ -2,7 +2,6 @@ // JSR305_GLOBAL_REPORT: warn // FILE: A.java - import javax.annotation.*; public class A { @@ -21,7 +20,6 @@ public class A { } // FILE: main.kt - fun main(a: A) { a.foo("", null)?.length a.foo("", null).length diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/simple.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/simple.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/simple.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/simple.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/strange.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/strange.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/strange.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/strange.kt index 5a2b75f10d6..43da34d3222 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/strange.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/strange.kt @@ -2,7 +2,6 @@ // JSR305_GLOBAL_REPORT: warn // FILE: A.java - import javax.annotation.*; import javax.annotation.meta.*; @@ -22,7 +21,6 @@ public class A { } // FILE: main.kt - fun main(a: A) { a.foo("", null)?.length a.foo("", null).length diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/strange.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/strange.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/strange.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/strange.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/equalsOnNonNull.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/equalsOnNonNull.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/equalsOnNonNull.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/equalsOnNonNull.kt index 7f16516d921..3200835dfb5 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/equalsOnNonNull.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/equalsOnNonNull.kt @@ -2,7 +2,6 @@ // JSR305_GLOBAL_REPORT: warn // FILE: spr/NonNullApi.java - package spr; import java.lang.annotation.Documented; @@ -22,7 +21,6 @@ public @interface NonNullApi { } // FILE: A.java - import spr.*; @NonNullApi @@ -33,7 +31,6 @@ public class A { } // FILE: main.kt - fun main(a: A) { if (a.getBar() == "1" && a.hashCode() != 0) return if (a.getBar() != "2" && a.hashCode() != 0) return diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/equalsOnNonNull.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/equalsOnNonNull.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/equalsOnNonNull.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/equalsOnNonNull.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/fieldsAreNullable.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/fieldsAreNullable.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/fieldsAreNullable.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/fieldsAreNullable.kt index fd4307af307..07d898d2dde 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/fieldsAreNullable.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/fieldsAreNullable.kt @@ -19,7 +19,6 @@ public @interface FieldsAreNullable { } // FILE: A.java - import javax.annotation.*; @FieldsAreNullable @@ -39,7 +38,6 @@ public class A { } // FILE: main.kt - fun main(a: A) { // foo is platform a.foo("", "", null)?.length diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/fieldsAreNullable.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/fieldsAreNullable.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/fieldsAreNullable.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/fieldsAreNullable.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/nullabilityFromOverridden.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/nullabilityFromOverridden.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/nullabilityFromOverridden.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/nullabilityFromOverridden.kt index bcc0288c1ed..d7197d6eb90 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/nullabilityFromOverridden.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/nullabilityFromOverridden.kt @@ -2,7 +2,6 @@ // JSR305_GLOBAL_REPORT: warn // FILE: NonNullApi.java - import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -20,7 +19,6 @@ public @interface NonNullApi { } // FILE: NullableApi.java - import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -38,7 +36,6 @@ public @interface NullableApi { } // FILE: A.java - import javax.annotation.CheckForNull; import javax.annotation.Nullable; import javax.annotation.Nonnull; @@ -59,7 +56,6 @@ public class A { } // FILE: AInt.java - import javax.annotation.CheckForNull; import javax.annotation.Nullable; import javax.annotation.Nonnull; @@ -81,7 +77,6 @@ public interface AInt { // FILE: B.java - import javax.annotation.CheckForNull; import javax.annotation.Nullable; import javax.annotation.Nonnull; @@ -105,7 +100,6 @@ public class B extends A implements AInt { } // FILE: C.java - import javax.annotation.CheckForNull; import javax.annotation.Nullable; import javax.annotation.Nonnull; @@ -131,7 +125,6 @@ public class C extends A implements AInt { } // FILE: main.kt - fun main(a: A, b: B, c: C) { a.foo1(null).length a.foo2(null).length diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/nullabilityFromOverridden.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/nullabilityFromOverridden.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/nullabilityFromOverridden.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/nullabilityFromOverridden.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/overridingDefaultQualifier.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/overridingDefaultQualifier.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/overridingDefaultQualifier.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/overridingDefaultQualifier.kt index 5d96db14821..8a7b4a14908 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/overridingDefaultQualifier.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/overridingDefaultQualifier.kt @@ -2,7 +2,6 @@ // JSR305_GLOBAL_REPORT: warn // FILE: NonNullApi.java - import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -19,7 +18,6 @@ public @interface NonNullApi { } // FILE: NullableApi.java - import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -53,7 +51,6 @@ public @interface FieldsAreNullable { } // FILE: A.java - import javax.annotation.CheckForNull; import javax.annotation.Nullable; import javax.annotation.Nonnull; @@ -128,7 +125,6 @@ public class A { } // FILE: main.kt - fun main(a: A, b: A.B, c: A.C) { a.foo("", null)?.length a.foo("", null).length diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/overridingDefaultQualifier.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/overridingDefaultQualifier.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/overridingDefaultQualifier.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/overridingDefaultQualifier.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefault.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefault.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefault.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefault.kt index 88c9350f771..00aa8b0446c 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefault.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefault.kt @@ -2,7 +2,6 @@ // JSR305_GLOBAL_REPORT: warn // FILE: A.java - import javax.annotation.*; @ParametersAreNonnullByDefault @@ -20,7 +19,6 @@ public class A { } // FILE: main.kt - fun main(a: A) { // foo is platform a.foo("", "", null)?.length diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefault.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefault.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefault.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefault.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefaultPackage.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefaultPackage.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefaultPackage.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefaultPackage.kt index 60a195b55e0..8441f0547aa 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefaultPackage.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefaultPackage.kt @@ -2,12 +2,10 @@ // JSR305_GLOBAL_REPORT: warn // FILE: test/package-info.java - @javax.annotation.ParametersAreNonnullByDefault() package test; // FILE: test/A.java - package test; import javax.annotation.*; @@ -26,7 +24,6 @@ public class A { } // FILE: test2/A2.java - package test2; import javax.annotation.*; @@ -45,7 +42,6 @@ public class A2 { } // FILE: main.kt - import test.A import test2.A2 diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefaultPackage.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefaultPackage.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefaultPackage.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefaultPackage.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullable.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullable.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullable.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullable.kt index be45feea974..d7571fa6dc7 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullable.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullable.kt @@ -2,7 +2,6 @@ // JSR305_GLOBAL_REPORT: warn // FILE: spr/Nullable.java - package spr; import java.lang.annotation.Documented; @@ -23,7 +22,6 @@ public @interface Nullable { } // FILE: spr/NonNullApi.java - package spr; import java.lang.annotation.Documented; @@ -43,7 +41,6 @@ public @interface NonNullApi { } // FILE: A.java - import spr.*; @NonNullApi @@ -65,7 +62,6 @@ public class A { } // FILE: main.kt - fun main(a: A) { a.foo("", null)?.length a.foo("", null).length diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullable.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullable.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullable.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullable.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullablePackage.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullablePackage.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullablePackage.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullablePackage.kt index c258023f619..3a3bb845234 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullablePackage.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullablePackage.kt @@ -2,7 +2,6 @@ // JSR305_GLOBAL_REPORT: warn // FILE: spr/Nullable.java - package spr; import java.lang.annotation.Documented; @@ -23,7 +22,6 @@ public @interface Nullable { } // FILE: spr/NonNullApi.java - package spr; import java.lang.annotation.Documented; @@ -43,12 +41,10 @@ public @interface NonNullApi { } // FILE: test/package-info.java - @spr.NonNullApi() package test; // FILE: test/A.java - package test; import spr.*; @@ -71,7 +67,6 @@ public class A { } // FILE: main.kt - fun main(a: test.A) { a.foo("", null)?.length a.foo("", null).length diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullablePackage.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullablePackage.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullablePackage.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullablePackage.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/simple.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/simple.kt similarity index 95% rename from compiler/testData/foreignAnnotations/tests/jsr305/simple.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/simple.kt index 0fecca7eed7..32ffb4af628 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/simple.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/simple.kt @@ -1,6 +1,7 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -// FILE: A.java +// JSR305_GLOBAL_REPORT: strict +// FILE: A.java import javax.annotation.*; public class A { @@ -19,7 +20,6 @@ public class A { } // FILE: main.kt - fun main(a: A) { a.foo("", null)?.length a.foo("", null).length diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/simple.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/simple.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/simple.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/simple.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/strange.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/strange.kt similarity index 95% rename from compiler/testData/foreignAnnotations/tests/jsr305/strange.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/strange.kt index 57654f9cb8c..064b59cda33 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/strange.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/strange.kt @@ -1,6 +1,7 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -// FILE: A.java +// JSR305_GLOBAL_REPORT: strict +// FILE: A.java import javax.annotation.*; import javax.annotation.meta.*; @@ -20,7 +21,6 @@ public class A { } // FILE: main.kt - fun main(a: A) { a.foo("", null)?.length a.foo("", null).length diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/strange.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/strange.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/strange.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/strange.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/fieldsAreNullable.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/fieldsAreNullable.kt similarity index 97% rename from compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/fieldsAreNullable.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/fieldsAreNullable.kt index bf2f75921a9..788d127f3ba 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/fieldsAreNullable.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/fieldsAreNullable.kt @@ -1,4 +1,5 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER +// JSR305_GLOBAL_REPORT: strict // FILE: FieldsAreNullable.java import java.lang.annotation.Documented; @@ -18,7 +19,6 @@ public @interface FieldsAreNullable { } // FILE: A.java - import javax.annotation.*; @FieldsAreNullable @@ -38,7 +38,6 @@ public class A { } // FILE: main.kt - fun main(a: A) { // foo is platform a.foo("", "", null)?.length diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/fieldsAreNullable.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/fieldsAreNullable.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/fieldsAreNullable.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/fieldsAreNullable.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/forceFlexibility.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/forceFlexibility.kt similarity index 98% rename from compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/forceFlexibility.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/forceFlexibility.kt index cc35f977206..5149c9d76a2 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/forceFlexibility.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/forceFlexibility.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER +// JSR305_GLOBAL_REPORT: strict // FILE: spr/Nullable.java - package spr; import java.lang.annotation.Documented; @@ -22,7 +22,6 @@ public @interface Nullable { } // FILE: spr/NonNullApi.java - package spr; import java.lang.annotation.Documented; @@ -61,7 +60,6 @@ public @interface UnknownNullability { } // FILE: spr/ForceFlexibility.java - package spr; import java.lang.annotation.Documented; @@ -81,7 +79,6 @@ public @interface ForceFlexibility { } // FILE: A.java - import spr.*; @NonNullApi @@ -98,7 +95,6 @@ public class A { } // FILE: main.kt - fun main(a: A) { a.foo("", null)?.length a.foo("", null).length diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/forceFlexibility.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/forceFlexibility.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/forceFlexibility.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/forceFlexibility.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/forceFlexibleOverOverrides.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/forceFlexibleOverOverrides.kt similarity index 98% rename from compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/forceFlexibleOverOverrides.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/forceFlexibleOverOverrides.kt index 903343ae2b0..4d388b41636 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/forceFlexibleOverOverrides.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/forceFlexibleOverOverrides.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER +// JSR305_GLOBAL_REPORT: strict // FILE: spr/NonNullApi.java - package spr; import java.lang.annotation.Documented; @@ -40,7 +40,6 @@ public @interface UnknownNullability { } // FILE: spr/ForceFlexibility.java - package spr; import java.lang.annotation.Documented; @@ -68,7 +67,6 @@ public interface B { } // FILE: A.java - import spr.*; @NonNullApi @@ -81,7 +79,6 @@ public class A implements B { } // FILE: main.kt - fun main(a: A, b: B) { b.foo(null) b.bar(null) diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/forceFlexibleOverOverrides.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/forceFlexibleOverOverrides.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/forceFlexibleOverOverrides.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/forceFlexibleOverOverrides.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/nullabilityFromOverridden.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/nullabilityFromOverridden.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/nullabilityFromOverridden.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/nullabilityFromOverridden.kt index 66fe7e5a9e0..ac14cc09ff7 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/nullabilityFromOverridden.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/nullabilityFromOverridden.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER +// JSR305_GLOBAL_REPORT: strict // FILE: NonNullApi.java - import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -19,7 +19,6 @@ public @interface NonNullApi { } // FILE: NullableApi.java - import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -37,7 +36,6 @@ public @interface NullableApi { } // FILE: A.java - import javax.annotation.CheckForNull; import javax.annotation.Nullable; import javax.annotation.Nonnull; @@ -58,7 +56,6 @@ public class A { } // FILE: AInt.java - import javax.annotation.CheckForNull; import javax.annotation.Nullable; import javax.annotation.Nonnull; @@ -80,7 +77,6 @@ public interface AInt { // FILE: B.java - import javax.annotation.CheckForNull; import javax.annotation.Nullable; import javax.annotation.Nonnull; @@ -104,7 +100,6 @@ public class B extends A implements AInt { } // FILE: C.java - import javax.annotation.CheckForNull; import javax.annotation.Nullable; import javax.annotation.Nonnull; @@ -130,7 +125,6 @@ public class C extends A implements AInt { } // FILE: main.kt - fun main(a: A, b: B, c: C) { a.foo1(null).length a.foo2(null).length diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/nullabilityFromOverridden.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/nullabilityFromOverridden.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/nullabilityFromOverridden.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/nullabilityFromOverridden.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/overridingDefaultQualifier.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/overridingDefaultQualifier.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/overridingDefaultQualifier.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/overridingDefaultQualifier.kt index b5d805b0721..092271c0f01 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/overridingDefaultQualifier.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/overridingDefaultQualifier.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER +// JSR305_GLOBAL_REPORT: strict // FILE: NonNullApi.java - import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -18,7 +18,6 @@ public @interface NonNullApi { } // FILE: NullableApi.java - import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -52,7 +51,6 @@ public @interface FieldsAreNullable { } // FILE: A.java - import javax.annotation.CheckForNull; import javax.annotation.Nullable; import javax.annotation.Nonnull; @@ -127,7 +125,6 @@ public class A { } // FILE: main.kt - fun main(a: A, b: A.B, c: A.C) { a.foo("", null)?.length a.foo("", null).length diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/overridingDefaultQualifier.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/overridingDefaultQualifier.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/overridingDefaultQualifier.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/overridingDefaultQualifier.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefault.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefault.kt similarity index 95% rename from compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefault.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefault.kt index b613006cb2f..7b2ae707bec 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefault.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefault.kt @@ -1,6 +1,7 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -// FILE: A.java +// JSR305_GLOBAL_REPORT: strict +// FILE: A.java import javax.annotation.*; @ParametersAreNonnullByDefault @@ -18,7 +19,6 @@ public class A { } // FILE: main.kt - fun main(a: A) { // foo is platform a.foo("", "", null)?.length diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefault.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefault.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefault.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefault.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefaultPackage.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefaultPackage.kt similarity index 97% rename from compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefaultPackage.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefaultPackage.kt index dca155d9b83..a1ec7f5e9c1 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefaultPackage.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefaultPackage.kt @@ -1,13 +1,13 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER +// JSR305_GLOBAL_REPORT: strict + // RENDER_PACKAGE: test, test2 // FILE: test/package-info.java - @javax.annotation.ParametersAreNonnullByDefault() package test; // FILE: test/A.java - package test; import javax.annotation.*; @@ -26,7 +26,6 @@ public class A { } // FILE: test2/A2.java - package test2; import javax.annotation.*; @@ -45,7 +44,6 @@ public class A2 { } // FILE: main.kt - import test.A import test2.A2 diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefaultPackage.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefaultPackage.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefaultPackage.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefaultPackage.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/springNullable.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/springNullable.kt similarity index 98% rename from compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/springNullable.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/springNullable.kt index ca7113626f5..1b732b442ac 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/springNullable.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/springNullable.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER +// JSR305_GLOBAL_REPORT: strict // FILE: spr/Nullable.java - package spr; import java.lang.annotation.Documented; @@ -22,7 +22,6 @@ public @interface Nullable { } // FILE: spr/NonNullApi.java - package spr; import java.lang.annotation.Documented; @@ -42,7 +41,6 @@ public @interface NonNullApi { } // FILE: A.java - import spr.*; @NonNullApi @@ -64,7 +62,6 @@ public class A { } // FILE: main.kt - fun main(a: A) { a.foo("", null)?.length a.foo("", null).length diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/springNullable.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/springNullable.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/springNullable.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/springNullable.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/springNullablePackage.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/springNullablePackage.kt similarity index 98% rename from compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/springNullablePackage.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/springNullablePackage.kt index a78be048348..196b97c8a17 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/springNullablePackage.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/springNullablePackage.kt @@ -1,8 +1,8 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER +// JSR305_GLOBAL_REPORT: strict // RENDER_PACKAGE: test // FILE: spr/Nullable.java - package spr; import java.lang.annotation.Documented; @@ -23,7 +23,6 @@ public @interface Nullable { } // FILE: spr/NonNullApi.java - package spr; import java.lang.annotation.Documented; @@ -43,12 +42,10 @@ public @interface NonNullApi { } // FILE: test/package-info.java - @spr.NonNullApi() package test; // FILE: test/A.java - package test; import spr.*; @@ -71,7 +68,6 @@ public class A { } // FILE: main.kt - fun main(a: test.A) { a.foo("", null)?.length a.foo("", null).length diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/springNullablePackage.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/springNullablePackage.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/springNullablePackage.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/springNullablePackage.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/customMigration.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/customMigration.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/customMigration.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/customMigration.kt index 872c955e69c..b7416335ba0 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/customMigration.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/customMigration.kt @@ -59,7 +59,6 @@ public @interface MyIgnoreNonnull { } // FILE: A.java - public class A { public void foo(@MyErrorNonnull String bar) {} public void foo2(@MyWarnNonnull String bar) {} @@ -68,7 +67,6 @@ public class A { } // FILE: main.kt - fun main(a: A) { a.foo("") a.foo(null) diff --git a/compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/customMigration.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/customMigration.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/customMigration.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/customMigration.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/globalIgnore.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/globalIgnore.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/globalIgnore.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/globalIgnore.kt index 32f86ddb6df..7a5bfc529aa 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/globalIgnore.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/globalIgnore.kt @@ -4,7 +4,6 @@ // JSR305_SPECIAL_REPORT: MyNonnull:warn // FILE: A.java - import javax.annotation.*; public class A { @@ -33,7 +32,6 @@ public class A { } // FILE: main.kt - fun main(a: A) { a.foo("", null)?.length a.foo("", null).length diff --git a/compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/globalIgnore.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/globalIgnore.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/globalIgnore.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/globalIgnore.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/globalWarningMigrationIgnore.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/globalWarningMigrationIgnore.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/globalWarningMigrationIgnore.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/globalWarningMigrationIgnore.kt index dd19df3595c..559dcb36e03 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/globalWarningMigrationIgnore.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/globalWarningMigrationIgnore.kt @@ -4,7 +4,6 @@ // JSR305_SPECIAL_REPORT: MyNullable:strict, MyMigrationNonnull:strict // FILE: A.java - import javax.annotation.*; public class A { @@ -33,7 +32,6 @@ public class A { } // FILE: main.kt - fun main(a: A) { a.foo("", null)?.length a.foo("", null).length diff --git a/compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/globalWarningMigrationIgnore.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/globalWarningMigrationIgnore.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/globalWarningMigrationIgnore.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/globalWarningMigrationIgnore.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/migrationError.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/migrationError.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/migrationError.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/migrationError.kt index d4ec6cc35ef..71f165528ec 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/migrationError.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/migrationError.kt @@ -20,7 +20,6 @@ public @interface MySuperNull { } // FILE: A.java - import javax.annotation.*; public class A { @@ -51,7 +50,6 @@ public class A { } // FILE: main.kt - fun main(a: A) { a.foo("", null)?.length a.foo("", null).length diff --git a/compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/migrationError.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/migrationError.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/migrationError.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/migrationError.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/migrationIgnore.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/migrationIgnore.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/migrationIgnore.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/migrationIgnore.kt index e545e32d7b2..ac7a9c5759e 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/migrationIgnore.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/migrationIgnore.kt @@ -4,7 +4,6 @@ // JSR305_SPECIAL_REPORT: MyNullable:warn, MyMigrationNonnull:strict // FILE: A.java - import javax.annotation.*; public class A { @@ -33,7 +32,6 @@ public class A { } // FILE: main.kt - fun main(a: A) { a.foo("", null)?.length a.foo("", null).length diff --git a/compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/migrationIgnore.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/migrationIgnore.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/migrationIgnore.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/migrationIgnore.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/migrationWarning.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/migrationWarning.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/migrationWarning.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/migrationWarning.kt index 3ff18b11f3e..7e05524275f 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/migrationWarning.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/migrationWarning.kt @@ -4,7 +4,6 @@ // JSR305_SPECIAL_REPORT: MyNullable:ignore, MyMigrationNullable:strict // FILE: A.java - import javax.annotation.*; public class A { @@ -33,7 +32,6 @@ public class A { } // FILE: main.kt - fun main(a: A) { a.foo("", null)?.length a.foo("", null).length diff --git a/compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/migrationWarning.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/migrationWarning.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/migrationWarning.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/migrationWarning.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/overrideConflicts.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/overrideConflicts.kt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/overrideConflicts.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/overrideConflicts.kt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/overrideConflicts.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/overrideConflicts.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/overrideConflicts.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/overrideConflicts.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/specialCollision.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/specialCollision.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/specialCollision.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/specialCollision.kt index f81586e0dfd..6d8aae90a20 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/specialCollision.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/specialCollision.kt @@ -4,7 +4,6 @@ // JSR305_SPECIAL_REPORT: MyNonnull:warn, MyMigrationNonnull:strict // FILE: A.java - import javax.annotation.*; public class A { @@ -23,7 +22,6 @@ public class A { } // FILE: main.kt - fun main(a: A) { a.foo("", null)?.length a.foo("", null).length diff --git a/compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/specialCollision.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/specialCollision.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/specialCollision.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/specialCollision.txt diff --git a/compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/stateRefinement.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/stateRefinement.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/stateRefinement.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/stateRefinement.kt index 8e9879de5a3..d0786d5ed62 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/stateRefinement.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/stateRefinement.kt @@ -4,7 +4,6 @@ // JSR305_SPECIAL_REPORT: MyNonnull:strict // FILE: A.java - import javax.annotation.*; public class A { @@ -33,7 +32,6 @@ public class A { } // FILE: main.kt - fun main(a: A) { a.foo("", null)?.length a.foo("", null).length diff --git a/compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/stateRefinement.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/stateRefinement.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/stateRefinement.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/stateRefinement.txt diff --git a/compiler/testData/foreignAnnotations/tests/lombokSimple.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/lombokSimple.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/lombokSimple.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/lombokSimple.kt index a9b68f86c45..d264d4cb1ff 100644 --- a/compiler/testData/foreignAnnotations/tests/lombokSimple.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/lombokSimple.kt @@ -1,6 +1,6 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -// FILE: A.java +// FILE: A.java import lombok.*; public class A { @@ -12,7 +12,6 @@ public class A { } // FILE: main.kt - fun main(a: A) { a.foo("").length a.foo("")?.length diff --git a/compiler/testData/foreignAnnotations/tests/lombokSimple.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/lombokSimple.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/lombokSimple.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/lombokSimple.txt diff --git a/compiler/testData/foreignAnnotations/tests/rxjava.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/rxjava.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/rxjava.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/rxjava.kt index 2661011370a..0e86c2a59e0 100644 --- a/compiler/testData/foreignAnnotations/tests/rxjava.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/rxjava.kt @@ -1,6 +1,6 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -// FILE: A.java +// FILE: A.java import io.reactivex.annotations.*; public class A { @@ -21,7 +21,6 @@ public class A { } // FILE: main.kt - fun main(a: A, a1: A) { a.foo("", null)?.length a.foo("", null).length diff --git a/compiler/testData/foreignAnnotations/tests/rxjava.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/rxjava.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/rxjava.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/rxjava.txt diff --git a/compiler/testData/foreignAnnotations/tests/typeQualifierDefault/defaultAndNicknameMigrationPolicy.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/typeQualifierDefault/defaultAndNicknameMigrationPolicy.kt similarity index 99% rename from compiler/testData/foreignAnnotations/tests/typeQualifierDefault/defaultAndNicknameMigrationPolicy.kt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/typeQualifierDefault/defaultAndNicknameMigrationPolicy.kt index 3f5d6a0fc90..8df6888aaf9 100644 --- a/compiler/testData/foreignAnnotations/tests/typeQualifierDefault/defaultAndNicknameMigrationPolicy.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/typeQualifierDefault/defaultAndNicknameMigrationPolicy.kt @@ -2,7 +2,6 @@ // JSR305_GLOBAL_REPORT: warn // FILE: NonNullApi.java - import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -18,7 +17,6 @@ public @interface NonNullApi { } // FILE: MigrationNonNullApi.java - import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -37,7 +35,6 @@ public @interface MigrationNonNullApi { } // FILE: PolicyFromDefault.java - @NonNullApi public class PolicyFromDefault { public String foo(String x) { @@ -48,7 +45,6 @@ public class PolicyFromDefault { } // FILE: PolicyFromNickname.java - @MigrationNonNullApi public class PolicyFromNickname { public String foo(String x) { @@ -59,7 +55,6 @@ public class PolicyFromNickname { } // FILE: main.kt - fun main(default: PolicyFromDefault, nickname: PolicyFromNickname) { default.foo(null).length default.foo("hello").length diff --git a/compiler/testData/foreignAnnotations/tests/typeQualifierDefault/defaultAndNicknameMigrationPolicy.txt b/compiler/testData/diagnostics/foreignAnnotationsTests/tests/typeQualifierDefault/defaultAndNicknameMigrationPolicy.txt similarity index 100% rename from compiler/testData/foreignAnnotations/tests/typeQualifierDefault/defaultAndNicknameMigrationPolicy.txt rename to compiler/testData/diagnostics/foreignAnnotationsTests/tests/typeQualifierDefault/defaultAndNicknameMigrationPolicy.txt diff --git a/compiler/testData/foreignAnnotations/testAnnotations/MyMigrationNonnull.java b/compiler/testData/diagnostics/helpers/jsr305_test_annotations/MyMigrationNonnull.java similarity index 100% rename from compiler/testData/foreignAnnotations/testAnnotations/MyMigrationNonnull.java rename to compiler/testData/diagnostics/helpers/jsr305_test_annotations/MyMigrationNonnull.java diff --git a/compiler/testData/foreignAnnotations/testAnnotations/MyMigrationNullable.java b/compiler/testData/diagnostics/helpers/jsr305_test_annotations/MyMigrationNullable.java similarity index 100% rename from compiler/testData/foreignAnnotations/testAnnotations/MyMigrationNullable.java rename to compiler/testData/diagnostics/helpers/jsr305_test_annotations/MyMigrationNullable.java diff --git a/compiler/testData/foreignAnnotations/testAnnotations/MyNonnull.java b/compiler/testData/diagnostics/helpers/jsr305_test_annotations/MyNonnull.java similarity index 100% rename from compiler/testData/foreignAnnotations/testAnnotations/MyNonnull.java rename to compiler/testData/diagnostics/helpers/jsr305_test_annotations/MyNonnull.java diff --git a/compiler/testData/foreignAnnotations/testAnnotations/MyNullable.java b/compiler/testData/diagnostics/helpers/jsr305_test_annotations/MyNullable.java similarity index 100% rename from compiler/testData/foreignAnnotations/testAnnotations/MyNullable.java rename to compiler/testData/diagnostics/helpers/jsr305_test_annotations/MyNullable.java diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/java/AnnotatedBoundsOfWildcard.java b/compiler/testData/foreignAnnotations/java8Tests/jspecify/java/AnnotatedBoundsOfWildcard.java deleted file mode 100644 index 39d2ee5399a..00000000000 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/java/AnnotatedBoundsOfWildcard.java +++ /dev/null @@ -1,81 +0,0 @@ -import org.jspecify.nullness.*; - -@NullMarked -public class AnnotatedBoundsOfWildcard { - public void superAsIs(Test a) {} - public void superNotNull(Test a) {} - public void superNullable(Test a) {} - - public void extendsAsIs(Test a) {} - public void extendsNotNull(Test a) {} - public void extendsNullable(Test a) {} - - public void noBounds(Test<@NullnessUnspecified ?, @NullnessUnspecified ?, @NullnessUnspecified ?> a) {} -} - -class Base {} -class Derived extends Base {} - -@NullMarked -class Test { } - -@NullMarked -class Use { - public void main( - Test aNotNullNotNullNotNull, - Test aNotNullNotNullNull, - Test aNotNullNullNotNull, - Test aNotNullNullNull, - - Test aObjectNotNullNotNullNotNull, - Test aObjectNotNullNotNullNull, - Test aObjectNotNullNullNotNull, - Test aObjectNotNullNullNull, - - AnnotatedBoundsOfWildcard b - ) { - // jspecify_nullness_mismatch - b.superAsIs(aObjectNotNullNotNullNotNull); - // jspecify_nullness_mismatch - b.superAsIs(aObjectNotNullNotNullNull); - b.superAsIs(aObjectNotNullNullNotNull); - b.superAsIs(aObjectNotNullNullNull); - - b.superNotNull(aObjectNotNullNotNullNotNull); - b.superNotNull(aObjectNotNullNotNullNull); - b.superNotNull(aObjectNotNullNullNotNull); - b.superNotNull(aObjectNotNullNullNull); - - // jspecify_nullness_mismatch - b.superNullable(aObjectNotNullNotNullNotNull); - // jspecify_nullness_mismatch - b.superNullable(aObjectNotNullNotNullNull); - // jspecify_nullness_mismatch - b.superNullable(aObjectNotNullNullNotNull); - // jspecify_nullness_mismatch - b.superNullable(aObjectNotNullNullNull); - - b.extendsAsIs(aNotNullNotNullNotNull); - b.extendsAsIs(aNotNullNotNullNull); - b.extendsAsIs(aNotNullNullNotNull); - b.extendsAsIs(aNotNullNullNull); - - b.extendsNotNull(aNotNullNotNullNotNull); - // jspecify_nullness_mismatch - b.extendsNotNull(aNotNullNotNullNull); - // jspecify_nullness_mismatch - b.extendsNotNull(aNotNullNullNotNull); - // jspecify_nullness_mismatch - b.extendsNotNull(aNotNullNullNull); - - b.extendsNullable(aNotNullNotNullNotNull); - b.extendsNullable(aNotNullNotNullNull); - b.extendsNullable(aNotNullNullNotNull); - b.extendsNullable(aNotNullNullNull); - - b.noBounds(aNotNullNotNullNotNull); - b.noBounds(aNotNullNotNullNull); - b.noBounds(aNotNullNullNotNull); - b.noBounds(aNotNullNullNull); - } -} diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/java/Defaults.java b/compiler/testData/foreignAnnotations/java8Tests/jspecify/java/Defaults.java deleted file mode 100644 index ba343a89d03..00000000000 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/java/Defaults.java +++ /dev/null @@ -1,44 +0,0 @@ -import org.jspecify.nullness.*; - -@NullMarked -public class Defaults { - public Foo defaultField = null; - @Nullable public Foo field = null; - - public Foo everythingNotNullable(Foo x) { return null; } - - public @Nullable Foo everythingNullable(@Nullable Foo x) { return null; } - - public @NullnessUnspecified Foo everythingUnknown(@NullnessUnspecified Foo x) { return null; } - - public @Nullable Foo mixed(Foo x) { return null; } - - public Foo explicitlyNullnessUnspecified(@NullnessUnspecified Foo x) { return null; } -} - -class Foo { - public Object foo() { return null; } -} - -class Use { - static void main(Defaults a, Foo x) { - // jspecify_nullness_mismatch - a.everythingNotNullable(null).foo(); - a.everythingNotNullable(x).foo(); - - a.everythingNullable(null).foo(); - - a.everythingUnknown(null).foo(); - - // jspecify_nullness_mismatch - a.mixed(null).foo(); - a.mixed(x).foo(); - - a.explicitlyNullnessUnspecified(x).foo(); - a.explicitlyNullnessUnspecified(null).foo(); - - a.defaultField.foo(); - - a.field.foo(); - } -} diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/java/IgnoreAnnotations.java b/compiler/testData/foreignAnnotations/java8Tests/jspecify/java/IgnoreAnnotations.java deleted file mode 100644 index f200469b341..00000000000 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/java/IgnoreAnnotations.java +++ /dev/null @@ -1,41 +0,0 @@ -import org.jspecify.nullness.*; - -@NullMarked -public class IgnoreAnnotations { - @Nullable public Derived field = null; - - @Nullable - public Derived foo(Derived x, @NullnessUnspecified Base y) { - return null; - } - - public Derived everythingNotNullable(Derived x) { return null; } - - public @Nullable Derived everythingNullable(@Nullable Derived x) { return null; } - - public @NullnessUnspecified Derived everythingUnknown(@NullnessUnspecified Derived x) { return null; } -} - -class Base { - void foo() {} -} - -class Derived extends Base { } - -class Use { - static void main(IgnoreAnnotations a, Derived x) { - a.foo(x, null).foo(); - // jspecify_nullness_mismatch - a.foo(null, x).foo(); - - a.field.foo(); - - // jspecify_nullness_mismatch - a.everythingNotNullable(null).foo(); - a.everythingNotNullable(x).foo(); - - a.everythingNullable(null).foo(); - - a.everythingUnknown(null).foo(); - } -} diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/java/NonPlatformTypeParameter.java b/compiler/testData/foreignAnnotations/java8Tests/jspecify/java/NonPlatformTypeParameter.java deleted file mode 100644 index bb4ea838bd4..00000000000 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/java/NonPlatformTypeParameter.java +++ /dev/null @@ -1,26 +0,0 @@ -import org.jspecify.nullness.*; - -public class NonPlatformTypeParameter { - public void foo(T t) {} - public void bar(E e) {} -} - -class Test {} - -@NullMarked -class Use { - public void main(NonPlatformTypeParameter<@Nullable Object> a1, NonPlatformTypeParameter a2, T x) { - a1.foo(null); - a1.<@Nullable Test>bar(null); - // jspecify_nullness_mismatch - a1.bar(null); - a1.bar(x); - - // jspecify_nullness_mismatch - a2.foo(null); - a2.<@Nullable Test>bar(null); - // jspecify_nullness_mismatch - a2.bar(null); - a2.bar(x); - } -} diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/java/NullnessUnspecifiedTypeParameter.java b/compiler/testData/foreignAnnotations/java8Tests/jspecify/java/NullnessUnspecifiedTypeParameter.java deleted file mode 100644 index 7725650cb9d..00000000000 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/java/NullnessUnspecifiedTypeParameter.java +++ /dev/null @@ -1,30 +0,0 @@ -import org.jspecify.nullness.*; - -@NullMarked -public class NullnessUnspecifiedTypeParameter { - public void foo(T t) {} - - public void bar(Test s, T t) {} // t should not become not nullable -} - -class Test {} - -class Use { - void main(NullnessUnspecifiedTypeParameter a1, NullnessUnspecifiedTypeParameter<@Nullable Object> a2, Test x) { - a1.foo(null); - a1.foo(1); - - a2.foo(null); - a2.foo(1); - - // jspecify_nullness_mismatch - a1.bar(null, null); - a1.bar(x, null); - a1.bar(x, 1); - - // jspecify_nullness_mismatch - a2.bar(null, null); - a2.bar(x, null); - a2.bar(x, 1); - } -} \ No newline at end of file diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/java/SelfType.java b/compiler/testData/foreignAnnotations/java8Tests/jspecify/java/SelfType.java deleted file mode 100644 index f81d4340cec..00000000000 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/java/SelfType.java +++ /dev/null @@ -1,40 +0,0 @@ -import org.jspecify.nullness.*; - -@DefaultNotNull -public class SelfType> { - public void foo(T t) {} -} - -class B extends SelfType {} - -@DefaultNotNull -class C> extends SelfType {} - -class AK extends SelfType {} -class AKN extends SelfType<@Nullable AK> {} - -class BK extends B {} - -class CK extends C {} - -class CKN extends C<@Nullable CK> { - public void main(AK ak, AKN akn, BK bk, CK ck, CKN ckn) { - ak.foo(ak); - // jspecify_nullness_mismatch - ak.foo(null); - - // jspecify_nullness_mismatch - akn.foo(null); - - bk.foo(bk); - // jspecify_nullness_mismatch - bk.foo(null); - - ck.foo(ck); - // jspecify_nullness_mismatch - ck.foo(null); - - // jspecify_nullness_mismatch - ckn.foo(null); - } -} diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/java/Simple.java b/compiler/testData/foreignAnnotations/java8Tests/jspecify/java/Simple.java deleted file mode 100644 index 57e59b8b741..00000000000 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/java/Simple.java +++ /dev/null @@ -1,33 +0,0 @@ -import org.jspecify.nullness.*; - -@NullMarked -public class Simple { - @Nullable public Derived field = null; - - @Nullable - public Derived foo(Derived x, @NullnessUnspecified Base y) { - return null; - } - - public Derived bar() { - return null; - } -} - -class Base {} -class Derived extends Base { - void foo() {} -} - -@NullMarked -class Use { - static public void main(Simple a, Derived x) { - a.foo(x, null).foo(); - // jspecify_nullness_mismatch - a.foo(null, x).foo(); - - a.bar().foo(); - - a.field.foo(); - } -} diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/java/TypeArgumentsFromParameterBounds.java b/compiler/testData/foreignAnnotations/java8Tests/jspecify/java/TypeArgumentsFromParameterBounds.java deleted file mode 100644 index b97a434f67f..00000000000 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/java/TypeArgumentsFromParameterBounds.java +++ /dev/null @@ -1,53 +0,0 @@ -import org.jspecify.nullness.*; - -@NullMarked -public class TypeArgumentsFromParameterBounds { } - -class A { - public void bar(TypeArgumentsFromParameterBounds<@Nullable Test, @Nullable Test, @Nullable Test> a) {} -} - -@NullMarked -class B { - public void bar(TypeArgumentsFromParameterBounds a) {} -} - -class C { - public void bar(TypeArgumentsFromParameterBounds a) {} -} - -class Test {} - -@NullMarked -class Use { - static public void main( - TypeArgumentsFromParameterBounds aNotNullNotNullNotNull, - TypeArgumentsFromParameterBounds aNotNullNotNullNull, - TypeArgumentsFromParameterBounds aNotNullNullNotNull, - TypeArgumentsFromParameterBounds aNotNullNullNull, - A a, B b, C c - ) { - // jspecify_nullness_mismatch - a.bar(aNotNullNotNullNotNull); - // jspecify_nullness_mismatch - a.bar(aNotNullNotNullNull); - // jspecify_nullness_mismatch - a.bar(aNotNullNullNotNull); - a.bar(aNotNullNullNull); - - b.bar(aNotNullNotNullNotNull); - // jspecify_nullness_mismatch - b.bar(aNotNullNotNullNull); - // jspecify_nullness_mismatch - b.bar(aNotNullNullNotNull); - // jspecify_nullness_mismatch - b.bar(aNotNullNullNull); - - // jspecify_nullness_mismatch - c.bar(aNotNullNotNullNotNull); - // jspecify_nullness_mismatch - c.bar(aNotNullNotNullNull); - c.bar(aNotNullNullNotNull); - c.bar(aNotNullNullNull); - } -} \ No newline at end of file diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/java/TypeParameterBounds.java b/compiler/testData/foreignAnnotations/java8Tests/jspecify/java/TypeParameterBounds.java deleted file mode 100644 index 83981071929..00000000000 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/java/TypeParameterBounds.java +++ /dev/null @@ -1,44 +0,0 @@ -import org.jspecify.nullness.*; - -@NullMarked -class A { - public void foo(@NullnessUnspecified T t) {} - public void bar(E e) {} -} - -@NullMarked -class B { - public void foo(T t) {} - public void bar(E e) {} -} - -class Test {} - -@NullMarked -public class TypeParameterBounds { - void main(A<@Nullable Object> a1, A a2, B<@Nullable Object> b1, B b2, T x) { - // jspecify_nullness_mismatch - a1.foo(null); - // jspecify_nullness_mismatch - a1.<@Nullable T>bar(null); - a1.bar(x); - - // jspecify_nullness_mismatch - a2.foo(null); - // jspecify_nullness_mismatch - a2.<@Nullable T>bar(null); - a2.bar(x); - - // jspecify_nullness_mismatch - b1.foo(null); - // jspecify_nullness_mismatch - b1.<@Nullable T>bar(null); - b1.bar(x); - - // jspecify_nullness_mismatch - b2.foo(null); - // jspecify_nullness_mismatch - b2.<@Nullable T>bar(null); - b2.bar(x); - } -} diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/java/WildcardsWithDefault.java b/compiler/testData/foreignAnnotations/java8Tests/jspecify/java/WildcardsWithDefault.java deleted file mode 100644 index e2568c2e5c5..00000000000 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/java/WildcardsWithDefault.java +++ /dev/null @@ -1,33 +0,0 @@ -import org.jspecify.nullness.*; - -@NullMarked -public class WildcardsWithDefault { - public void noBoundsNotNull(A a) {} - public void noBoundsNullable(A<@Nullable ?, @Nullable ?, @Nullable ?> a) {} -} - -class A {} - -@NullMarked -class Use { - public static void main( - A aNotNullNotNullNotNull, - A aNotNullNotNullNull, - A aNotNullNullNotNull, - A aNotNullNullNull, - WildcardsWithDefault b - ) { - // jspecify_nullness_mismatch - b.noBoundsNotNull(aNotNullNotNullNotNull); - b.noBoundsNotNull(aNotNullNotNullNull); - // jspecify_nullness_mismatch - b.noBoundsNotNull(aNotNullNullNotNull); - // jspecify_nullness_mismatch - b.noBoundsNotNull(aNotNullNullNull); - - b.noBoundsNullable(aNotNullNotNullNotNull); - b.noBoundsNullable(aNotNullNotNullNull); - b.noBoundsNullable(aNotNullNullNotNull); - b.noBoundsNullable(aNotNullNullNull); - } -} \ No newline at end of file diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/IgnoreAnnotations.kt b/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/IgnoreAnnotations.kt deleted file mode 100644 index 6c101b71c0e..00000000000 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/IgnoreAnnotations.kt +++ /dev/null @@ -1,17 +0,0 @@ -// JAVA_SOURCES: IgnoreAnnotations.java - -fun main(a: IgnoreAnnotations, x: Derived): Unit { - a.foo(x, null).foo() - // jspecify_nullness_mismatch - a.foo(null, x).foo() - - a.field.foo() - - // jspecify_nullness_mismatch - a.everythingNotNullable(null).foo() - a.everythingNotNullable(x).foo() - - a.everythingNullable(null).foo() - - a.everythingUnknown(null).foo() -} \ No newline at end of file diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/NonPlatformTypeParameter.kt b/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/NonPlatformTypeParameter.kt deleted file mode 100644 index 25ce418f167..00000000000 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/NonPlatformTypeParameter.kt +++ /dev/null @@ -1,16 +0,0 @@ -// JAVA_SOURCES: NonPlatformTypeParameter.java - -fun main(a1: NonPlatformTypeParameter, a2: NonPlatformTypeParameter, x: T): Unit { - a1.foo(null) - a1.bar(null) - // jspecify_nullness_mismatch - a1.bar(null) - a1.bar(x) - - // jspecify_nullness_mismatch - a2.foo(null) - a2.bar(null) - // jspecify_nullness_mismatch - a2.bar(null) - a2.bar(x) -} \ No newline at end of file diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/NullnessUnspecifiedTypeParameter.kt b/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/NullnessUnspecifiedTypeParameter.kt deleted file mode 100644 index ba384dabc66..00000000000 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/NullnessUnspecifiedTypeParameter.kt +++ /dev/null @@ -1,19 +0,0 @@ -// JAVA_SOURCES: NullnessUnspecifiedTypeParameter.java - -fun main(a1: NullnessUnspecifiedTypeParameter, a2: NullnessUnspecifiedTypeParameter, x: Test): Unit { - a1.foo(null) - a1.foo(1) - - a2.foo(null) - a2.foo(1) - - // jspecify_nullness_mismatch - a1.bar(null, null) - a1.bar(x, null) - a1.bar(x, 1) - - // jspecify_nullness_mismatch - a2.bar(null, null) - a2.bar(x, null) - a2.bar(x, 1) -} \ No newline at end of file diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/SelfType.kt b/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/SelfType.kt deleted file mode 100644 index e427fb8661e..00000000000 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/SelfType.kt +++ /dev/null @@ -1,21 +0,0 @@ -// JAVA_SOURCES: SelfType.java - -fun main(ak: AK, akn: AKN, bk: BK, ck: CK, ckn: CKN): Unit { - ak.foo(ak) - // jspecify_nullness_mismatch - ak.foo(null) - - // jspecify_nullness_mismatch - akn.foo(null) - - bk.foo(bk) - // jspecify_nullness_mismatch - bk.foo(null) - - ck.foo(ck) - // jspecify_nullness_mismatch - ck.foo(null) - - // jspecify_nullness_mismatch - ckn.foo(null) -} \ No newline at end of file diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/Simple.kt b/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/Simple.kt deleted file mode 100644 index 3288245f2c9..00000000000 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/Simple.kt +++ /dev/null @@ -1,11 +0,0 @@ -// JAVA_SOURCES: Simple.java - -fun main(a: Simple, x: Derived): Unit { - a.foo(x, null).foo() - // jspecify_nullness_mismatch - a.foo(null, x).foo() - - a.bar().foo() - - a.field.foo() -} \ No newline at end of file diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/TypeArgumentsFromParameterBounds.kt b/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/TypeArgumentsFromParameterBounds.kt deleted file mode 100644 index ea06768b933..00000000000 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/TypeArgumentsFromParameterBounds.kt +++ /dev/null @@ -1,32 +0,0 @@ -// JAVA_SOURCES: TypeArgumentsFromParameterBounds.java - -fun main( - aNotNullNotNullNotNull: TypeArgumentsFromParameterBounds, - aNotNullNotNullNull: TypeArgumentsFromParameterBounds, - aNotNullNullNotNull: TypeArgumentsFromParameterBounds, - aNotNullNullNull: TypeArgumentsFromParameterBounds, - a: A, b: B, c: C -): Unit { - // jspecify_nullness_mismatch - a.bar(aNotNullNotNullNotNull) - // jspecify_nullness_mismatch - a.bar(aNotNullNotNullNull) - // jspecify_nullness_mismatch - a.bar(aNotNullNullNotNull) - a.bar(aNotNullNullNull) - - b.bar(aNotNullNotNullNotNull) - // jspecify_nullness_mismatch - b.bar(aNotNullNotNullNull) - // jspecify_nullness_mismatch - b.bar(aNotNullNullNotNull) - // jspecify_nullness_mismatch - b.bar(aNotNullNullNull) - - // jspecify_nullness_mismatch - c.bar(aNotNullNotNullNotNull) - // jspecify_nullness_mismatch - c.bar(aNotNullNotNullNull) - c.bar(aNotNullNullNotNull) - c.bar(aNotNullNullNull) -} \ No newline at end of file diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/TypeParameterBounds.kt b/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/TypeParameterBounds.kt deleted file mode 100644 index e4edf982529..00000000000 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/TypeParameterBounds.kt +++ /dev/null @@ -1,27 +0,0 @@ -// JAVA_SOURCES: TypeParameterBounds.java - -fun main(a1: A, a2: A, b1: B, b2: B, x: T): Unit { - // jspecify_nullness_mismatch - a1.foo(null) - // jspecify_nullness_mismatch - a1.bar(null) - a1.bar(x) - - // jspecify_nullness_mismatch - a2.foo(null) - // jspecify_nullness_mismatch - a2.bar(null) - a2.bar(x) - - // jspecify_nullness_mismatch - b1.foo(null) - // jspecify_nullness_mismatch - b1.bar(null) - b1.bar(x) - - // jspecify_nullness_mismatch - b2.foo(null) - // jspecify_nullness_mismatch - b2.bar(null) - b2.bar(x) -} \ No newline at end of file diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/IgnoreAnnotations.kt b/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/IgnoreAnnotations.kt deleted file mode 100644 index a0c6b907a28..00000000000 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/IgnoreAnnotations.kt +++ /dev/null @@ -1,18 +0,0 @@ -// JAVA_SOURCES: IgnoreAnnotations.java -// JSPECIFY_STATE warn - -fun main(a: IgnoreAnnotations, x: Derived): Unit { - a.foo(x, null).foo() - // jspecify_nullness_mismatch - a.foo(null, x).foo() - - a.field.foo() - - // jspecify_nullness_mismatch - a.everythingNotNullable(null).foo() - a.everythingNotNullable(x).foo() - - a.everythingNullable(null).foo() - - a.everythingUnknown(null).foo() -} \ No newline at end of file diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/NonPlatformTypeParameter.kt b/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/NonPlatformTypeParameter.kt deleted file mode 100644 index bc5c0ff7773..00000000000 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/NonPlatformTypeParameter.kt +++ /dev/null @@ -1,17 +0,0 @@ -// JAVA_SOURCES: NonPlatformTypeParameter.java -// JSPECIFY_STATE warn - -fun main(a1: NonPlatformTypeParameter, a2: NonPlatformTypeParameter, x: T): Unit { - a1.foo(null) - a1.bar(null) - // jspecify_nullness_mismatch - a1.bar(null) - a1.bar(x) - - // jspecify_nullness_mismatch - a2.foo(null) - a2.bar(null) - // jspecify_nullness_mismatch - a2.bar(null) - a2.bar(x) -} \ No newline at end of file diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/NullnessUnspecifiedTypeParameter.kt b/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/NullnessUnspecifiedTypeParameter.kt deleted file mode 100644 index 1840067a7ef..00000000000 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/NullnessUnspecifiedTypeParameter.kt +++ /dev/null @@ -1,20 +0,0 @@ -// JAVA_SOURCES: NullnessUnspecifiedTypeParameter.java -// JSPECIFY_STATE warn - -fun main(a1: NullnessUnspecifiedTypeParameter, a2: NullnessUnspecifiedTypeParameter, x: Test): Unit { - a1.foo(null) - a1.foo(1) - - a2.foo(null) - a2.foo(1) - - // jspecify_nullness_mismatch - a1.bar(null, null) - a1.bar(x, null) - a1.bar(x, 1) - - // jspecify_nullness_mismatch - a2.bar(null, null) - a2.bar(x, null) - a2.bar(x, 1) -} \ No newline at end of file diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/SelfType.kt b/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/SelfType.kt deleted file mode 100644 index b2375e4461f..00000000000 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/SelfType.kt +++ /dev/null @@ -1,22 +0,0 @@ -// JAVA_SOURCES: SelfType.java -// JSPECIFY_STATE warn - -fun main(ak: AK, akn: AKN, bk: BK, ck: CK, ckn: CKN): Unit { - ak.foo(ak) - // jspecify_nullness_mismatch - ak.foo(null) - - // jspecify_nullness_mismatch - akn.foo(null) - - bk.foo(bk) - // jspecify_nullness_mismatch - bk.foo(null) - - ck.foo(ck) - // jspecify_nullness_mismatch - ck.foo(null) - - // jspecify_nullness_mismatch - ckn.foo(null) -} \ No newline at end of file diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/Simple.kt b/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/Simple.kt deleted file mode 100644 index 42a08b816cd..00000000000 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/Simple.kt +++ /dev/null @@ -1,12 +0,0 @@ -// JAVA_SOURCES: Simple.java -// JSPECIFY_STATE warn - -fun main(a: Simple, x: Derived): Unit { - a.foo(x, null).foo() - // jspecify_nullness_mismatch - a.foo(null, x).foo() - - a.bar().foo() - - a.field.foo() -} \ No newline at end of file diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/TypeArgumentsFromParameterBounds.kt b/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/TypeArgumentsFromParameterBounds.kt deleted file mode 100644 index a1dae2b46cf..00000000000 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/TypeArgumentsFromParameterBounds.kt +++ /dev/null @@ -1,33 +0,0 @@ -// JAVA_SOURCES: TypeArgumentsFromParameterBounds.java -// JSPECIFY_STATE warn - -fun main( - aNotNullNotNullNotNull: TypeArgumentsFromParameterBounds, - aNotNullNotNullNull: TypeArgumentsFromParameterBounds, - aNotNullNullNotNull: TypeArgumentsFromParameterBounds, - aNotNullNullNull: TypeArgumentsFromParameterBounds, - a: A, b: B, c: C -): Unit { - // jspecify_nullness_mismatch - a.bar(aNotNullNotNullNotNull) - // jspecify_nullness_mismatch - a.bar(aNotNullNotNullNull) - // jspecify_nullness_mismatch - a.bar(aNotNullNullNotNull) - a.bar(aNotNullNullNull) - - b.bar(aNotNullNotNullNotNull) - // jspecify_nullness_mismatch - b.bar(aNotNullNotNullNull) - // jspecify_nullness_mismatch - b.bar(aNotNullNullNotNull) - // jspecify_nullness_mismatch - b.bar(aNotNullNullNull) - - // jspecify_nullness_mismatch - c.bar(aNotNullNotNullNotNull) - // jspecify_nullness_mismatch - c.bar(aNotNullNotNullNull) - c.bar(aNotNullNullNotNull) - c.bar(aNotNullNullNull) -} \ No newline at end of file diff --git a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/TypeParameterBounds.kt b/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/TypeParameterBounds.kt deleted file mode 100644 index 18ad46b3bed..00000000000 --- a/compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/TypeParameterBounds.kt +++ /dev/null @@ -1,28 +0,0 @@ -// JAVA_SOURCES: TypeParameterBounds.java -// JSPECIFY_STATE warn - -fun main(a1: A, a2: A, b1: B, b2: B, x: T): Unit { - // jspecify_nullness_mismatch - a1.foo(null) - // jspecify_nullness_mismatch - a1.bar(null) - a1.bar(x) - - // jspecify_nullness_mismatch - a2.foo(null) - // jspecify_nullness_mismatch - a2.bar(null) - a2.bar(x) - - // jspecify_nullness_mismatch - b1.foo(null) - // jspecify_nullness_mismatch - b1.bar(null) - b1.bar(x) - - // jspecify_nullness_mismatch - b2.foo(null) - // jspecify_nullness_mismatch - b2.bar(null) - b2.bar(x) -} \ No newline at end of file diff --git a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ClassTypeParameterBound.java b/compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ClassTypeParameterBound.java deleted file mode 100644 index 5269a0556e3..00000000000 --- a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ClassTypeParameterBound.java +++ /dev/null @@ -1,6 +0,0 @@ -import org.jetbrains.annotations.NotNull; - -public class ClassTypeParameterBound { - ClassTypeParameterBound(T x) { } - ClassTypeParameterBound() { } -} diff --git a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ClassTypeParameterBoundWithWarnings.java b/compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ClassTypeParameterBoundWithWarnings.java deleted file mode 100644 index 74e7708be28..00000000000 --- a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ClassTypeParameterBoundWithWarnings.java +++ /dev/null @@ -1,6 +0,0 @@ -import org.jetbrains.annotations.NotNull; - -public class ClassTypeParameterBoundWithWarnings { - ClassTypeParameterBoundWithWarnings() { } - ClassTypeParameterBoundWithWarnings(T x) { } -} diff --git a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ReturnType.java b/compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ReturnType.java deleted file mode 100644 index bfe37d1e4f1..00000000000 --- a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ReturnType.java +++ /dev/null @@ -1,13 +0,0 @@ -import org.jetbrains.annotations.*; - -public class ReturnType { - public interface A {} - - public A<@Nullable String, @Nullable T> foo1() { return null; } - public A<@Nullable String, @NotNull T> foo2() { return null; } - public A<@NotNull String, @NotNull T> foo3 = null; - public @NotNull T [] foo4 = null; - public ReturnType<@Nullable String> foo41 = null; - public T foo411 = null; - public @Nullable String [] foo5() { return null; } -} diff --git a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ReturnTypeWithWarnings.java b/compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ReturnTypeWithWarnings.java deleted file mode 100644 index 11f6a7d2e1d..00000000000 --- a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ReturnTypeWithWarnings.java +++ /dev/null @@ -1,13 +0,0 @@ -import org.jetbrains.annotations.*; - -public class ReturnTypeWithWarnings { - public interface A {} - - public A<@Nullable String, @Nullable T> foo1() { return null; } - public A<@Nullable String, @NotNull T> foo2() { return null; } - public A<@NotNull String, @NotNull T> foo3 = null; - public @NotNull T [] foo4 = null; - public ReturnTypeWithWarnings<@Nullable String> foo41 = null; - public T foo411 = null; - public @Nullable String [] foo5() { return null; } -} diff --git a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ValueParameter.java b/compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ValueParameter.java deleted file mode 100644 index 322ff878d18..00000000000 --- a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ValueParameter.java +++ /dev/null @@ -1,13 +0,0 @@ -import org.jetbrains.annotations.*; - -public class ValueParameter { - public interface A {} - - public void foo1(A<@Nullable String, @Nullable T> x) { } - public void foo2(A<@Nullable String, @NotNull T> x) { } - public void foo3(A<@NotNull String, @NotNull T> x) { } - public void foo4(@NotNull T [] x) { } - public void foo41(@Nullable String x) { } - public void foo411(T x) { } - public void foo5(@Nullable String [] x) { } -} diff --git a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ValueParameterWithWarnings.java b/compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ValueParameterWithWarnings.java deleted file mode 100644 index 7fd49516069..00000000000 --- a/compiler/testData/foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava/ValueParameterWithWarnings.java +++ /dev/null @@ -1,13 +0,0 @@ -import org.jetbrains.annotations.*; - -public class ValueParameterWithWarnings { - public interface A {} - - public void foo1(A<@Nullable String, @Nullable T> x) { } - public void foo2(A<@Nullable String, @NotNull T> x) { } - public void foo3(A<@NotNull String, @NotNull T> x) { } - public void foo4(@NotNull T [] x) { } - public void foo41(@Nullable String x) { } - public void foo411(T x) { } - public void foo5(@Nullable String [] x) { } -} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ForeignAnnotationsNoAnnotationInClasspathTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ForeignAnnotationsNoAnnotationInClasspathTestGenerated.java index ad6535261f8..9af21a594c3 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ForeignAnnotationsNoAnnotationInClasspathTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ForeignAnnotationsNoAnnotationInClasspathTestGenerated.java @@ -18,641 +18,1091 @@ import java.util.regex.Pattern; @SuppressWarnings("all") public class ForeignAnnotationsNoAnnotationInClasspathTestGenerated extends AbstractForeignAnnotationsNoAnnotationInClasspathTest { @Nested - @TestMetadata("compiler/testData/foreignAnnotations/tests") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/tests") @TestDataPath("$PROJECT_ROOT") public class Tests { @Test public void testAllFilesPresentInTests() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/tests"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test @TestMetadata("androidRecently.kt") public void testAndroidRecently() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/androidRecently.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/androidRecently.kt"); } @Test @TestMetadata("androidSdk.kt") public void testAndroidSdk() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/androidSdk.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/androidSdk.kt"); } @Test @TestMetadata("android_support.kt") public void testAndroid_support() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/android_support.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/android_support.kt"); } @Test @TestMetadata("androidx.kt") public void testAndroidx() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/androidx.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/androidx.kt"); } @Test @TestMetadata("aosp.kt") public void testAosp() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/aosp.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/aosp.kt"); } @Test @TestMetadata("checkerFramework.kt") public void testCheckerFramework() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/checkerFramework.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/checkerFramework.kt"); } @Test @TestMetadata("eclipse.kt") public void testEclipse() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/eclipse.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/eclipse.kt"); } @Test @TestMetadata("findBugsSimple.kt") public void testFindBugsSimple() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/findBugsSimple.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/findBugsSimple.kt"); } @Test @TestMetadata("irrelevantQualifierNicknames.kt") public void testIrrelevantQualifierNicknames() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/irrelevantQualifierNicknames.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/irrelevantQualifierNicknames.kt"); } @Test @TestMetadata("lombokSimple.kt") public void testLombokSimple() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/lombokSimple.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/lombokSimple.kt"); } @Test @TestMetadata("rxjava.kt") public void testRxjava() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/rxjava.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/rxjava.kt"); } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/tests/jsr305") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305") @TestDataPath("$PROJECT_ROOT") public class Jsr305 { @Test public void testAllFilesPresentInJsr305() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/jsr305"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test @TestMetadata("nonNullNever.kt") public void testNonNullNever() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nonNullNever.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nonNullNever.kt"); } @Test @TestMetadata("nullabilityNicknames.kt") public void testNullabilityNicknames() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityNicknames.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityNicknames.kt"); } @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/simple.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/simple.kt"); } @Test @TestMetadata("strange.kt") public void testStrange() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/strange.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/strange.kt"); } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/tests/jsr305/ignore") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/ignore") @TestDataPath("$PROJECT_ROOT") public class Ignore { @Test public void testAllFilesPresentInIgnore() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/jsr305/ignore"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/ignore"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test @TestMetadata("parametersAreNonnullByDefault.kt") public void testParametersAreNonnullByDefault() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/ignore/parametersAreNonnullByDefault.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/ignore/parametersAreNonnullByDefault.kt"); } } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings") @TestDataPath("$PROJECT_ROOT") public class NullabilityWarnings { @Test public void testAllFilesPresentInNullabilityWarnings() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test @TestMetadata("elvis.kt") public void testElvis() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/elvis.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/elvis.kt"); } @Test @TestMetadata("localInference.kt") public void testLocalInference() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/localInference.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/localInference.kt"); } @Test @TestMetadata("nullabilityGenerics.kt") public void testNullabilityGenerics() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/nullabilityGenerics.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/nullabilityGenerics.kt"); } @Test @TestMetadata("nullabilityNicknames.kt") public void testNullabilityNicknames() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/nullabilityNicknames.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/nullabilityNicknames.kt"); } @Test @TestMetadata("safeCalls.kt") public void testSafeCalls() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/safeCalls.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/safeCalls.kt"); } @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/simple.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/simple.kt"); } @Test @TestMetadata("strange.kt") public void testStrange() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/strange.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/strange.kt"); } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes") @TestDataPath("$PROJECT_ROOT") public class FromPlatformTypes { @Test public void testAllFilesPresentInFromPlatformTypes() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test @TestMetadata("arithmetic.kt") public void testArithmetic() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/arithmetic.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/arithmetic.kt"); } @Test @TestMetadata("array.kt") public void testArray() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/array.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/array.kt"); } @Test @TestMetadata("assignToVar.kt") public void testAssignToVar() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/assignToVar.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/assignToVar.kt"); } @Test @TestMetadata("conditions.kt") public void testConditions() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/conditions.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/conditions.kt"); } @Test @TestMetadata("dataFlowInfo.kt") public void testDataFlowInfo() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/dataFlowInfo.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/dataFlowInfo.kt"); } @Test @TestMetadata("defaultParameters.kt") public void testDefaultParameters() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/defaultParameters.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/defaultParameters.kt"); } @Test @TestMetadata("delegatedProperties.kt") public void testDelegatedProperties() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegatedProperties.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegatedProperties.kt"); } @Test @TestMetadata("delegation.kt") public void testDelegation() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegation.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegation.kt"); } @Test @TestMetadata("derefenceExtension.kt") public void testDerefenceExtension() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceExtension.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceExtension.kt"); } @Test @TestMetadata("derefenceMember.kt") public void testDerefenceMember() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceMember.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceMember.kt"); } @Test @TestMetadata("expectedType.kt") public void testExpectedType() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/expectedType.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/expectedType.kt"); } @Test @TestMetadata("for.kt") public void testFor() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/for.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/for.kt"); } @Test @TestMetadata("functionArguments.kt") public void testFunctionArguments() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/functionArguments.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/functionArguments.kt"); } @Test @TestMetadata("invoke.kt") public void testInvoke() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/invoke.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/invoke.kt"); } @Test @TestMetadata("kt6829.kt") public void testKt6829() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/kt6829.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/kt6829.kt"); } @Test @TestMetadata("multiDeclaration.kt") public void testMultiDeclaration() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/multiDeclaration.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/multiDeclaration.kt"); } @Test @TestMetadata("passToJava.kt") public void testPassToJava() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/passToJava.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/passToJava.kt"); } @Test @TestMetadata("primitiveArray.kt") public void testPrimitiveArray() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/primitiveArray.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/primitiveArray.kt"); } @Test @TestMetadata("throw.kt") public void testThrow() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/throw.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/throw.kt"); } @Test @TestMetadata("uselessElvisRightIsNull.kt") public void testUselessElvisRightIsNull() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/uselessElvisRightIsNull.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/uselessElvisRightIsNull.kt"); } } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault") @TestDataPath("$PROJECT_ROOT") public class TypeQualifierDefault { @Test public void testAllFilesPresentInTypeQualifierDefault() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test @TestMetadata("equalsOnNonNull.kt") public void testEqualsOnNonNull() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/equalsOnNonNull.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/equalsOnNonNull.kt"); } @Test @TestMetadata("fieldsAreNullable.kt") public void testFieldsAreNullable() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/fieldsAreNullable.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/fieldsAreNullable.kt"); } @Test @TestMetadata("nullabilityFromOverridden.kt") public void testNullabilityFromOverridden() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/nullabilityFromOverridden.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/nullabilityFromOverridden.kt"); } @Test @TestMetadata("overridingDefaultQualifier.kt") public void testOverridingDefaultQualifier() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/overridingDefaultQualifier.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/overridingDefaultQualifier.kt"); } @Test @TestMetadata("parametersAreNonnullByDefault.kt") public void testParametersAreNonnullByDefault() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefault.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefault.kt"); } @Test @TestMetadata("parametersAreNonnullByDefaultPackage.kt") public void testParametersAreNonnullByDefaultPackage() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefaultPackage.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefaultPackage.kt"); } @Test @TestMetadata("springNullable.kt") public void testSpringNullable() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullable.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullable.kt"); } @Test @TestMetadata("springNullablePackage.kt") public void testSpringNullablePackage() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullablePackage.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullablePackage.kt"); } } } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault") @TestDataPath("$PROJECT_ROOT") public class TypeQualifierDefault { @Test public void testAllFilesPresentInTypeQualifierDefault() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test @TestMetadata("fieldsAreNullable.kt") public void testFieldsAreNullable() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/fieldsAreNullable.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/fieldsAreNullable.kt"); } @Test @TestMetadata("forceFlexibility.kt") public void testForceFlexibility() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/forceFlexibility.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/forceFlexibility.kt"); } @Test @TestMetadata("forceFlexibleOverOverrides.kt") public void testForceFlexibleOverOverrides() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/forceFlexibleOverOverrides.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/forceFlexibleOverOverrides.kt"); } @Test @TestMetadata("nullabilityFromOverridden.kt") public void testNullabilityFromOverridden() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/nullabilityFromOverridden.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/nullabilityFromOverridden.kt"); } @Test @TestMetadata("overridingDefaultQualifier.kt") public void testOverridingDefaultQualifier() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/overridingDefaultQualifier.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/overridingDefaultQualifier.kt"); } @Test @TestMetadata("parametersAreNonnullByDefault.kt") public void testParametersAreNonnullByDefault() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefault.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefault.kt"); } @Test @TestMetadata("parametersAreNonnullByDefaultPackage.kt") public void testParametersAreNonnullByDefaultPackage() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefaultPackage.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefaultPackage.kt"); } @Test @TestMetadata("springNullable.kt") public void testSpringNullable() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/springNullable.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/springNullable.kt"); } @Test @TestMetadata("springNullablePackage.kt") public void testSpringNullablePackage() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/springNullablePackage.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/springNullablePackage.kt"); } } } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings") @TestDataPath("$PROJECT_ROOT") public class Jsr305NullabilityWarnings { @Test public void testAllFilesPresentInJsr305NullabilityWarnings() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration") @TestDataPath("$PROJECT_ROOT") public class Migration { @Test public void testAllFilesPresentInMigration() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test @TestMetadata("customMigration.kt") public void testCustomMigration() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/customMigration.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/customMigration.kt"); } @Test @TestMetadata("globalIgnore.kt") public void testGlobalIgnore() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/globalIgnore.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/globalIgnore.kt"); } @Test @TestMetadata("globalWarningMigrationIgnore.kt") public void testGlobalWarningMigrationIgnore() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/globalWarningMigrationIgnore.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/globalWarningMigrationIgnore.kt"); } @Test @TestMetadata("migrationError.kt") public void testMigrationError() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/migrationError.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/migrationError.kt"); } @Test @TestMetadata("migrationIgnore.kt") public void testMigrationIgnore() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/migrationIgnore.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/migrationIgnore.kt"); } @Test @TestMetadata("migrationWarning.kt") public void testMigrationWarning() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/migrationWarning.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/migrationWarning.kt"); } @Test @TestMetadata("overrideConflicts.kt") public void testOverrideConflicts() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/overrideConflicts.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/overrideConflicts.kt"); } @Test @TestMetadata("specialCollision.kt") public void testSpecialCollision() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/specialCollision.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/specialCollision.kt"); } @Test @TestMetadata("stateRefinement.kt") public void testStateRefinement() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/stateRefinement.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/stateRefinement.kt"); } } } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/tests/typeQualifierDefault") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/tests/typeQualifierDefault") @TestDataPath("$PROJECT_ROOT") public class TypeQualifierDefault { @Test public void testAllFilesPresentInTypeQualifierDefault() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test @TestMetadata("defaultAndNicknameMigrationPolicy.kt") public void testDefaultAndNicknameMigrationPolicy() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/typeQualifierDefault/defaultAndNicknameMigrationPolicy.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/typeQualifierDefault/defaultAndNicknameMigrationPolicy.kt"); } } } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/java8Tests") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests") @TestDataPath("$PROJECT_ROOT") public class Java8Tests { @Test public void testAllFilesPresentInJava8Tests() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/java8Tests"), Pattern.compile("^(.+)\\.kt$"), null, true, "jspecify", "typeEnhancementOnCompiledJava"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test @TestMetadata("checkerFramework.kt") public void testCheckerFramework() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/checkerFramework.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/checkerFramework.kt"); } @Test @TestMetadata("eclipse.kt") public void testEclipse() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/eclipse.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/eclipse.kt"); } @Test @TestMetadata("typeUseOnObject.kt") public void testTypeUseOnObject() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/typeUseOnObject.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeUseOnObject.kt"); } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/java8Tests/jsr305") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify") + @TestDataPath("$PROJECT_ROOT") + public class Jspecify { + @Test + public void testAllFilesPresentInJspecify() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode") + @TestDataPath("$PROJECT_ROOT") + public class StrictMode { + @Test + public void testAllFilesPresentInStrictMode() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("AnnotatedBoundsOfWildcard.kt") + public void testAnnotatedBoundsOfWildcard() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.kt"); + } + + @Test + @TestMetadata("AnnotatedBoundsOfWildcard.fir.kt") + public void testAnnotatedBoundsOfWildcard_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.fir.kt"); + } + + @Test + @TestMetadata("Defaults.kt") + public void testDefaults() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.kt"); + } + + @Test + @TestMetadata("Defaults.fir.kt") + public void testDefaults_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.fir.kt"); + } + + @Test + @TestMetadata("IgnoreAnnotations.kt") + public void testIgnoreAnnotations() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.kt"); + } + + @Test + @TestMetadata("IgnoreAnnotations.fir.kt") + public void testIgnoreAnnotations_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.fir.kt"); + } + + @Test + @TestMetadata("NonPlatformTypeParameter.kt") + public void testNonPlatformTypeParameter() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.kt"); + } + + @Test + @TestMetadata("NonPlatformTypeParameter.fir.kt") + public void testNonPlatformTypeParameter_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.fir.kt"); + } + + @Test + @TestMetadata("NullnessUnspecifiedTypeParameter.kt") + public void testNullnessUnspecifiedTypeParameter() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.kt"); + } + + @Test + @TestMetadata("NullnessUnspecifiedTypeParameter.fir.kt") + public void testNullnessUnspecifiedTypeParameter_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.fir.kt"); + } + + @Test + @TestMetadata("SelfType.kt") + public void testSelfType() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.kt"); + } + + @Test + @TestMetadata("SelfType.fir.kt") + public void testSelfType_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.fir.kt"); + } + + @Test + @TestMetadata("Simple.kt") + public void testSimple() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.kt"); + } + + @Test + @TestMetadata("Simple.fir.kt") + public void testSimple_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.fir.kt"); + } + + @Test + @TestMetadata("TypeArgumentsFromParameterBounds.kt") + public void testTypeArgumentsFromParameterBounds() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.kt"); + } + + @Test + @TestMetadata("TypeArgumentsFromParameterBounds.fir.kt") + public void testTypeArgumentsFromParameterBounds_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.fir.kt"); + } + + @Test + @TestMetadata("TypeParameterBounds.kt") + public void testTypeParameterBounds() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.kt"); + } + + @Test + @TestMetadata("TypeParameterBounds.fir.kt") + public void testTypeParameterBounds_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.fir.kt"); + } + + @Test + @TestMetadata("WildcardsWithDefault.kt") + public void testWildcardsWithDefault() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.kt"); + } + + @Test + @TestMetadata("WildcardsWithDefault.fir.kt") + public void testWildcardsWithDefault_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.fir.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode") + @TestDataPath("$PROJECT_ROOT") + public class WarnMode { + @Test + public void testAllFilesPresentInWarnMode() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("AnnotatedBoundsOfWildcard.kt") + public void testAnnotatedBoundsOfWildcard() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.kt"); + } + + @Test + @TestMetadata("AnnotatedBoundsOfWildcard.fir.kt") + public void testAnnotatedBoundsOfWildcard_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.fir.kt"); + } + + @Test + @TestMetadata("Defaults.kt") + public void testDefaults() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Defaults.kt"); + } + + @Test + @TestMetadata("Defaults.fir.kt") + public void testDefaults_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Defaults.fir.kt"); + } + + @Test + @TestMetadata("IgnoreAnnotations.kt") + public void testIgnoreAnnotations() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.kt"); + } + + @Test + @TestMetadata("IgnoreAnnotations.fir.kt") + public void testIgnoreAnnotations_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.fir.kt"); + } + + @Test + @TestMetadata("NonPlatformTypeParameter.kt") + public void testNonPlatformTypeParameter() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.kt"); + } + + @Test + @TestMetadata("NonPlatformTypeParameter.fir.kt") + public void testNonPlatformTypeParameter_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.fir.kt"); + } + + @Test + @TestMetadata("NullnessUnspecifiedTypeParameter.kt") + public void testNullnessUnspecifiedTypeParameter() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.kt"); + } + + @Test + @TestMetadata("NullnessUnspecifiedTypeParameter.fir.kt") + public void testNullnessUnspecifiedTypeParameter_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.fir.kt"); + } + + @Test + @TestMetadata("SelfType.kt") + public void testSelfType() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.kt"); + } + + @Test + @TestMetadata("SelfType.fir.kt") + public void testSelfType_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.fir.kt"); + } + + @Test + @TestMetadata("Simple.kt") + public void testSimple() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.kt"); + } + + @Test + @TestMetadata("Simple.fir.kt") + public void testSimple_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.fir.kt"); + } + + @Test + @TestMetadata("TypeArgumentsFromParameterBounds.kt") + public void testTypeArgumentsFromParameterBounds() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.kt"); + } + + @Test + @TestMetadata("TypeArgumentsFromParameterBounds.fir.kt") + public void testTypeArgumentsFromParameterBounds_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.fir.kt"); + } + + @Test + @TestMetadata("TypeParameterBounds.kt") + public void testTypeParameterBounds() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.kt"); + } + + @Test + @TestMetadata("TypeParameterBounds.fir.kt") + public void testTypeParameterBounds_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.fir.kt"); + } + + @Test + @TestMetadata("WildcardsWithDefault.kt") + public void testWildcardsWithDefault() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.kt"); + } + + @Test + @TestMetadata("WildcardsWithDefault.fir.kt") + public void testWildcardsWithDefault_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.fir.kt"); + } + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305") @TestDataPath("$PROJECT_ROOT") public class Jsr305 { @Test public void testAllFilesPresentInJsr305() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/java8Tests/jsr305"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test @TestMetadata("defaultAnnotationAppliedToType.kt") public void testDefaultAnnotationAppliedToType() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/jsr305/defaultAnnotationAppliedToType.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/defaultAnnotationAppliedToType.kt"); } @Test @TestMetadata("defaultAnnotationAppliedToTypeForCompiledJava.kt") public void testDefaultAnnotationAppliedToTypeForCompiledJava() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/jsr305/defaultAnnotationAppliedToTypeForCompiledJava.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/defaultAnnotationAppliedToTypeForCompiledJava.kt"); } @Test @TestMetadata("springNullableWithTypeUse.kt") public void testSpringNullableWithTypeUse() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/jsr305/springNullableWithTypeUse.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/springNullableWithTypeUse.kt"); } @Test @TestMetadata("typeArguments.kt") public void testTypeArguments() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/jsr305/typeArguments.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/typeArguments.kt"); } @Test @TestMetadata("typeUseVsMethodConflict.kt") public void testTypeUseVsMethodConflict() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/jsr305/typeUseVsMethodConflict.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/typeUseVsMethodConflict.kt"); } } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/java8Tests/typeEnhancement") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement") @TestDataPath("$PROJECT_ROOT") public class TypeEnhancement { @Test public void testAllFilesPresentInTypeEnhancement() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/java8Tests/typeEnhancement"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled") + @TestDataPath("$PROJECT_ROOT") + public class OnCompiled { + @Test + public void testAllFilesPresentInOnCompiled() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("classTypeParameterBound.kt") + public void testClassTypeParameterBound() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/classTypeParameterBound.kt"); + } + + @Test + @TestMetadata("classTypeParameterBoundWithWarnings.kt") + public void testClassTypeParameterBoundWithWarnings() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/classTypeParameterBoundWithWarnings.kt"); + } + + @Test + @TestMetadata("classTypeParameterBoundWithWarnings.fir.kt") + public void testClassTypeParameterBoundWithWarnings_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/classTypeParameterBoundWithWarnings.fir.kt"); + } + + @Test + @TestMetadata("classTypeParameterBound.fir.kt") + public void testClassTypeParameterBound_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/classTypeParameterBound.fir.kt"); + } + + @Test + @TestMetadata("returnType.kt") + public void testReturnType() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/returnType.kt"); + } + + @Test + @TestMetadata("returnTypeWithWarnings.kt") + public void testReturnTypeWithWarnings() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/returnTypeWithWarnings.kt"); + } + + @Test + @TestMetadata("returnTypeWithWarnings.fir.kt") + public void testReturnTypeWithWarnings_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/returnTypeWithWarnings.fir.kt"); + } + + @Test + @TestMetadata("returnType.fir.kt") + public void testReturnType_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/returnType.fir.kt"); + } + + @Test + @TestMetadata("valueParameter.kt") + public void testValueParameter() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/valueParameter.kt"); + } + + @Test + @TestMetadata("valueParameterWithWarnings.kt") + public void testValueParameterWithWarnings() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/valueParameterWithWarnings.kt"); + } + + @Test + @TestMetadata("valueParameterWithWarnings.fir.kt") + public void testValueParameterWithWarnings_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/valueParameterWithWarnings.fir.kt"); + } + + @Test + @TestMetadata("valueParameter.fir.kt") + public void testValueParameter_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/valueParameter.fir.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources") + @TestDataPath("$PROJECT_ROOT") + public class OnSources { + @Test + public void testAllFilesPresentInOnSources() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("annotatedTypeArguments.kt") + public void testAnnotatedTypeArguments() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/annotatedTypeArguments.kt"); + } + + @Test + @TestMetadata("annotatedTypeArguments.fir.kt") + public void testAnnotatedTypeArguments_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/annotatedTypeArguments.fir.kt"); + } + + @Test + @TestMetadata("methodWithTypeParameter.kt") + public void testMethodWithTypeParameter() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/methodWithTypeParameter.kt"); + } + + @Test + @TestMetadata("methodWithTypeParameter.fir.kt") + public void testMethodWithTypeParameter_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/methodWithTypeParameter.fir.kt"); + } + + @Test + @TestMetadata("notNullVarargsOverrides.kt") + public void testNotNullVarargsOverrides() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/notNullVarargsOverrides.kt"); + } + + @Test + @TestMetadata("notNullVarargsOverrides.fir.kt") + public void testNotNullVarargsOverrides_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/notNullVarargsOverrides.fir.kt"); + } + + @Test + @TestMetadata("nullableVarargsOverrides.kt") + public void testNullableVarargsOverrides() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/nullableVarargsOverrides.kt"); + } + + @Test + @TestMetadata("nullableVarargsOverrides.fir.kt") + public void testNullableVarargsOverrides_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/nullableVarargsOverrides.fir.kt"); + } + + @Test + @TestMetadata("returnTypeDifferentConstructor.kt") + public void testReturnTypeDifferentConstructor() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeDifferentConstructor.kt"); + } + + @Test + @TestMetadata("returnTypeDifferentConstructor.fir.kt") + public void testReturnTypeDifferentConstructor_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeDifferentConstructor.fir.kt"); + } + + @Test + @TestMetadata("returnTypeOverrideInKotlin.kt") + public void testReturnTypeOverrideInKotlin() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeOverrideInKotlin.kt"); + } + + @Test + @TestMetadata("returnTypeOverrideInKotlin.fir.kt") + public void testReturnTypeOverrideInKotlin_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeOverrideInKotlin.fir.kt"); + } + + @Test + @TestMetadata("simple.kt") + public void testSimple() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/simple.kt"); + } + + @Test + @TestMetadata("simple.fir.kt") + public void testSimple_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/simple.fir.kt"); + } + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava") + @TestDataPath("$PROJECT_ROOT") + public class TypeEnhancementOnCompiledJava { + @Test + public void testAllFilesPresentInTypeEnhancementOnCompiledJava() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test - @TestMetadata("annotatedTypeArguments.kt") - public void testAnnotatedTypeArguments() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/annotatedTypeArguments.kt"); + @TestMetadata("ClassTypeParameterBound.kt") + public void testClassTypeParameterBound() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ClassTypeParameterBound.kt"); } @Test - @TestMetadata("methodWithTypeParameter.kt") - public void testMethodWithTypeParameter() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/methodWithTypeParameter.kt"); + @TestMetadata("ClassTypeParameterBoundWithWarnings.kt") + public void testClassTypeParameterBoundWithWarnings() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ClassTypeParameterBoundWithWarnings.kt"); } @Test - @TestMetadata("notNullVarargsOverrides.kt") - public void testNotNullVarargsOverrides() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/notNullVarargsOverrides.kt"); + @TestMetadata("ReturnType.kt") + public void testReturnType() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ReturnType.kt"); } @Test - @TestMetadata("nullableVarargsOverrides.kt") - public void testNullableVarargsOverrides() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/nullableVarargsOverrides.kt"); + @TestMetadata("ReturnTypeWithWarnings.kt") + public void testReturnTypeWithWarnings() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ReturnTypeWithWarnings.kt"); } @Test - @TestMetadata("returnTypeDifferentConstructor.kt") - public void testReturnTypeDifferentConstructor() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/returnTypeDifferentConstructor.kt"); + @TestMetadata("ValueParameter.kt") + public void testValueParameter() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ValueParameter.kt"); } @Test - @TestMetadata("returnTypeOverrideInKotlin.kt") - public void testReturnTypeOverrideInKotlin() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/returnTypeOverrideInKotlin.kt"); - } - - @Test - @TestMetadata("simple.kt") - public void testSimple() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/simple.kt"); + @TestMetadata("ValueParameterWithWarnings.kt") + public void testValueParameterWithWarnings() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ValueParameterWithWarnings.kt"); } } } diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ForeignAnnotationsNoAnnotationInClasspathWithPsiClassReadingTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ForeignAnnotationsNoAnnotationInClasspathWithPsiClassReadingTestGenerated.java index 30bc40853b8..41aa9cfba34 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ForeignAnnotationsNoAnnotationInClasspathWithPsiClassReadingTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ForeignAnnotationsNoAnnotationInClasspathWithPsiClassReadingTestGenerated.java @@ -18,641 +18,1091 @@ import java.util.regex.Pattern; @SuppressWarnings("all") public class ForeignAnnotationsNoAnnotationInClasspathWithPsiClassReadingTestGenerated extends AbstractForeignAnnotationsNoAnnotationInClasspathWithPsiClassReadingTest { @Nested - @TestMetadata("compiler/testData/foreignAnnotations/tests") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/tests") @TestDataPath("$PROJECT_ROOT") public class Tests { @Test public void testAllFilesPresentInTests() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/tests"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test @TestMetadata("androidRecently.kt") public void testAndroidRecently() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/androidRecently.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/androidRecently.kt"); } @Test @TestMetadata("androidSdk.kt") public void testAndroidSdk() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/androidSdk.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/androidSdk.kt"); } @Test @TestMetadata("android_support.kt") public void testAndroid_support() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/android_support.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/android_support.kt"); } @Test @TestMetadata("androidx.kt") public void testAndroidx() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/androidx.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/androidx.kt"); } @Test @TestMetadata("aosp.kt") public void testAosp() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/aosp.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/aosp.kt"); } @Test @TestMetadata("checkerFramework.kt") public void testCheckerFramework() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/checkerFramework.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/checkerFramework.kt"); } @Test @TestMetadata("eclipse.kt") public void testEclipse() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/eclipse.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/eclipse.kt"); } @Test @TestMetadata("findBugsSimple.kt") public void testFindBugsSimple() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/findBugsSimple.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/findBugsSimple.kt"); } @Test @TestMetadata("irrelevantQualifierNicknames.kt") public void testIrrelevantQualifierNicknames() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/irrelevantQualifierNicknames.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/irrelevantQualifierNicknames.kt"); } @Test @TestMetadata("lombokSimple.kt") public void testLombokSimple() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/lombokSimple.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/lombokSimple.kt"); } @Test @TestMetadata("rxjava.kt") public void testRxjava() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/rxjava.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/rxjava.kt"); } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/tests/jsr305") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305") @TestDataPath("$PROJECT_ROOT") public class Jsr305 { @Test public void testAllFilesPresentInJsr305() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/jsr305"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test @TestMetadata("nonNullNever.kt") public void testNonNullNever() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nonNullNever.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nonNullNever.kt"); } @Test @TestMetadata("nullabilityNicknames.kt") public void testNullabilityNicknames() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityNicknames.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityNicknames.kt"); } @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/simple.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/simple.kt"); } @Test @TestMetadata("strange.kt") public void testStrange() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/strange.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/strange.kt"); } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/tests/jsr305/ignore") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/ignore") @TestDataPath("$PROJECT_ROOT") public class Ignore { @Test public void testAllFilesPresentInIgnore() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/jsr305/ignore"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/ignore"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test @TestMetadata("parametersAreNonnullByDefault.kt") public void testParametersAreNonnullByDefault() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/ignore/parametersAreNonnullByDefault.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/ignore/parametersAreNonnullByDefault.kt"); } } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings") @TestDataPath("$PROJECT_ROOT") public class NullabilityWarnings { @Test public void testAllFilesPresentInNullabilityWarnings() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test @TestMetadata("elvis.kt") public void testElvis() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/elvis.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/elvis.kt"); } @Test @TestMetadata("localInference.kt") public void testLocalInference() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/localInference.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/localInference.kt"); } @Test @TestMetadata("nullabilityGenerics.kt") public void testNullabilityGenerics() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/nullabilityGenerics.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/nullabilityGenerics.kt"); } @Test @TestMetadata("nullabilityNicknames.kt") public void testNullabilityNicknames() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/nullabilityNicknames.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/nullabilityNicknames.kt"); } @Test @TestMetadata("safeCalls.kt") public void testSafeCalls() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/safeCalls.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/safeCalls.kt"); } @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/simple.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/simple.kt"); } @Test @TestMetadata("strange.kt") public void testStrange() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/strange.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/strange.kt"); } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes") @TestDataPath("$PROJECT_ROOT") public class FromPlatformTypes { @Test public void testAllFilesPresentInFromPlatformTypes() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test @TestMetadata("arithmetic.kt") public void testArithmetic() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/arithmetic.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/arithmetic.kt"); } @Test @TestMetadata("array.kt") public void testArray() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/array.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/array.kt"); } @Test @TestMetadata("assignToVar.kt") public void testAssignToVar() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/assignToVar.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/assignToVar.kt"); } @Test @TestMetadata("conditions.kt") public void testConditions() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/conditions.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/conditions.kt"); } @Test @TestMetadata("dataFlowInfo.kt") public void testDataFlowInfo() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/dataFlowInfo.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/dataFlowInfo.kt"); } @Test @TestMetadata("defaultParameters.kt") public void testDefaultParameters() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/defaultParameters.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/defaultParameters.kt"); } @Test @TestMetadata("delegatedProperties.kt") public void testDelegatedProperties() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegatedProperties.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegatedProperties.kt"); } @Test @TestMetadata("delegation.kt") public void testDelegation() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegation.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegation.kt"); } @Test @TestMetadata("derefenceExtension.kt") public void testDerefenceExtension() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceExtension.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceExtension.kt"); } @Test @TestMetadata("derefenceMember.kt") public void testDerefenceMember() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceMember.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceMember.kt"); } @Test @TestMetadata("expectedType.kt") public void testExpectedType() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/expectedType.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/expectedType.kt"); } @Test @TestMetadata("for.kt") public void testFor() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/for.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/for.kt"); } @Test @TestMetadata("functionArguments.kt") public void testFunctionArguments() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/functionArguments.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/functionArguments.kt"); } @Test @TestMetadata("invoke.kt") public void testInvoke() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/invoke.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/invoke.kt"); } @Test @TestMetadata("kt6829.kt") public void testKt6829() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/kt6829.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/kt6829.kt"); } @Test @TestMetadata("multiDeclaration.kt") public void testMultiDeclaration() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/multiDeclaration.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/multiDeclaration.kt"); } @Test @TestMetadata("passToJava.kt") public void testPassToJava() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/passToJava.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/passToJava.kt"); } @Test @TestMetadata("primitiveArray.kt") public void testPrimitiveArray() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/primitiveArray.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/primitiveArray.kt"); } @Test @TestMetadata("throw.kt") public void testThrow() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/throw.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/throw.kt"); } @Test @TestMetadata("uselessElvisRightIsNull.kt") public void testUselessElvisRightIsNull() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/uselessElvisRightIsNull.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/uselessElvisRightIsNull.kt"); } } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault") @TestDataPath("$PROJECT_ROOT") public class TypeQualifierDefault { @Test public void testAllFilesPresentInTypeQualifierDefault() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test @TestMetadata("equalsOnNonNull.kt") public void testEqualsOnNonNull() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/equalsOnNonNull.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/equalsOnNonNull.kt"); } @Test @TestMetadata("fieldsAreNullable.kt") public void testFieldsAreNullable() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/fieldsAreNullable.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/fieldsAreNullable.kt"); } @Test @TestMetadata("nullabilityFromOverridden.kt") public void testNullabilityFromOverridden() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/nullabilityFromOverridden.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/nullabilityFromOverridden.kt"); } @Test @TestMetadata("overridingDefaultQualifier.kt") public void testOverridingDefaultQualifier() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/overridingDefaultQualifier.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/overridingDefaultQualifier.kt"); } @Test @TestMetadata("parametersAreNonnullByDefault.kt") public void testParametersAreNonnullByDefault() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefault.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefault.kt"); } @Test @TestMetadata("parametersAreNonnullByDefaultPackage.kt") public void testParametersAreNonnullByDefaultPackage() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefaultPackage.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefaultPackage.kt"); } @Test @TestMetadata("springNullable.kt") public void testSpringNullable() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullable.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullable.kt"); } @Test @TestMetadata("springNullablePackage.kt") public void testSpringNullablePackage() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullablePackage.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullablePackage.kt"); } } } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault") @TestDataPath("$PROJECT_ROOT") public class TypeQualifierDefault { @Test public void testAllFilesPresentInTypeQualifierDefault() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test @TestMetadata("fieldsAreNullable.kt") public void testFieldsAreNullable() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/fieldsAreNullable.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/fieldsAreNullable.kt"); } @Test @TestMetadata("forceFlexibility.kt") public void testForceFlexibility() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/forceFlexibility.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/forceFlexibility.kt"); } @Test @TestMetadata("forceFlexibleOverOverrides.kt") public void testForceFlexibleOverOverrides() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/forceFlexibleOverOverrides.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/forceFlexibleOverOverrides.kt"); } @Test @TestMetadata("nullabilityFromOverridden.kt") public void testNullabilityFromOverridden() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/nullabilityFromOverridden.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/nullabilityFromOverridden.kt"); } @Test @TestMetadata("overridingDefaultQualifier.kt") public void testOverridingDefaultQualifier() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/overridingDefaultQualifier.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/overridingDefaultQualifier.kt"); } @Test @TestMetadata("parametersAreNonnullByDefault.kt") public void testParametersAreNonnullByDefault() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefault.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefault.kt"); } @Test @TestMetadata("parametersAreNonnullByDefaultPackage.kt") public void testParametersAreNonnullByDefaultPackage() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefaultPackage.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefaultPackage.kt"); } @Test @TestMetadata("springNullable.kt") public void testSpringNullable() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/springNullable.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/springNullable.kt"); } @Test @TestMetadata("springNullablePackage.kt") public void testSpringNullablePackage() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/springNullablePackage.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/springNullablePackage.kt"); } } } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings") @TestDataPath("$PROJECT_ROOT") public class Jsr305NullabilityWarnings { @Test public void testAllFilesPresentInJsr305NullabilityWarnings() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration") @TestDataPath("$PROJECT_ROOT") public class Migration { @Test public void testAllFilesPresentInMigration() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test @TestMetadata("customMigration.kt") public void testCustomMigration() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/customMigration.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/customMigration.kt"); } @Test @TestMetadata("globalIgnore.kt") public void testGlobalIgnore() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/globalIgnore.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/globalIgnore.kt"); } @Test @TestMetadata("globalWarningMigrationIgnore.kt") public void testGlobalWarningMigrationIgnore() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/globalWarningMigrationIgnore.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/globalWarningMigrationIgnore.kt"); } @Test @TestMetadata("migrationError.kt") public void testMigrationError() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/migrationError.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/migrationError.kt"); } @Test @TestMetadata("migrationIgnore.kt") public void testMigrationIgnore() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/migrationIgnore.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/migrationIgnore.kt"); } @Test @TestMetadata("migrationWarning.kt") public void testMigrationWarning() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/migrationWarning.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/migrationWarning.kt"); } @Test @TestMetadata("overrideConflicts.kt") public void testOverrideConflicts() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/overrideConflicts.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/overrideConflicts.kt"); } @Test @TestMetadata("specialCollision.kt") public void testSpecialCollision() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/specialCollision.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/specialCollision.kt"); } @Test @TestMetadata("stateRefinement.kt") public void testStateRefinement() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/stateRefinement.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/stateRefinement.kt"); } } } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/tests/typeQualifierDefault") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/tests/typeQualifierDefault") @TestDataPath("$PROJECT_ROOT") public class TypeQualifierDefault { @Test public void testAllFilesPresentInTypeQualifierDefault() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test @TestMetadata("defaultAndNicknameMigrationPolicy.kt") public void testDefaultAndNicknameMigrationPolicy() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/typeQualifierDefault/defaultAndNicknameMigrationPolicy.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/typeQualifierDefault/defaultAndNicknameMigrationPolicy.kt"); } } } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/java8Tests") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests") @TestDataPath("$PROJECT_ROOT") public class Java8Tests { @Test public void testAllFilesPresentInJava8Tests() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/java8Tests"), Pattern.compile("^(.+)\\.kt$"), null, true, "jspecify", "typeEnhancementOnCompiledJava"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test @TestMetadata("checkerFramework.kt") public void testCheckerFramework() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/checkerFramework.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/checkerFramework.kt"); } @Test @TestMetadata("eclipse.kt") public void testEclipse() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/eclipse.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/eclipse.kt"); } @Test @TestMetadata("typeUseOnObject.kt") public void testTypeUseOnObject() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/typeUseOnObject.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeUseOnObject.kt"); } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/java8Tests/jsr305") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify") + @TestDataPath("$PROJECT_ROOT") + public class Jspecify { + @Test + public void testAllFilesPresentInJspecify() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode") + @TestDataPath("$PROJECT_ROOT") + public class StrictMode { + @Test + public void testAllFilesPresentInStrictMode() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("AnnotatedBoundsOfWildcard.kt") + public void testAnnotatedBoundsOfWildcard() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.kt"); + } + + @Test + @TestMetadata("AnnotatedBoundsOfWildcard.fir.kt") + public void testAnnotatedBoundsOfWildcard_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.fir.kt"); + } + + @Test + @TestMetadata("Defaults.kt") + public void testDefaults() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.kt"); + } + + @Test + @TestMetadata("Defaults.fir.kt") + public void testDefaults_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.fir.kt"); + } + + @Test + @TestMetadata("IgnoreAnnotations.kt") + public void testIgnoreAnnotations() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.kt"); + } + + @Test + @TestMetadata("IgnoreAnnotations.fir.kt") + public void testIgnoreAnnotations_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.fir.kt"); + } + + @Test + @TestMetadata("NonPlatformTypeParameter.kt") + public void testNonPlatformTypeParameter() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.kt"); + } + + @Test + @TestMetadata("NonPlatformTypeParameter.fir.kt") + public void testNonPlatformTypeParameter_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.fir.kt"); + } + + @Test + @TestMetadata("NullnessUnspecifiedTypeParameter.kt") + public void testNullnessUnspecifiedTypeParameter() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.kt"); + } + + @Test + @TestMetadata("NullnessUnspecifiedTypeParameter.fir.kt") + public void testNullnessUnspecifiedTypeParameter_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.fir.kt"); + } + + @Test + @TestMetadata("SelfType.kt") + public void testSelfType() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.kt"); + } + + @Test + @TestMetadata("SelfType.fir.kt") + public void testSelfType_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.fir.kt"); + } + + @Test + @TestMetadata("Simple.kt") + public void testSimple() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.kt"); + } + + @Test + @TestMetadata("Simple.fir.kt") + public void testSimple_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.fir.kt"); + } + + @Test + @TestMetadata("TypeArgumentsFromParameterBounds.kt") + public void testTypeArgumentsFromParameterBounds() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.kt"); + } + + @Test + @TestMetadata("TypeArgumentsFromParameterBounds.fir.kt") + public void testTypeArgumentsFromParameterBounds_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.fir.kt"); + } + + @Test + @TestMetadata("TypeParameterBounds.kt") + public void testTypeParameterBounds() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.kt"); + } + + @Test + @TestMetadata("TypeParameterBounds.fir.kt") + public void testTypeParameterBounds_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.fir.kt"); + } + + @Test + @TestMetadata("WildcardsWithDefault.kt") + public void testWildcardsWithDefault() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.kt"); + } + + @Test + @TestMetadata("WildcardsWithDefault.fir.kt") + public void testWildcardsWithDefault_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.fir.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode") + @TestDataPath("$PROJECT_ROOT") + public class WarnMode { + @Test + public void testAllFilesPresentInWarnMode() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("AnnotatedBoundsOfWildcard.kt") + public void testAnnotatedBoundsOfWildcard() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.kt"); + } + + @Test + @TestMetadata("AnnotatedBoundsOfWildcard.fir.kt") + public void testAnnotatedBoundsOfWildcard_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.fir.kt"); + } + + @Test + @TestMetadata("Defaults.kt") + public void testDefaults() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Defaults.kt"); + } + + @Test + @TestMetadata("Defaults.fir.kt") + public void testDefaults_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Defaults.fir.kt"); + } + + @Test + @TestMetadata("IgnoreAnnotations.kt") + public void testIgnoreAnnotations() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.kt"); + } + + @Test + @TestMetadata("IgnoreAnnotations.fir.kt") + public void testIgnoreAnnotations_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.fir.kt"); + } + + @Test + @TestMetadata("NonPlatformTypeParameter.kt") + public void testNonPlatformTypeParameter() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.kt"); + } + + @Test + @TestMetadata("NonPlatformTypeParameter.fir.kt") + public void testNonPlatformTypeParameter_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.fir.kt"); + } + + @Test + @TestMetadata("NullnessUnspecifiedTypeParameter.kt") + public void testNullnessUnspecifiedTypeParameter() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.kt"); + } + + @Test + @TestMetadata("NullnessUnspecifiedTypeParameter.fir.kt") + public void testNullnessUnspecifiedTypeParameter_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.fir.kt"); + } + + @Test + @TestMetadata("SelfType.kt") + public void testSelfType() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.kt"); + } + + @Test + @TestMetadata("SelfType.fir.kt") + public void testSelfType_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.fir.kt"); + } + + @Test + @TestMetadata("Simple.kt") + public void testSimple() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.kt"); + } + + @Test + @TestMetadata("Simple.fir.kt") + public void testSimple_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.fir.kt"); + } + + @Test + @TestMetadata("TypeArgumentsFromParameterBounds.kt") + public void testTypeArgumentsFromParameterBounds() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.kt"); + } + + @Test + @TestMetadata("TypeArgumentsFromParameterBounds.fir.kt") + public void testTypeArgumentsFromParameterBounds_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.fir.kt"); + } + + @Test + @TestMetadata("TypeParameterBounds.kt") + public void testTypeParameterBounds() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.kt"); + } + + @Test + @TestMetadata("TypeParameterBounds.fir.kt") + public void testTypeParameterBounds_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.fir.kt"); + } + + @Test + @TestMetadata("WildcardsWithDefault.kt") + public void testWildcardsWithDefault() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.kt"); + } + + @Test + @TestMetadata("WildcardsWithDefault.fir.kt") + public void testWildcardsWithDefault_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.fir.kt"); + } + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305") @TestDataPath("$PROJECT_ROOT") public class Jsr305 { @Test public void testAllFilesPresentInJsr305() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/java8Tests/jsr305"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test @TestMetadata("defaultAnnotationAppliedToType.kt") public void testDefaultAnnotationAppliedToType() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/jsr305/defaultAnnotationAppliedToType.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/defaultAnnotationAppliedToType.kt"); } @Test @TestMetadata("defaultAnnotationAppliedToTypeForCompiledJava.kt") public void testDefaultAnnotationAppliedToTypeForCompiledJava() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/jsr305/defaultAnnotationAppliedToTypeForCompiledJava.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/defaultAnnotationAppliedToTypeForCompiledJava.kt"); } @Test @TestMetadata("springNullableWithTypeUse.kt") public void testSpringNullableWithTypeUse() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/jsr305/springNullableWithTypeUse.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/springNullableWithTypeUse.kt"); } @Test @TestMetadata("typeArguments.kt") public void testTypeArguments() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/jsr305/typeArguments.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/typeArguments.kt"); } @Test @TestMetadata("typeUseVsMethodConflict.kt") public void testTypeUseVsMethodConflict() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/jsr305/typeUseVsMethodConflict.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/typeUseVsMethodConflict.kt"); } } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/java8Tests/typeEnhancement") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement") @TestDataPath("$PROJECT_ROOT") public class TypeEnhancement { @Test public void testAllFilesPresentInTypeEnhancement() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/java8Tests/typeEnhancement"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled") + @TestDataPath("$PROJECT_ROOT") + public class OnCompiled { + @Test + public void testAllFilesPresentInOnCompiled() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("classTypeParameterBound.kt") + public void testClassTypeParameterBound() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/classTypeParameterBound.kt"); + } + + @Test + @TestMetadata("classTypeParameterBoundWithWarnings.kt") + public void testClassTypeParameterBoundWithWarnings() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/classTypeParameterBoundWithWarnings.kt"); + } + + @Test + @TestMetadata("classTypeParameterBoundWithWarnings.fir.kt") + public void testClassTypeParameterBoundWithWarnings_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/classTypeParameterBoundWithWarnings.fir.kt"); + } + + @Test + @TestMetadata("classTypeParameterBound.fir.kt") + public void testClassTypeParameterBound_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/classTypeParameterBound.fir.kt"); + } + + @Test + @TestMetadata("returnType.kt") + public void testReturnType() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/returnType.kt"); + } + + @Test + @TestMetadata("returnTypeWithWarnings.kt") + public void testReturnTypeWithWarnings() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/returnTypeWithWarnings.kt"); + } + + @Test + @TestMetadata("returnTypeWithWarnings.fir.kt") + public void testReturnTypeWithWarnings_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/returnTypeWithWarnings.fir.kt"); + } + + @Test + @TestMetadata("returnType.fir.kt") + public void testReturnType_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/returnType.fir.kt"); + } + + @Test + @TestMetadata("valueParameter.kt") + public void testValueParameter() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/valueParameter.kt"); + } + + @Test + @TestMetadata("valueParameterWithWarnings.kt") + public void testValueParameterWithWarnings() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/valueParameterWithWarnings.kt"); + } + + @Test + @TestMetadata("valueParameterWithWarnings.fir.kt") + public void testValueParameterWithWarnings_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/valueParameterWithWarnings.fir.kt"); + } + + @Test + @TestMetadata("valueParameter.fir.kt") + public void testValueParameter_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/valueParameter.fir.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources") + @TestDataPath("$PROJECT_ROOT") + public class OnSources { + @Test + public void testAllFilesPresentInOnSources() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("annotatedTypeArguments.kt") + public void testAnnotatedTypeArguments() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/annotatedTypeArguments.kt"); + } + + @Test + @TestMetadata("annotatedTypeArguments.fir.kt") + public void testAnnotatedTypeArguments_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/annotatedTypeArguments.fir.kt"); + } + + @Test + @TestMetadata("methodWithTypeParameter.kt") + public void testMethodWithTypeParameter() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/methodWithTypeParameter.kt"); + } + + @Test + @TestMetadata("methodWithTypeParameter.fir.kt") + public void testMethodWithTypeParameter_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/methodWithTypeParameter.fir.kt"); + } + + @Test + @TestMetadata("notNullVarargsOverrides.kt") + public void testNotNullVarargsOverrides() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/notNullVarargsOverrides.kt"); + } + + @Test + @TestMetadata("notNullVarargsOverrides.fir.kt") + public void testNotNullVarargsOverrides_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/notNullVarargsOverrides.fir.kt"); + } + + @Test + @TestMetadata("nullableVarargsOverrides.kt") + public void testNullableVarargsOverrides() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/nullableVarargsOverrides.kt"); + } + + @Test + @TestMetadata("nullableVarargsOverrides.fir.kt") + public void testNullableVarargsOverrides_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/nullableVarargsOverrides.fir.kt"); + } + + @Test + @TestMetadata("returnTypeDifferentConstructor.kt") + public void testReturnTypeDifferentConstructor() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeDifferentConstructor.kt"); + } + + @Test + @TestMetadata("returnTypeDifferentConstructor.fir.kt") + public void testReturnTypeDifferentConstructor_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeDifferentConstructor.fir.kt"); + } + + @Test + @TestMetadata("returnTypeOverrideInKotlin.kt") + public void testReturnTypeOverrideInKotlin() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeOverrideInKotlin.kt"); + } + + @Test + @TestMetadata("returnTypeOverrideInKotlin.fir.kt") + public void testReturnTypeOverrideInKotlin_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeOverrideInKotlin.fir.kt"); + } + + @Test + @TestMetadata("simple.kt") + public void testSimple() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/simple.kt"); + } + + @Test + @TestMetadata("simple.fir.kt") + public void testSimple_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/simple.fir.kt"); + } + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava") + @TestDataPath("$PROJECT_ROOT") + public class TypeEnhancementOnCompiledJava { + @Test + public void testAllFilesPresentInTypeEnhancementOnCompiledJava() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test - @TestMetadata("annotatedTypeArguments.kt") - public void testAnnotatedTypeArguments() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/annotatedTypeArguments.kt"); + @TestMetadata("ClassTypeParameterBound.kt") + public void testClassTypeParameterBound() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ClassTypeParameterBound.kt"); } @Test - @TestMetadata("methodWithTypeParameter.kt") - public void testMethodWithTypeParameter() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/methodWithTypeParameter.kt"); + @TestMetadata("ClassTypeParameterBoundWithWarnings.kt") + public void testClassTypeParameterBoundWithWarnings() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ClassTypeParameterBoundWithWarnings.kt"); } @Test - @TestMetadata("notNullVarargsOverrides.kt") - public void testNotNullVarargsOverrides() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/notNullVarargsOverrides.kt"); + @TestMetadata("ReturnType.kt") + public void testReturnType() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ReturnType.kt"); } @Test - @TestMetadata("nullableVarargsOverrides.kt") - public void testNullableVarargsOverrides() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/nullableVarargsOverrides.kt"); + @TestMetadata("ReturnTypeWithWarnings.kt") + public void testReturnTypeWithWarnings() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ReturnTypeWithWarnings.kt"); } @Test - @TestMetadata("returnTypeDifferentConstructor.kt") - public void testReturnTypeDifferentConstructor() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/returnTypeDifferentConstructor.kt"); + @TestMetadata("ValueParameter.kt") + public void testValueParameter() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ValueParameter.kt"); } @Test - @TestMetadata("returnTypeOverrideInKotlin.kt") - public void testReturnTypeOverrideInKotlin() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/returnTypeOverrideInKotlin.kt"); - } - - @Test - @TestMetadata("simple.kt") - public void testSimple() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/simple.kt"); + @TestMetadata("ValueParameterWithWarnings.kt") + public void testValueParameterWithWarnings() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ValueParameterWithWarnings.kt"); } } } diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ForeignAnnotationsTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ForeignAnnotationsTestGenerated.java index f61c9fb498a..f24c95a5ca6 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ForeignAnnotationsTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ForeignAnnotationsTestGenerated.java @@ -18,641 +18,1091 @@ import java.util.regex.Pattern; @SuppressWarnings("all") public class ForeignAnnotationsTestGenerated extends AbstractForeignAnnotationsTest { @Nested - @TestMetadata("compiler/testData/foreignAnnotations/tests") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/tests") @TestDataPath("$PROJECT_ROOT") public class Tests { @Test public void testAllFilesPresentInTests() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/tests"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test @TestMetadata("androidRecently.kt") public void testAndroidRecently() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/androidRecently.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/androidRecently.kt"); } @Test @TestMetadata("androidSdk.kt") public void testAndroidSdk() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/androidSdk.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/androidSdk.kt"); } @Test @TestMetadata("android_support.kt") public void testAndroid_support() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/android_support.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/android_support.kt"); } @Test @TestMetadata("androidx.kt") public void testAndroidx() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/androidx.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/androidx.kt"); } @Test @TestMetadata("aosp.kt") public void testAosp() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/aosp.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/aosp.kt"); } @Test @TestMetadata("checkerFramework.kt") public void testCheckerFramework() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/checkerFramework.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/checkerFramework.kt"); } @Test @TestMetadata("eclipse.kt") public void testEclipse() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/eclipse.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/eclipse.kt"); } @Test @TestMetadata("findBugsSimple.kt") public void testFindBugsSimple() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/findBugsSimple.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/findBugsSimple.kt"); } @Test @TestMetadata("irrelevantQualifierNicknames.kt") public void testIrrelevantQualifierNicknames() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/irrelevantQualifierNicknames.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/irrelevantQualifierNicknames.kt"); } @Test @TestMetadata("lombokSimple.kt") public void testLombokSimple() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/lombokSimple.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/lombokSimple.kt"); } @Test @TestMetadata("rxjava.kt") public void testRxjava() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/rxjava.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/rxjava.kt"); } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/tests/jsr305") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305") @TestDataPath("$PROJECT_ROOT") public class Jsr305 { @Test public void testAllFilesPresentInJsr305() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/jsr305"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test @TestMetadata("nonNullNever.kt") public void testNonNullNever() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nonNullNever.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nonNullNever.kt"); } @Test @TestMetadata("nullabilityNicknames.kt") public void testNullabilityNicknames() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityNicknames.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityNicknames.kt"); } @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/simple.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/simple.kt"); } @Test @TestMetadata("strange.kt") public void testStrange() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/strange.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/strange.kt"); } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/tests/jsr305/ignore") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/ignore") @TestDataPath("$PROJECT_ROOT") public class Ignore { @Test public void testAllFilesPresentInIgnore() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/jsr305/ignore"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/ignore"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test @TestMetadata("parametersAreNonnullByDefault.kt") public void testParametersAreNonnullByDefault() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/ignore/parametersAreNonnullByDefault.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/ignore/parametersAreNonnullByDefault.kt"); } } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings") @TestDataPath("$PROJECT_ROOT") public class NullabilityWarnings { @Test public void testAllFilesPresentInNullabilityWarnings() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test @TestMetadata("elvis.kt") public void testElvis() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/elvis.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/elvis.kt"); } @Test @TestMetadata("localInference.kt") public void testLocalInference() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/localInference.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/localInference.kt"); } @Test @TestMetadata("nullabilityGenerics.kt") public void testNullabilityGenerics() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/nullabilityGenerics.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/nullabilityGenerics.kt"); } @Test @TestMetadata("nullabilityNicknames.kt") public void testNullabilityNicknames() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/nullabilityNicknames.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/nullabilityNicknames.kt"); } @Test @TestMetadata("safeCalls.kt") public void testSafeCalls() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/safeCalls.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/safeCalls.kt"); } @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/simple.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/simple.kt"); } @Test @TestMetadata("strange.kt") public void testStrange() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/strange.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/strange.kt"); } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes") @TestDataPath("$PROJECT_ROOT") public class FromPlatformTypes { @Test public void testAllFilesPresentInFromPlatformTypes() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test @TestMetadata("arithmetic.kt") public void testArithmetic() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/arithmetic.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/arithmetic.kt"); } @Test @TestMetadata("array.kt") public void testArray() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/array.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/array.kt"); } @Test @TestMetadata("assignToVar.kt") public void testAssignToVar() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/assignToVar.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/assignToVar.kt"); } @Test @TestMetadata("conditions.kt") public void testConditions() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/conditions.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/conditions.kt"); } @Test @TestMetadata("dataFlowInfo.kt") public void testDataFlowInfo() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/dataFlowInfo.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/dataFlowInfo.kt"); } @Test @TestMetadata("defaultParameters.kt") public void testDefaultParameters() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/defaultParameters.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/defaultParameters.kt"); } @Test @TestMetadata("delegatedProperties.kt") public void testDelegatedProperties() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegatedProperties.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegatedProperties.kt"); } @Test @TestMetadata("delegation.kt") public void testDelegation() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegation.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/delegation.kt"); } @Test @TestMetadata("derefenceExtension.kt") public void testDerefenceExtension() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceExtension.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceExtension.kt"); } @Test @TestMetadata("derefenceMember.kt") public void testDerefenceMember() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceMember.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/derefenceMember.kt"); } @Test @TestMetadata("expectedType.kt") public void testExpectedType() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/expectedType.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/expectedType.kt"); } @Test @TestMetadata("for.kt") public void testFor() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/for.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/for.kt"); } @Test @TestMetadata("functionArguments.kt") public void testFunctionArguments() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/functionArguments.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/functionArguments.kt"); } @Test @TestMetadata("invoke.kt") public void testInvoke() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/invoke.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/invoke.kt"); } @Test @TestMetadata("kt6829.kt") public void testKt6829() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/kt6829.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/kt6829.kt"); } @Test @TestMetadata("multiDeclaration.kt") public void testMultiDeclaration() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/multiDeclaration.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/multiDeclaration.kt"); } @Test @TestMetadata("passToJava.kt") public void testPassToJava() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/passToJava.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/passToJava.kt"); } @Test @TestMetadata("primitiveArray.kt") public void testPrimitiveArray() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/primitiveArray.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/primitiveArray.kt"); } @Test @TestMetadata("throw.kt") public void testThrow() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/throw.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/throw.kt"); } @Test @TestMetadata("uselessElvisRightIsNull.kt") public void testUselessElvisRightIsNull() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/fromPlatformTypes/uselessElvisRightIsNull.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/fromPlatformTypes/uselessElvisRightIsNull.kt"); } } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault") @TestDataPath("$PROJECT_ROOT") public class TypeQualifierDefault { @Test public void testAllFilesPresentInTypeQualifierDefault() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test @TestMetadata("equalsOnNonNull.kt") public void testEqualsOnNonNull() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/equalsOnNonNull.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/equalsOnNonNull.kt"); } @Test @TestMetadata("fieldsAreNullable.kt") public void testFieldsAreNullable() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/fieldsAreNullable.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/fieldsAreNullable.kt"); } @Test @TestMetadata("nullabilityFromOverridden.kt") public void testNullabilityFromOverridden() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/nullabilityFromOverridden.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/nullabilityFromOverridden.kt"); } @Test @TestMetadata("overridingDefaultQualifier.kt") public void testOverridingDefaultQualifier() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/overridingDefaultQualifier.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/overridingDefaultQualifier.kt"); } @Test @TestMetadata("parametersAreNonnullByDefault.kt") public void testParametersAreNonnullByDefault() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefault.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefault.kt"); } @Test @TestMetadata("parametersAreNonnullByDefaultPackage.kt") public void testParametersAreNonnullByDefaultPackage() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefaultPackage.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/parametersAreNonnullByDefaultPackage.kt"); } @Test @TestMetadata("springNullable.kt") public void testSpringNullable() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullable.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullable.kt"); } @Test @TestMetadata("springNullablePackage.kt") public void testSpringNullablePackage() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullablePackage.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullablePackage.kt"); } } } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault") @TestDataPath("$PROJECT_ROOT") public class TypeQualifierDefault { @Test public void testAllFilesPresentInTypeQualifierDefault() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test @TestMetadata("fieldsAreNullable.kt") public void testFieldsAreNullable() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/fieldsAreNullable.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/fieldsAreNullable.kt"); } @Test @TestMetadata("forceFlexibility.kt") public void testForceFlexibility() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/forceFlexibility.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/forceFlexibility.kt"); } @Test @TestMetadata("forceFlexibleOverOverrides.kt") public void testForceFlexibleOverOverrides() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/forceFlexibleOverOverrides.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/forceFlexibleOverOverrides.kt"); } @Test @TestMetadata("nullabilityFromOverridden.kt") public void testNullabilityFromOverridden() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/nullabilityFromOverridden.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/nullabilityFromOverridden.kt"); } @Test @TestMetadata("overridingDefaultQualifier.kt") public void testOverridingDefaultQualifier() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/overridingDefaultQualifier.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/overridingDefaultQualifier.kt"); } @Test @TestMetadata("parametersAreNonnullByDefault.kt") public void testParametersAreNonnullByDefault() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefault.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefault.kt"); } @Test @TestMetadata("parametersAreNonnullByDefaultPackage.kt") public void testParametersAreNonnullByDefaultPackage() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefaultPackage.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/parametersAreNonnullByDefaultPackage.kt"); } @Test @TestMetadata("springNullable.kt") public void testSpringNullable() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/springNullable.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/springNullable.kt"); } @Test @TestMetadata("springNullablePackage.kt") public void testSpringNullablePackage() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305/typeQualifierDefault/springNullablePackage.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305/typeQualifierDefault/springNullablePackage.kt"); } } } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings") @TestDataPath("$PROJECT_ROOT") public class Jsr305NullabilityWarnings { @Test public void testAllFilesPresentInJsr305NullabilityWarnings() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration") @TestDataPath("$PROJECT_ROOT") public class Migration { @Test public void testAllFilesPresentInMigration() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test @TestMetadata("customMigration.kt") public void testCustomMigration() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/customMigration.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/customMigration.kt"); } @Test @TestMetadata("globalIgnore.kt") public void testGlobalIgnore() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/globalIgnore.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/globalIgnore.kt"); } @Test @TestMetadata("globalWarningMigrationIgnore.kt") public void testGlobalWarningMigrationIgnore() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/globalWarningMigrationIgnore.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/globalWarningMigrationIgnore.kt"); } @Test @TestMetadata("migrationError.kt") public void testMigrationError() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/migrationError.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/migrationError.kt"); } @Test @TestMetadata("migrationIgnore.kt") public void testMigrationIgnore() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/migrationIgnore.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/migrationIgnore.kt"); } @Test @TestMetadata("migrationWarning.kt") public void testMigrationWarning() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/migrationWarning.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/migrationWarning.kt"); } @Test @TestMetadata("overrideConflicts.kt") public void testOverrideConflicts() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/overrideConflicts.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/overrideConflicts.kt"); } @Test @TestMetadata("specialCollision.kt") public void testSpecialCollision() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/specialCollision.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/specialCollision.kt"); } @Test @TestMetadata("stateRefinement.kt") public void testStateRefinement() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/jsr305NullabilityWarnings/migration/stateRefinement.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/jsr305NullabilityWarnings/migration/stateRefinement.kt"); } } } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/tests/typeQualifierDefault") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/tests/typeQualifierDefault") @TestDataPath("$PROJECT_ROOT") public class TypeQualifierDefault { @Test public void testAllFilesPresentInTypeQualifierDefault() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/tests/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/tests/typeQualifierDefault"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test @TestMetadata("defaultAndNicknameMigrationPolicy.kt") public void testDefaultAndNicknameMigrationPolicy() throws Exception { - runTest("compiler/testData/foreignAnnotations/tests/typeQualifierDefault/defaultAndNicknameMigrationPolicy.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/tests/typeQualifierDefault/defaultAndNicknameMigrationPolicy.kt"); } } } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/java8Tests") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests") @TestDataPath("$PROJECT_ROOT") public class Java8Tests { @Test public void testAllFilesPresentInJava8Tests() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/java8Tests"), Pattern.compile("^(.+)\\.kt$"), null, true, "jspecify", "typeEnhancementOnCompiledJava"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test @TestMetadata("checkerFramework.kt") public void testCheckerFramework() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/checkerFramework.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/checkerFramework.kt"); } @Test @TestMetadata("eclipse.kt") public void testEclipse() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/eclipse.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/eclipse.kt"); } @Test @TestMetadata("typeUseOnObject.kt") public void testTypeUseOnObject() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/typeUseOnObject.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeUseOnObject.kt"); } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/java8Tests/jsr305") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify") + @TestDataPath("$PROJECT_ROOT") + public class Jspecify { + @Test + public void testAllFilesPresentInJspecify() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode") + @TestDataPath("$PROJECT_ROOT") + public class StrictMode { + @Test + public void testAllFilesPresentInStrictMode() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("AnnotatedBoundsOfWildcard.kt") + public void testAnnotatedBoundsOfWildcard() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.kt"); + } + + @Test + @TestMetadata("AnnotatedBoundsOfWildcard.fir.kt") + public void testAnnotatedBoundsOfWildcard_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.fir.kt"); + } + + @Test + @TestMetadata("Defaults.kt") + public void testDefaults() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.kt"); + } + + @Test + @TestMetadata("Defaults.fir.kt") + public void testDefaults_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Defaults.fir.kt"); + } + + @Test + @TestMetadata("IgnoreAnnotations.kt") + public void testIgnoreAnnotations() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.kt"); + } + + @Test + @TestMetadata("IgnoreAnnotations.fir.kt") + public void testIgnoreAnnotations_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/IgnoreAnnotations.fir.kt"); + } + + @Test + @TestMetadata("NonPlatformTypeParameter.kt") + public void testNonPlatformTypeParameter() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.kt"); + } + + @Test + @TestMetadata("NonPlatformTypeParameter.fir.kt") + public void testNonPlatformTypeParameter_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NonPlatformTypeParameter.fir.kt"); + } + + @Test + @TestMetadata("NullnessUnspecifiedTypeParameter.kt") + public void testNullnessUnspecifiedTypeParameter() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.kt"); + } + + @Test + @TestMetadata("NullnessUnspecifiedTypeParameter.fir.kt") + public void testNullnessUnspecifiedTypeParameter_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/NullnessUnspecifiedTypeParameter.fir.kt"); + } + + @Test + @TestMetadata("SelfType.kt") + public void testSelfType() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.kt"); + } + + @Test + @TestMetadata("SelfType.fir.kt") + public void testSelfType_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/SelfType.fir.kt"); + } + + @Test + @TestMetadata("Simple.kt") + public void testSimple() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.kt"); + } + + @Test + @TestMetadata("Simple.fir.kt") + public void testSimple_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/Simple.fir.kt"); + } + + @Test + @TestMetadata("TypeArgumentsFromParameterBounds.kt") + public void testTypeArgumentsFromParameterBounds() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.kt"); + } + + @Test + @TestMetadata("TypeArgumentsFromParameterBounds.fir.kt") + public void testTypeArgumentsFromParameterBounds_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeArgumentsFromParameterBounds.fir.kt"); + } + + @Test + @TestMetadata("TypeParameterBounds.kt") + public void testTypeParameterBounds() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.kt"); + } + + @Test + @TestMetadata("TypeParameterBounds.fir.kt") + public void testTypeParameterBounds_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/TypeParameterBounds.fir.kt"); + } + + @Test + @TestMetadata("WildcardsWithDefault.kt") + public void testWildcardsWithDefault() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.kt"); + } + + @Test + @TestMetadata("WildcardsWithDefault.fir.kt") + public void testWildcardsWithDefault_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.fir.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode") + @TestDataPath("$PROJECT_ROOT") + public class WarnMode { + @Test + public void testAllFilesPresentInWarnMode() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("AnnotatedBoundsOfWildcard.kt") + public void testAnnotatedBoundsOfWildcard() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.kt"); + } + + @Test + @TestMetadata("AnnotatedBoundsOfWildcard.fir.kt") + public void testAnnotatedBoundsOfWildcard_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.fir.kt"); + } + + @Test + @TestMetadata("Defaults.kt") + public void testDefaults() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Defaults.kt"); + } + + @Test + @TestMetadata("Defaults.fir.kt") + public void testDefaults_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Defaults.fir.kt"); + } + + @Test + @TestMetadata("IgnoreAnnotations.kt") + public void testIgnoreAnnotations() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.kt"); + } + + @Test + @TestMetadata("IgnoreAnnotations.fir.kt") + public void testIgnoreAnnotations_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/IgnoreAnnotations.fir.kt"); + } + + @Test + @TestMetadata("NonPlatformTypeParameter.kt") + public void testNonPlatformTypeParameter() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.kt"); + } + + @Test + @TestMetadata("NonPlatformTypeParameter.fir.kt") + public void testNonPlatformTypeParameter_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NonPlatformTypeParameter.fir.kt"); + } + + @Test + @TestMetadata("NullnessUnspecifiedTypeParameter.kt") + public void testNullnessUnspecifiedTypeParameter() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.kt"); + } + + @Test + @TestMetadata("NullnessUnspecifiedTypeParameter.fir.kt") + public void testNullnessUnspecifiedTypeParameter_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/NullnessUnspecifiedTypeParameter.fir.kt"); + } + + @Test + @TestMetadata("SelfType.kt") + public void testSelfType() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.kt"); + } + + @Test + @TestMetadata("SelfType.fir.kt") + public void testSelfType_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/SelfType.fir.kt"); + } + + @Test + @TestMetadata("Simple.kt") + public void testSimple() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.kt"); + } + + @Test + @TestMetadata("Simple.fir.kt") + public void testSimple_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/Simple.fir.kt"); + } + + @Test + @TestMetadata("TypeArgumentsFromParameterBounds.kt") + public void testTypeArgumentsFromParameterBounds() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.kt"); + } + + @Test + @TestMetadata("TypeArgumentsFromParameterBounds.fir.kt") + public void testTypeArgumentsFromParameterBounds_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeArgumentsFromParameterBounds.fir.kt"); + } + + @Test + @TestMetadata("TypeParameterBounds.kt") + public void testTypeParameterBounds() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.kt"); + } + + @Test + @TestMetadata("TypeParameterBounds.fir.kt") + public void testTypeParameterBounds_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/TypeParameterBounds.fir.kt"); + } + + @Test + @TestMetadata("WildcardsWithDefault.kt") + public void testWildcardsWithDefault() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.kt"); + } + + @Test + @TestMetadata("WildcardsWithDefault.fir.kt") + public void testWildcardsWithDefault_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.fir.kt"); + } + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305") @TestDataPath("$PROJECT_ROOT") public class Jsr305 { @Test public void testAllFilesPresentInJsr305() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/java8Tests/jsr305"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test @TestMetadata("defaultAnnotationAppliedToType.kt") public void testDefaultAnnotationAppliedToType() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/jsr305/defaultAnnotationAppliedToType.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/defaultAnnotationAppliedToType.kt"); } @Test @TestMetadata("defaultAnnotationAppliedToTypeForCompiledJava.kt") public void testDefaultAnnotationAppliedToTypeForCompiledJava() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/jsr305/defaultAnnotationAppliedToTypeForCompiledJava.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/defaultAnnotationAppliedToTypeForCompiledJava.kt"); } @Test @TestMetadata("springNullableWithTypeUse.kt") public void testSpringNullableWithTypeUse() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/jsr305/springNullableWithTypeUse.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/springNullableWithTypeUse.kt"); } @Test @TestMetadata("typeArguments.kt") public void testTypeArguments() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/jsr305/typeArguments.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/typeArguments.kt"); } @Test @TestMetadata("typeUseVsMethodConflict.kt") public void testTypeUseVsMethodConflict() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/jsr305/typeUseVsMethodConflict.kt"); + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jsr305/typeUseVsMethodConflict.kt"); } } @Nested - @TestMetadata("compiler/testData/foreignAnnotations/java8Tests/typeEnhancement") + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement") @TestDataPath("$PROJECT_ROOT") public class TypeEnhancement { @Test public void testAllFilesPresentInTypeEnhancement() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/java8Tests/typeEnhancement"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled") + @TestDataPath("$PROJECT_ROOT") + public class OnCompiled { + @Test + public void testAllFilesPresentInOnCompiled() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("classTypeParameterBound.kt") + public void testClassTypeParameterBound() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/classTypeParameterBound.kt"); + } + + @Test + @TestMetadata("classTypeParameterBoundWithWarnings.kt") + public void testClassTypeParameterBoundWithWarnings() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/classTypeParameterBoundWithWarnings.kt"); + } + + @Test + @TestMetadata("classTypeParameterBoundWithWarnings.fir.kt") + public void testClassTypeParameterBoundWithWarnings_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/classTypeParameterBoundWithWarnings.fir.kt"); + } + + @Test + @TestMetadata("classTypeParameterBound.fir.kt") + public void testClassTypeParameterBound_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/classTypeParameterBound.fir.kt"); + } + + @Test + @TestMetadata("returnType.kt") + public void testReturnType() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/returnType.kt"); + } + + @Test + @TestMetadata("returnTypeWithWarnings.kt") + public void testReturnTypeWithWarnings() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/returnTypeWithWarnings.kt"); + } + + @Test + @TestMetadata("returnTypeWithWarnings.fir.kt") + public void testReturnTypeWithWarnings_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/returnTypeWithWarnings.fir.kt"); + } + + @Test + @TestMetadata("returnType.fir.kt") + public void testReturnType_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/returnType.fir.kt"); + } + + @Test + @TestMetadata("valueParameter.kt") + public void testValueParameter() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/valueParameter.kt"); + } + + @Test + @TestMetadata("valueParameterWithWarnings.kt") + public void testValueParameterWithWarnings() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/valueParameterWithWarnings.kt"); + } + + @Test + @TestMetadata("valueParameterWithWarnings.fir.kt") + public void testValueParameterWithWarnings_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/valueParameterWithWarnings.fir.kt"); + } + + @Test + @TestMetadata("valueParameter.fir.kt") + public void testValueParameter_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onCompiled/valueParameter.fir.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources") + @TestDataPath("$PROJECT_ROOT") + public class OnSources { + @Test + public void testAllFilesPresentInOnSources() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("annotatedTypeArguments.kt") + public void testAnnotatedTypeArguments() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/annotatedTypeArguments.kt"); + } + + @Test + @TestMetadata("annotatedTypeArguments.fir.kt") + public void testAnnotatedTypeArguments_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/annotatedTypeArguments.fir.kt"); + } + + @Test + @TestMetadata("methodWithTypeParameter.kt") + public void testMethodWithTypeParameter() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/methodWithTypeParameter.kt"); + } + + @Test + @TestMetadata("methodWithTypeParameter.fir.kt") + public void testMethodWithTypeParameter_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/methodWithTypeParameter.fir.kt"); + } + + @Test + @TestMetadata("notNullVarargsOverrides.kt") + public void testNotNullVarargsOverrides() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/notNullVarargsOverrides.kt"); + } + + @Test + @TestMetadata("notNullVarargsOverrides.fir.kt") + public void testNotNullVarargsOverrides_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/notNullVarargsOverrides.fir.kt"); + } + + @Test + @TestMetadata("nullableVarargsOverrides.kt") + public void testNullableVarargsOverrides() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/nullableVarargsOverrides.kt"); + } + + @Test + @TestMetadata("nullableVarargsOverrides.fir.kt") + public void testNullableVarargsOverrides_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/nullableVarargsOverrides.fir.kt"); + } + + @Test + @TestMetadata("returnTypeDifferentConstructor.kt") + public void testReturnTypeDifferentConstructor() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeDifferentConstructor.kt"); + } + + @Test + @TestMetadata("returnTypeDifferentConstructor.fir.kt") + public void testReturnTypeDifferentConstructor_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeDifferentConstructor.fir.kt"); + } + + @Test + @TestMetadata("returnTypeOverrideInKotlin.kt") + public void testReturnTypeOverrideInKotlin() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeOverrideInKotlin.kt"); + } + + @Test + @TestMetadata("returnTypeOverrideInKotlin.fir.kt") + public void testReturnTypeOverrideInKotlin_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/returnTypeOverrideInKotlin.fir.kt"); + } + + @Test + @TestMetadata("simple.kt") + public void testSimple() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/simple.kt"); + } + + @Test + @TestMetadata("simple.fir.kt") + public void testSimple_fir() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancement/onSources/simple.fir.kt"); + } + } + } + + @Nested + @TestMetadata("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava") + @TestDataPath("$PROJECT_ROOT") + public class TypeEnhancementOnCompiledJava { + @Test + public void testAllFilesPresentInTypeEnhancementOnCompiledJava() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava"), Pattern.compile("^(.+)\\.kt$"), null, true); } @Test - @TestMetadata("annotatedTypeArguments.kt") - public void testAnnotatedTypeArguments() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/annotatedTypeArguments.kt"); + @TestMetadata("ClassTypeParameterBound.kt") + public void testClassTypeParameterBound() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ClassTypeParameterBound.kt"); } @Test - @TestMetadata("methodWithTypeParameter.kt") - public void testMethodWithTypeParameter() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/methodWithTypeParameter.kt"); + @TestMetadata("ClassTypeParameterBoundWithWarnings.kt") + public void testClassTypeParameterBoundWithWarnings() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ClassTypeParameterBoundWithWarnings.kt"); } @Test - @TestMetadata("notNullVarargsOverrides.kt") - public void testNotNullVarargsOverrides() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/notNullVarargsOverrides.kt"); + @TestMetadata("ReturnType.kt") + public void testReturnType() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ReturnType.kt"); } @Test - @TestMetadata("nullableVarargsOverrides.kt") - public void testNullableVarargsOverrides() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/nullableVarargsOverrides.kt"); + @TestMetadata("ReturnTypeWithWarnings.kt") + public void testReturnTypeWithWarnings() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ReturnTypeWithWarnings.kt"); } @Test - @TestMetadata("returnTypeDifferentConstructor.kt") - public void testReturnTypeDifferentConstructor() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/returnTypeDifferentConstructor.kt"); + @TestMetadata("ValueParameter.kt") + public void testValueParameter() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ValueParameter.kt"); } @Test - @TestMetadata("returnTypeOverrideInKotlin.kt") - public void testReturnTypeOverrideInKotlin() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/returnTypeOverrideInKotlin.kt"); - } - - @Test - @TestMetadata("simple.kt") - public void testSimple() throws Exception { - runTest("compiler/testData/foreignAnnotations/java8Tests/typeEnhancement/simple.kt"); + @TestMetadata("ValueParameterWithWarnings.kt") + public void testValueParameterWithWarnings() throws Exception { + runTest("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/typeEnhancementOnCompiledJava/ValueParameterWithWarnings.kt"); } } } diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/ForeignAnnotationsDirectives.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/ForeignAnnotationsDirectives.kt index 7f1839c8e3e..495ad835c76 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/ForeignAnnotationsDirectives.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/ForeignAnnotationsDirectives.kt @@ -6,7 +6,7 @@ package org.jetbrains.kotlin.test.directives import org.jetbrains.kotlin.test.directives.model.SimpleDirectivesContainer -import org.jetbrains.kotlin.test.services.configuration.JdkForeignAnnotationType +import org.jetbrains.kotlin.test.services.configuration.JavaForeignAnnotationType import org.jetbrains.kotlin.utils.ReportLevel @Suppress("RemoveExplicitTypeArguments") @@ -30,7 +30,7 @@ object ForeignAnnotationsDirectives : SimpleDirectivesContainer() { additionalParser = ReportLevel.Companion::findByDescription ) - val ANNOTATIONS_PATH by enumDirective( + val ANNOTATIONS_PATH by enumDirective( description = "Path to foreign annotations" ) diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/AbstractForeignAnnotationsTest.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/AbstractForeignAnnotationsTest.kt index a75590e7c79..88e5ffd2b66 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/AbstractForeignAnnotationsTest.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/AbstractForeignAnnotationsTest.kt @@ -59,15 +59,15 @@ abstract class AbstractForeignAnnotationsTestBase : AbstractKotlinCompilerTest() ::ClassicDiagnosticsHandler, ) - forTestsMatching("compiler/testData/foreignAnnotations/tests/*") { + forTestsMatching("compiler/testData/diagnostics/foreignAnnotationsTests/tests/*") { defaultDirectives { - ANNOTATIONS_PATH with JdkForeignAnnotationType.Annotations + ANNOTATIONS_PATH with JavaForeignAnnotationType.Annotations } } - forTestsMatching("compiler/testData/foreignAnnotations/java8Tests/*") { + forTestsMatching("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/*") { defaultDirectives { - ANNOTATIONS_PATH with JdkForeignAnnotationType.Jdk8Annotations + ANNOTATIONS_PATH with JavaForeignAnnotationType.Java8Annotations } } } diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/configuration/JvmForeignAnnotationsConfigurator.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/configuration/JvmForeignAnnotationsConfigurator.kt index 6fa455331ff..41625f741e0 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/configuration/JvmForeignAnnotationsConfigurator.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/configuration/JvmForeignAnnotationsConfigurator.kt @@ -5,13 +5,8 @@ package org.jetbrains.kotlin.test.services.configuration -import org.jetbrains.kotlin.cli.jvm.config.addJvmClasspathRoots -import org.jetbrains.kotlin.codegen.CodegenTestUtil -import org.jetbrains.kotlin.codegen.forTestCompile.ForTestCompileRuntime import org.jetbrains.kotlin.config.AnalysisFlag -import org.jetbrains.kotlin.config.CompilerConfiguration import org.jetbrains.kotlin.config.JvmAnalysisFlags -import org.jetbrains.kotlin.test.MockLibraryUtil import org.jetbrains.kotlin.test.directives.ForeignAnnotationsDirectives import org.jetbrains.kotlin.test.directives.ForeignAnnotationsDirectives.JSPECIFY_STATE import org.jetbrains.kotlin.test.directives.ForeignAnnotationsDirectives.JSR305_GLOBAL_REPORT @@ -26,19 +21,15 @@ import org.jetbrains.kotlin.utils.JavaTypeEnhancementState import org.jetbrains.kotlin.utils.ReportLevel import java.io.File -enum class JdkForeignAnnotationType(val path: String) { +enum class JavaForeignAnnotationType(val path: String) { Annotations("third-party/annotations"), - Jdk8Annotations("third-party/jdk8-annotations"); - - companion object { - val FOREIGN_ANNOTATIONS_SOURCES_PATH = Annotations.path - val FOREIGN_JDK8_ANNOTATIONS_SOURCES_PATH = Jdk8Annotations.path - } + Java8Annotations("third-party/java8-annotations"); } open class JvmForeignAnnotationsConfigurator(testServices: TestServices) : EnvironmentConfigurator(testServices) { companion object { - private const val TEST_ANNOTATIONS_SOURCE_PATH = "compiler/testData/foreignAnnotations/testAnnotations" + val FOREIGN_ANNOTATIONS_SOURCES_PATH = Annotations.path + val FOREIGN_JDK8_ANNOTATIONS_SOURCES_PATH = Jdk8Annotations.path } override val directivesContainers: List diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/checkers/ThirdPartyAnnotationPaths.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/checkers/ThirdPartyAnnotationPaths.kt index 1b7656ef343..4a1129baf93 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/checkers/ThirdPartyAnnotationPaths.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/checkers/ThirdPartyAnnotationPaths.kt @@ -17,4 +17,4 @@ package org.jetbrains.kotlin.checkers const val FOREIGN_ANNOTATIONS_SOURCES_PATH = "third-party/annotations" -const val FOREIGN_JDK8_ANNOTATIONS_SOURCES_PATH = "third-party/jdk8-annotations" +const val FOREIGN_JDK8_ANNOTATIONS_SOURCES_PATH = "third-party/java8-annotations" diff --git a/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt b/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt index b3b5710aae4..dd4ece59c41 100644 --- a/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt +++ b/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt @@ -48,18 +48,18 @@ fun generateJUnit5CompilerTests(args: Array) { } testClass { - model("foreignAnnotations/tests") - model("foreignAnnotations/java8Tests", excludeDirs = listOf("jspecify", "typeEnhancementOnCompiledJava")) + model("diagnostics/foreignAnnotationsTests/tests") + model("diagnostics/foreignAnnotationsTests/java8Tests", excludeDirs = listOf("jspecify", "typeEnhancementOnCompiledJava")) } testClass { - model("foreignAnnotations/tests") - model("foreignAnnotations/java8Tests", excludeDirs = listOf("jspecify", "typeEnhancementOnCompiledJava")) + model("diagnostics/foreignAnnotationsTests/tests") + model("diagnostics/foreignAnnotationsTests/java8Tests", excludeDirs = listOf("jspecify", "typeEnhancementOnCompiledJava")) } testClass { - model("foreignAnnotations/tests") - model("foreignAnnotations/java8Tests", excludeDirs = listOf("jspecify", "typeEnhancementOnCompiledJava")) + model("diagnostics/foreignAnnotationsTests/tests") + model("diagnostics/foreignAnnotationsTests/java8Tests", excludeDirs = listOf("jspecify", "typeEnhancementOnCompiledJava")) } testClass { diff --git a/license/README.md b/license/README.md index 150af1e3dd2..f4e6b92fd43 100644 --- a/license/README.md +++ b/license/README.md @@ -122,7 +122,7 @@ any distributions of the compiler, libraries or plugin: - License: LGPL 2.1 ([license/third_party/testdata/findbugs_license.txt][findbugs]) - Origin: Bytecode Analysis Framework, Copyright (C) 2005 University of Maryland - - Path: third-party/jdk8-annotations/org/eclipse + - Path: third-party/java8-annotations/org/eclipse - License: Eclipse Public License v1.0 ([license/third_party/testdata/eclipse_license.txt][eclipse]) - Origin: Eclipse JDT, Copyright (c) 2011, 2013 Stephan Herrmann and others. diff --git a/third-party/jdk8-annotations/javax/annotation/CheckForNull.java b/third-party/java8-annotations/javax/annotation/CheckForNull.java similarity index 100% rename from third-party/jdk8-annotations/javax/annotation/CheckForNull.java rename to third-party/java8-annotations/javax/annotation/CheckForNull.java diff --git a/third-party/jdk8-annotations/javax/annotation/Nonnull.java b/third-party/java8-annotations/javax/annotation/Nonnull.java similarity index 100% rename from third-party/jdk8-annotations/javax/annotation/Nonnull.java rename to third-party/java8-annotations/javax/annotation/Nonnull.java diff --git a/third-party/jdk8-annotations/javax/annotation/Nullable.java b/third-party/java8-annotations/javax/annotation/Nullable.java similarity index 100% rename from third-party/jdk8-annotations/javax/annotation/Nullable.java rename to third-party/java8-annotations/javax/annotation/Nullable.java diff --git a/third-party/jdk8-annotations/javax/annotation/ParametersAreNonnullByDefault.java b/third-party/java8-annotations/javax/annotation/ParametersAreNonnullByDefault.java similarity index 100% rename from third-party/jdk8-annotations/javax/annotation/ParametersAreNonnullByDefault.java rename to third-party/java8-annotations/javax/annotation/ParametersAreNonnullByDefault.java diff --git a/third-party/jdk8-annotations/javax/annotation/meta/TypeQualifier.java b/third-party/java8-annotations/javax/annotation/meta/TypeQualifier.java similarity index 100% rename from third-party/jdk8-annotations/javax/annotation/meta/TypeQualifier.java rename to third-party/java8-annotations/javax/annotation/meta/TypeQualifier.java diff --git a/third-party/jdk8-annotations/javax/annotation/meta/TypeQualifierDefault.java b/third-party/java8-annotations/javax/annotation/meta/TypeQualifierDefault.java similarity index 100% rename from third-party/jdk8-annotations/javax/annotation/meta/TypeQualifierDefault.java rename to third-party/java8-annotations/javax/annotation/meta/TypeQualifierDefault.java diff --git a/third-party/jdk8-annotations/javax/annotation/meta/TypeQualifierNickname.java b/third-party/java8-annotations/javax/annotation/meta/TypeQualifierNickname.java similarity index 100% rename from third-party/jdk8-annotations/javax/annotation/meta/TypeQualifierNickname.java rename to third-party/java8-annotations/javax/annotation/meta/TypeQualifierNickname.java diff --git a/third-party/jdk8-annotations/javax/annotation/meta/TypeQualifierValidator.java b/third-party/java8-annotations/javax/annotation/meta/TypeQualifierValidator.java similarity index 100% rename from third-party/jdk8-annotations/javax/annotation/meta/TypeQualifierValidator.java rename to third-party/java8-annotations/javax/annotation/meta/TypeQualifierValidator.java diff --git a/third-party/jdk8-annotations/javax/annotation/meta/When.java b/third-party/java8-annotations/javax/annotation/meta/When.java similarity index 100% rename from third-party/jdk8-annotations/javax/annotation/meta/When.java rename to third-party/java8-annotations/javax/annotation/meta/When.java diff --git a/third-party/jdk8-annotations/org/checkerframework/checker/nullness/qual/NonNull.java b/third-party/java8-annotations/org/checkerframework/checker/nullness/qual/NonNull.java similarity index 100% rename from third-party/jdk8-annotations/org/checkerframework/checker/nullness/qual/NonNull.java rename to third-party/java8-annotations/org/checkerframework/checker/nullness/qual/NonNull.java diff --git a/third-party/jdk8-annotations/org/checkerframework/checker/nullness/qual/Nullable.java b/third-party/java8-annotations/org/checkerframework/checker/nullness/qual/Nullable.java similarity index 100% rename from third-party/jdk8-annotations/org/checkerframework/checker/nullness/qual/Nullable.java rename to third-party/java8-annotations/org/checkerframework/checker/nullness/qual/Nullable.java diff --git a/third-party/jdk8-annotations/org/eclipse/jdt/annotation/NonNull.java b/third-party/java8-annotations/org/eclipse/jdt/annotation/NonNull.java similarity index 100% rename from third-party/jdk8-annotations/org/eclipse/jdt/annotation/NonNull.java rename to third-party/java8-annotations/org/eclipse/jdt/annotation/NonNull.java diff --git a/third-party/jdk8-annotations/org/eclipse/jdt/annotation/Nullable.java b/third-party/java8-annotations/org/eclipse/jdt/annotation/Nullable.java similarity index 100% rename from third-party/jdk8-annotations/org/eclipse/jdt/annotation/Nullable.java rename to third-party/java8-annotations/org/eclipse/jdt/annotation/Nullable.java diff --git a/third-party/jdk8-annotations/org/jetbrains/annotations/NotNull.java b/third-party/java8-annotations/org/jetbrains/annotations/NotNull.java similarity index 100% rename from third-party/jdk8-annotations/org/jetbrains/annotations/NotNull.java rename to third-party/java8-annotations/org/jetbrains/annotations/NotNull.java diff --git a/third-party/jdk8-annotations/org/jetbrains/annotations/Nullable.java b/third-party/java8-annotations/org/jetbrains/annotations/Nullable.java similarity index 100% rename from third-party/jdk8-annotations/org/jetbrains/annotations/Nullable.java rename to third-party/java8-annotations/org/jetbrains/annotations/Nullable.java diff --git a/third-party/jdk8-annotations/org/jspecify/nullness/NullMarked.java b/third-party/java8-annotations/org/jspecify/nullness/NullMarked.java similarity index 100% rename from third-party/jdk8-annotations/org/jspecify/nullness/NullMarked.java rename to third-party/java8-annotations/org/jspecify/nullness/NullMarked.java diff --git a/third-party/jdk8-annotations/org/jspecify/nullness/Nullable.java b/third-party/java8-annotations/org/jspecify/nullness/Nullable.java similarity index 100% rename from third-party/jdk8-annotations/org/jspecify/nullness/Nullable.java rename to third-party/java8-annotations/org/jspecify/nullness/Nullable.java diff --git a/third-party/jdk8-annotations/org/jspecify/nullness/NullnessUnspecified.java b/third-party/java8-annotations/org/jspecify/nullness/NullnessUnspecified.java similarity index 100% rename from third-party/jdk8-annotations/org/jspecify/nullness/NullnessUnspecified.java rename to third-party/java8-annotations/org/jspecify/nullness/NullnessUnspecified.java