Extracted "preserve original" flag.
This commit is contained in:
+7
-1
@@ -20,6 +20,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.descriptors.ClassDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.FunctionDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.annotations.Annotations;
|
||||
import org.jetbrains.jet.lang.descriptors.impl.ConstructorDescriptorImpl;
|
||||
|
||||
@@ -54,8 +55,13 @@ public class JavaConstructorDescriptor extends ConstructorDescriptorImpl {
|
||||
this.hasStableParameterNames = hasStableParameterNames;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected JavaConstructorDescriptor createSubstitutedCopy(DeclarationDescriptor newOwner, boolean preserveOriginal, Kind kind) {
|
||||
protected JavaConstructorDescriptor createSubstitutedCopy(
|
||||
@NotNull DeclarationDescriptor newOwner,
|
||||
@Nullable FunctionDescriptor original,
|
||||
@NotNull Kind kind
|
||||
) {
|
||||
if (kind != Kind.DECLARATION) {
|
||||
throw new IllegalStateException("Attempt at creating a constructor that is not a declaration: \n" +
|
||||
"copy from: " + this + "\n" +
|
||||
|
||||
+8
-2
@@ -19,6 +19,7 @@ package org.jetbrains.jet.lang.resolve.java.descriptor;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.FunctionDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.SimpleFunctionDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.annotations.Annotations;
|
||||
import org.jetbrains.jet.lang.descriptors.impl.FunctionDescriptorImpl;
|
||||
@@ -57,11 +58,16 @@ public class JavaMethodDescriptor extends SimpleFunctionDescriptorImpl implement
|
||||
this.hasStableParameterNames = hasStableParameterNames;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected FunctionDescriptorImpl createSubstitutedCopy(DeclarationDescriptor newOwner, boolean preserveOriginal, Kind kind) {
|
||||
protected FunctionDescriptorImpl createSubstitutedCopy(
|
||||
@NotNull DeclarationDescriptor newOwner,
|
||||
@Nullable FunctionDescriptor original,
|
||||
@NotNull Kind kind
|
||||
) {
|
||||
JavaMethodDescriptor result = new JavaMethodDescriptor(
|
||||
newOwner,
|
||||
preserveOriginal ? getOriginal() : null,
|
||||
(SimpleFunctionDescriptor) original,
|
||||
getAnnotations(),
|
||||
getName(),
|
||||
kind
|
||||
|
||||
Reference in New Issue
Block a user