Revert "remove FunctionDescriptorImpl constructor overloading"

This reverts commit 964b66ecb1.
This commit is contained in:
Stepan Koltsov
2012-02-06 20:39:04 +04:00
parent b2944a1bd1
commit bbf2f60aef
3 changed files with 5 additions and 13 deletions
@@ -24,7 +24,7 @@ public class ConstructorDescriptorImpl extends FunctionDescriptorImpl implements
}
public ConstructorDescriptorImpl(@NotNull ConstructorDescriptor original, @NotNull List<AnnotationDescriptor> annotations, boolean isPrimary) {
super(original.getContainingDeclaration(), original, annotations, "<init>");
super(original, annotations, "<init>");
this.isPrimary = isPrimary;
}
@@ -43,11 +43,10 @@ public abstract class FunctionDescriptorImpl extends DeclarationDescriptorImpl i
}
protected FunctionDescriptorImpl(
@NotNull DeclarationDescriptor containigDeclaration,
@NotNull FunctionDescriptor original,
@NotNull List<AnnotationDescriptor> annotations,
@NotNull String name) {
super(containigDeclaration, annotations, name);
super(original.getContainingDeclaration(), annotations, name);
this.original = original;
}
@@ -16,20 +16,13 @@ public class NamedFunctionDescriptorImpl extends FunctionDescriptorImpl implemen
super(containingDeclaration, annotations, name);
}
private NamedFunctionDescriptorImpl(@NotNull DeclarationDescriptor containingDeclaration, @NotNull NamedFunctionDescriptor original, @NotNull List<AnnotationDescriptor> annotations, @NotNull String name) {
super(containingDeclaration, original, annotations, name);
}
@NotNull
@Override
public NamedFunctionDescriptor getOriginal() {
return (NamedFunctionDescriptor) super.getOriginal();
private NamedFunctionDescriptorImpl(@NotNull NamedFunctionDescriptor original, @NotNull List<AnnotationDescriptor> annotations, @NotNull String name) {
super(original, annotations, name);
}
@Override
protected FunctionDescriptorImpl createSubstitutedCopy() {
return new NamedFunctionDescriptorImpl(
getContainingDeclaration(),
this,
// TODO : safeSubstitute
getAnnotations(),
@@ -39,7 +32,7 @@ public class NamedFunctionDescriptorImpl extends FunctionDescriptorImpl implemen
@NotNull
@Override
public NamedFunctionDescriptor copy(DeclarationDescriptor newOwner, boolean makeNonAbstract) {
NamedFunctionDescriptorImpl copy = new NamedFunctionDescriptorImpl(newOwner, getOriginal(), Lists.newArrayList(getAnnotations()), getName());
NamedFunctionDescriptorImpl copy = new NamedFunctionDescriptorImpl(newOwner, Lists.newArrayList(getAnnotations()), getName());
copy.initialize(
getReceiverParameter().exists() ? getReceiverParameter().getType() : null,
expectedThisObject,