Better way of changing property intiailizer used
This commit is contained in:
@@ -100,16 +100,4 @@ public class DeclarationUtils {
|
||||
|
||||
return newInitializer;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static JetProperty changePropertyInitializer(@NotNull JetProperty property, @Nullable JetExpression initializer) {
|
||||
//noinspection ConstantConditions
|
||||
return JetPsiFactory(property).createProperty(
|
||||
property.getNameIdentifier().getText(),
|
||||
JetPsiUtil.getNullableText(property.getTypeRef()),
|
||||
property.isVar(),
|
||||
JetPsiUtil.getNullableText(initializer)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -304,7 +304,7 @@ private fun makeCall(
|
||||
|
||||
is Initializer -> {
|
||||
val newProperty = copiedDeclarations[outputValue.initializedDeclaration] as JetProperty
|
||||
newProperty.replace(DeclarationUtils.changePropertyInitializer(newProperty, psiFactory.createExpression(callText)))
|
||||
newProperty.setInitializer(psiFactory.createExpression(callText))
|
||||
Collections.emptyList()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user