Make project compilable after types enhancement

This commit is contained in:
Denis Zharkov
2015-07-08 12:13:24 +03:00
parent 4479c215d4
commit 0a19fb7df2
139 changed files with 227 additions and 212 deletions
@@ -328,7 +328,7 @@ class Converter private constructor(
isVal && modifiers.isPrivate)
val propertyType = typeToDeclare ?: typeConverter.convertVariableType(field)
addUsageProcessing(FieldToPropertyProcessing(field, correction?.name ?: field.getName(), propertyType.isNullable))
addUsageProcessing(FieldToPropertyProcessing(field, correction?.name ?: field.getName()!!, propertyType.isNullable))
return Property(name,
annotations,
@@ -317,6 +317,6 @@ class ForConverter(
val declarationStatement = this as? PsiDeclarationStatement ?: return listOf()
return declarationStatement.getDeclaredElements()
.filterIsInstance<PsiVariable>()
.map { it.getName() }
.map { it.getName()!! }
}
}
@@ -64,7 +64,7 @@ class AccessorToPropertyProcessing(val accessorMethod: PsiMethod, val accessorKi
if (accessorKind == AccessorKind.GETTER) {
if (arguments.size() != 0) return null // incorrect call
propertyNameExpr = callExpr.replace(propertyNameExpr) as JetSimpleNameExpression
return listOf(propertyNameExpr.getReference())
return listOf(propertyNameExpr.getReference()!!)
}
else {
val value = arguments.singleOrNull()?.getArgumentExpression() ?: return null
@@ -76,12 +76,12 @@ class AccessorToPropertyProcessing(val accessorMethod: PsiMethod, val accessorKi
callExpr.replace(propertyNameExpr)
assignment.getLeft()!!.replace(qualifiedExpression)
assignment = qualifiedExpression.replace(assignment) as JetBinaryExpression
return listOf((assignment.getLeft() as JetQualifiedExpression).getSelectorExpression()!!.getReference())
return listOf((assignment.getLeft() as JetQualifiedExpression).getSelectorExpression()!!.getReference()!!)
}
else {
assignment.getLeft()!!.replace(propertyNameExpr)
assignment = callExpr.replace(assignment) as JetBinaryExpression
return listOf(assignment.getLeft()!!.getReference())
return listOf(assignment.getLeft()!!.getReference()!!)
}
}
@@ -124,7 +124,7 @@ class FieldToPropertyProcessing(val field: PsiField, val propertyName: String, v
binary = setCall.getArgumentList().getExpressions().single() as PsiBinaryExpression
getCall = binary.getLOperand() as PsiMethodCallExpression
return listOf(getCall.getMethodExpression().getReference(), setCall.getMethodExpression().getReference())
return listOf(getCall.getMethodExpression().getReference()!!, setCall.getMethodExpression().getReference()!!)
}
private fun generateGetterCall(qualifier: PsiExpression?): PsiMethodCallExpression {
@@ -36,7 +36,7 @@ public class MethodIntoObjectProcessing(private val method: PsiMethod, private v
else {
var qualifiedExpr = factory.createExpressionFromText(objectName + "." + refExpr.getText(), null) as PsiReferenceExpression
qualifiedExpr = refExpr.replace(qualifiedExpr) as PsiReferenceExpression
return listOf(qualifiedExpr.getReference())
return listOf(qualifiedExpr.getReference()!!)
}
}
}
@@ -30,7 +30,7 @@ class ToObjectWithOnlyMethodsProcessing(private val psiClass: PsiClass) : UsageP
val factory = PsiElementFactory.SERVICE.getInstance(psiClass.getProject())
var qualifiedExpr = factory.createExpressionFromText(refExpr.getText() + "." + JvmAbi.INSTANCE_FIELD, null) as PsiReferenceExpression
qualifiedExpr = refExpr.replace(qualifiedExpr) as PsiReferenceExpression
return listOf(qualifiedExpr.getReference())
return listOf(qualifiedExpr.getReference()!!)
}
}