Renamed methods so that tests for parsing do not fail
This commit is contained in:
@@ -79,7 +79,7 @@ public class JetClass extends JetTypeParameterListOwnerStub<KotlinClassStub> imp
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public JetPrimaryConstructor getOrCreatePrimaryConstructor() {
|
||||
public JetPrimaryConstructor createPrimaryConstructorIfAbsent() {
|
||||
JetPrimaryConstructor constructor = getPrimaryConstructor();
|
||||
if (constructor != null) return constructor;
|
||||
PsiElement anchor = getTypeParameterList();
|
||||
@@ -89,8 +89,8 @@ public class JetClass extends JetTypeParameterListOwnerStub<KotlinClassStub> imp
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public JetParameterList getOrCreatePrimaryConstructorParameterList() {
|
||||
JetPrimaryConstructor constructor = getOrCreatePrimaryConstructor();
|
||||
public JetParameterList createPrimaryConstructorParameterListIfAbsent() {
|
||||
JetPrimaryConstructor constructor = createPrimaryConstructorIfAbsent();
|
||||
JetParameterList parameterList = constructor.getValueParameterList();
|
||||
if (parameterList != null) return parameterList;
|
||||
return (JetParameterList) constructor.add(new JetPsiFactory(getProject()).createParameterList("()"));
|
||||
|
||||
@@ -126,7 +126,7 @@ public object SuperClassNotInitialized : JetIntentionActionsFactory() {
|
||||
val parameterNames = ArrayList<String>()
|
||||
val typeRefsToShorten = ArrayList<JetTypeReference>()
|
||||
if (!superParameters.isEmpty()) {
|
||||
val parameterList = classDeclaration.getOrCreatePrimaryConstructorParameterList()
|
||||
val parameterList = classDeclaration.createPrimaryConstructorParameterListIfAbsent()
|
||||
val oldParameters = parameterList.getParameters()
|
||||
val parametersToAdd = ArrayList<JetParameter>()
|
||||
for (parameter in superParameters) {
|
||||
|
||||
+1
-1
@@ -249,7 +249,7 @@ public open class KotlinIntroduceParameterHandler(
|
||||
val addedParameter = if (inplaceIsAvailable) {
|
||||
runWriteAction {
|
||||
val parameterList = targetParent.getValueParameterList()
|
||||
?: (targetParent as JetClass).getOrCreatePrimaryConstructorParameterList()
|
||||
?: (targetParent as JetClass).createPrimaryConstructorParameterListIfAbsent()
|
||||
parameterList.addParameter(newParameter)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user