Home
last modified time | relevance | path

Searched refs:TypeNullability (Results 1 – 23 of 23) sorted by relevance

/tools/metalava/metalava-model/src/main/java/com/android/tools/metalava/model/
DTypeModifiers.kt34 fun nullability(): TypeNullability in annotations()
41 fun setNullability(newNullability: TypeNullability) in annotations()
44 fun duplicate(withNullability: TypeNullability? = null): TypeModifiers in annotations()
48 get() = nullability() == TypeNullability.NULLABLE in annotations()
52 get() = nullability() == TypeNullability.NONNULL in annotations()
56 get() = nullability() == TypeNullability.PLATFORM in annotations()
60 enum class TypeNullability( in annotations() class
82 fun ofAnnotation(annotation: AnnotationItem): TypeNullability { in annotations()
DAnnotationInfo.kt41 internal val typeNullability: TypeNullability? =
43 isNullableAnnotation(qualifiedName) -> TypeNullability.NULLABLE
44 isNonNullAnnotation(qualifiedName) -> TypeNullability.NONNULL
DAnnotationItem.kt70 val typeNullability: TypeNullability? in toSource()
409 override val typeNullability: TypeNullability?
417 return info.typeNullability == TypeNullability.NULLABLE in isNullable()
421 return info.typeNullability == TypeNullability.NONNULL in isNonNull()
DTypeItem.kt171 fun duplicate(withNullability: TypeNullability) = in <lambda>()
584 if (configuration.kotlinStyleNulls && nullability == TypeNullability.NONNULL) in hashCode()
586 if (!configuration.kotlinStyleNulls && nullability == TypeNullability.PLATFORM) in hashCode()
1015 if (nullability == TypeNullability.NULLABLE) { in duplicate()
1024 if (typeParameterNullability == TypeNullability.PLATFORM) { in duplicate()
/tools/metalava/metalava-model/src/main/java/com/android/tools/metalava/model/type/
DDefaultTypeModifiers.kt22 import com.android.tools.metalava.model.TypeNullability in <lambda>()
27 private var nullability: TypeNullability, in <lambda>()
51 override fun nullability(): TypeNullability { in <lambda>()
55 override fun setNullability(newNullability: TypeNullability) { in <lambda>()
61 override fun duplicate(withNullability: TypeNullability?) = in <lambda>()
67 create(emptyList(), TypeNullability.NONNULL, "emptyNonNullModifiers is shared") in <lambda>()
77 knownNullability: TypeNullability? = null, in <lambda>()
86 ?.let { TypeNullability.ofAnnotation(it) } in <lambda>()
87 ?: TypeNullability.PLATFORM in <lambda>()
DTypeItemFactory.kt26 import com.android.tools.metalava.model.TypeNullability in <lambda>()
191 val forcedNullability: TypeNullability? = null,
201 val forcedComponentNullability: TypeNullability? = null,
216 val inferNullability: (() -> TypeNullability?)? = null,
222 kotlinNullability: TypeNullability?, in compute()
224 ): TypeNullability = in compute()
229 ?: kotlinNullability?.takeIf { nullability -> nullability != TypeNullability.PLATFORM } in compute()
237 ?: TypeNullability.PLATFORM
251 val forceNonNull = ContextNullability(TypeNullability.NONNULL)
252 val forceUndefined = ContextNullability(TypeNullability.UNDEFINED)
[all …]
/tools/metalava/metalava-model-text/src/main/java/com/android/tools/metalava/model/text/
DTextTypeParser.kt31 import com.android.tools.metalava.model.TypeNullability in <lambda>()
105 contextNullability.forcedNullability == TypeNullability.NONNULL || kotlinStyleNulls in <lambda>()
176 nullability: TypeNullability? in <lambda>()
191 if (nullability != null && nullability != TypeNullability.NONNULL) { in <lambda>()
194 return DefaultPrimitiveTypeItem(modifiers(annotations, TypeNullability.NONNULL), kind) in <lambda>()
206 nullability: TypeNullability?, in <lambda>()
299 nullability: TypeNullability? in <lambda>()
307 modifiers(annotations, TypeNullability.UNDEFINED), in <lambda>()
317 modifiers(annotations, TypeNullability.UNDEFINED), in <lambda>()
324 modifiers(annotations, TypeNullability.UNDEFINED), in <lambda>()
[all …]
DTextTypeParameterItem.kt21 import com.android.tools.metalava.model.TypeNullability
48 DefaultTypeModifiers.create(emptyList(), TypeNullability.UNDEFINED), in type()
DApiFile.kt40 import com.android.tools.metalava.model.TypeNullability in <lambda>()
1785 if (typeItem !is PrimitiveTypeItem && nullability == TypeNullability.NONNULL) { in synchronizeNullability()
1787 } else if (nullability == TypeNullability.NULLABLE) { in synchronizeNullability()
/tools/metalava/metalava-model-testsuite/src/main/java/com/android/tools/metalava/model/testsuite/
DNullabilityTesting.kt23 import com.android.tools.metalava.model.TypeNullability
87 .isEqualTo(TypeNullability.NONNULL) in assertHasNonNullNullability()
104 assertThat(modifiers.nullability()).isEqualTo(TypeNullability.NULLABLE) in assertHasNullableNullability()
115 assertThat(modifiers.nullability()).isEqualTo(TypeNullability.PLATFORM) in assertHasPlatformNullability()
120 assertThat(modifiers.nullability()).isEqualTo(TypeNullability.UNDEFINED) in assertHasUndefinedNullability()
/tools/metalava/metalava-model-psi/src/test/java/com/android/tools/metalava/model/psi/
DPsiFieldItemTest.kt19 import com.android.tools.metalava.model.TypeNullability
78 assertEquals(TypeNullability.NONNULL, fooField.type().modifiers.nullability()) in Duplicated field has correct nullability()
82 assertEquals(TypeNullability.NONNULL, duplicated.type().modifiers.nullability()) in Duplicated field has correct nullability()
DPsiTypeItemTest.kt19 import com.android.tools.metalava.model.TypeNullability
54 assertEquals(platformFromKotlin.modifiers.nullability(), TypeNullability.PLATFORM) in Test platform nullability from Kotlin()
DPsiMethodItemTest.kt19 import com.android.tools.metalava.model.TypeNullability
319 assertEquals(TypeNullability.NONNULL, toString.returnType().modifiers.nullability()) in Duplicated method has correct nullability()
323 assertEquals(TypeNullability.NONNULL, duplicated.returnType().modifiers.nullability()) in Duplicated method has correct nullability()
/tools/metalava/metalava-model-psi/src/main/java/com/android/tools/metalava/model/psi/
DKotlinTypeInfo.kt19 import com.android.tools.metalava.model.TypeNullability in <lambda>()
82 fun nullability(): TypeNullability? { in <lambda>()
86 TypeNullability.UNDEFINED in <lambda>()
88 TypeNullability.NULLABLE in <lambda>()
90 TypeNullability.NONNULL in <lambda>()
DPsiTypeItemFactory.kt27 import com.android.tools.metalava.model.TypeNullability in <lambda>()
514 typeItem is ClassTypeItem && typeItem.modifiers.nullability() == TypeNullability.NONNULL in <lambda>()
654 ContextNullability(TypeNullability.NULLABLE) in <lambda>()
DPsiFieldItem.kt23 import com.android.tools.metalava.model.TypeNullability
/tools/metalava/metalava-model-turbine/src/main/java/com/android/tools/metalava/model/turbine/
DTurbineTypeParameterItem.kt21 import com.android.tools.metalava.model.TypeNullability
52 DefaultTypeModifiers.create(emptyList(), TypeNullability.UNDEFINED), in name()
DTurbineTypeItemFactory.kt25 import com.android.tools.metalava.model.TypeNullability in <lambda>()
173 DefaultTypeModifiers.create(emptyList(), TypeNullability.NONNULL), in <lambda>()
181 DefaultTypeModifiers.create(emptyList(), TypeNullability.UNDEFINED), in <lambda>()
268 val modifiers = DefaultTypeModifiers.create(emptyList(), TypeNullability.NONNULL) in <lambda>()
/tools/metalava/metalava-model-text/src/test/java/com/android/tools/metalava/model/text/
DTextTypeParserTest.kt24 import com.android.tools.metalava.model.TypeNullability
93 .isEqualTo(Pair("String", TypeNullability.PLATFORM)) in Test splitting Kotlin nullability suffix()
95 .isEqualTo(Pair("String", TypeNullability.NULLABLE)) in Test splitting Kotlin nullability suffix()
97 .isEqualTo(Pair("String", TypeNullability.NONNULL)) in Test splitting Kotlin nullability suffix()
100 .isEqualTo(Pair("?", TypeNullability.UNDEFINED)) in Test splitting Kotlin nullability suffix()
102 .isEqualTo(Pair("T", TypeNullability.NONNULL)) in Test splitting Kotlin nullability suffix()
/tools/metalava/metalava/src/main/java/com/android/tools/metalava/compatibility/
DCompatibilityCheck.kt37 import com.android.tools.metalava.model.TypeNullability
102 (oldNullability == TypeNullability.NONNULL || in compareTypeNullability()
103 oldNullability == TypeNullability.NULLABLE) && in compareTypeNullability()
104 newNullability == TypeNullability.PLATFORM in compareTypeNullability()
119 (oldNullability == TypeNullability.NULLABLE && in compareTypeNullability()
120 newNullability == TypeNullability.NONNULL && in compareTypeNullability()
122 (oldNullability == TypeNullability.NONNULL && in compareTypeNullability()
123 newNullability == TypeNullability.NULLABLE && in compareTypeNullability()
129 (oldNullability == TypeNullability.NULLABLE && context is MethodItem) || in compareTypeNullability()
130 ((oldNullability == TypeNullability.NONNULL && context is ParameterItem)) in compareTypeNullability()
/tools/metalava/metalava-model-testsuite/src/main/java/com/android/tools/metalava/model/testsuite/classitem/
DCommonClassItemTest.kt21 import com.android.tools.metalava.model.TypeNullability
1437 "t" to Pair("java.lang.String!", TypeNullability.PLATFORM), in Test inheritMethodFromNonApiAncestor with type substitutions and not type use nullability annotations()
1438 "nonNullT" to Pair("java.lang.String", TypeNullability.NONNULL), in Test inheritMethodFromNonApiAncestor with type substitutions and not type use nullability annotations()
1439 "nullableT" to Pair("java.lang.String?", TypeNullability.NULLABLE), in Test inheritMethodFromNonApiAncestor with type substitutions and not type use nullability annotations()
1620 assertThat(modifiers.nullability()).isEqualTo(TypeNullability.NONNULL) in Test implicit nullability and annotations of ClassItem type()()
/tools/metalava/metalava/src/main/java/com/android/tools/metalava/
DAnnotationsMerger.kt61 import com.android.tools.metalava.model.TypeNullability in <lambda>()
837 item.type()?.modifiers?.setNullability(TypeNullability.NULLABLE) in <lambda>()
839 item.type()?.modifiers?.setNullability(TypeNullability.NONNULL) in <lambda>()
/tools/metalava/metalava-model-testsuite/src/main/java/com/android/tools/metalava/model/testsuite/typeitem/
DCommonTypeModifiersTest.kt22 import com.android.tools.metalava.model.TypeNullability.NONNULL in <lambda>()
23 import com.android.tools.metalava.model.TypeNullability.PLATFORM in <lambda>()