Cleanup: apply "Use synthetic property access syntax"

This commit is contained in:
Mikhail Glukhikh
2017-02-17 15:39:05 +03:00
parent 1375267996
commit d0cc1635db
163 changed files with 344 additions and 344 deletions
@@ -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]
}
@@ -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
@@ -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)