Cleanup: apply "Use synthetic property access syntax"
This commit is contained in:
+2
-2
@@ -77,8 +77,8 @@ class LazyJavaAnnotationDescriptor(
|
||||
val nameToArg = javaAnnotation.arguments.associateBy { it.name }
|
||||
|
||||
return constructors.first().valueParameters.keysToMapExceptNulls { valueParameter ->
|
||||
var javaAnnotationArgument = nameToArg[valueParameter.getName()]
|
||||
if (javaAnnotationArgument == null && valueParameter.getName() == DEFAULT_ANNOTATION_MEMBER_NAME) {
|
||||
var javaAnnotationArgument = nameToArg[valueParameter.name]
|
||||
if (javaAnnotationArgument == null && valueParameter.name == DEFAULT_ANNOTATION_MEMBER_NAME) {
|
||||
javaAnnotationArgument = nameToArg[null]
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -240,7 +240,7 @@ class LazyJavaClassDescriptor(
|
||||
|
||||
override fun getDeclarationDescriptor() = this@LazyJavaClassDescriptor
|
||||
|
||||
override fun toString(): String = getName().asString()
|
||||
override fun toString(): String = name.asString()
|
||||
}
|
||||
|
||||
// Only needed when calculating built-ins member scope
|
||||
|
||||
+2
-2
@@ -183,7 +183,7 @@ abstract class LazyJavaScope(protected val c: LazyJavaResolverContext) : MemberS
|
||||
|
||||
val name = if (function.name.asString() == "equals" &&
|
||||
jValueParameters.size == 1 &&
|
||||
c.module.builtIns.getNullableAnyType() == outType) {
|
||||
c.module.builtIns.nullableAnyType == outType) {
|
||||
// This is a hack to prevent numerous warnings on Kotlin classes that inherit Java classes: if you override "equals" in such
|
||||
// class without this hack, you'll be warned that in the superclass the name is "p0" (regardless of the fact that it's
|
||||
// "other" in Any)
|
||||
@@ -258,7 +258,7 @@ abstract class LazyJavaScope(protected val c: LazyJavaResolverContext) : MemberS
|
||||
|
||||
propertyDescriptor.setType(propertyType, listOf(), getDispatchReceiverParameter(), null as KotlinType?)
|
||||
|
||||
if (DescriptorUtils.shouldRecordInitializerForProperty(propertyDescriptor, propertyDescriptor.getType())) {
|
||||
if (DescriptorUtils.shouldRecordInitializerForProperty(propertyDescriptor, propertyDescriptor.type)) {
|
||||
propertyDescriptor.setCompileTimeInitializer(
|
||||
c.storageManager.createNullableLazyValue {
|
||||
c.components.javaPropertyInitializerEvaluator.getInitializerConstant(field, propertyDescriptor)
|
||||
|
||||
+10
-10
@@ -108,7 +108,7 @@ class AnnotationDeserializer(private val module: ModuleDescriptor, private val n
|
||||
// In the case of empty array, no element has the element type, so we fall back to the expected type, if any.
|
||||
// This is not very accurate when annotation class has been changed without recompiling clients,
|
||||
// but should not in fact matter because the value is empty anyway
|
||||
if (expectedIsArray) expectedType else builtIns.getArrayType(Variance.INVARIANT, builtIns.getAnyType())
|
||||
if (expectedIsArray) expectedType else builtIns.getArrayType(Variance.INVARIANT, builtIns.anyType)
|
||||
}
|
||||
|
||||
val expectedElementType = builtIns.getArrayElementType(if (expectedIsArray) expectedType else actualArrayType)
|
||||
@@ -147,15 +147,15 @@ class AnnotationDeserializer(private val module: ModuleDescriptor, private val n
|
||||
private fun resolveArrayElementType(value: Value, nameResolver: NameResolver): SimpleType =
|
||||
with(builtIns) {
|
||||
when (value.type) {
|
||||
Type.BYTE -> getByteType()
|
||||
Type.CHAR -> getCharType()
|
||||
Type.SHORT -> getShortType()
|
||||
Type.INT -> getIntType()
|
||||
Type.LONG -> getLongType()
|
||||
Type.FLOAT -> getFloatType()
|
||||
Type.DOUBLE -> getDoubleType()
|
||||
Type.BOOLEAN -> getBooleanType()
|
||||
Type.STRING -> getStringType()
|
||||
Type.BYTE -> byteType
|
||||
Type.CHAR -> charType
|
||||
Type.SHORT -> shortType
|
||||
Type.INT -> intType
|
||||
Type.LONG -> longType
|
||||
Type.FLOAT -> floatType
|
||||
Type.DOUBLE -> doubleType
|
||||
Type.BOOLEAN -> booleanType
|
||||
Type.STRING -> stringType
|
||||
Type.CLASS -> error("Arrays of class literals are not supported yet") // TODO: support arrays of class literals
|
||||
Type.ENUM -> resolveClass(nameResolver.getClassId(value.classId)).defaultType
|
||||
Type.ANNOTATION -> resolveClass(nameResolver.getClassId(value.annotation.id)).defaultType
|
||||
|
||||
Reference in New Issue
Block a user