got rid of method with duplicating functionality

This commit is contained in:
Alex Tkachman
2012-09-13 10:01:29 +03:00
parent ee38d871c4
commit acfc5b3f56
3 changed files with 3 additions and 14 deletions
@@ -271,18 +271,8 @@ public class CodegenBinding {
return false; return false;
} }
public static JvmClassName getJvmClassName(BindingTrace bindingTrace, ClassDescriptor classDescriptor) {
classDescriptor = (ClassDescriptor) classDescriptor.getOriginal();
final JvmClassName name = bindingTrace.getBindingContext().get(FQN, classDescriptor);
if (name != null) {
return name;
}
return getJvmInternalName(bindingTrace, classDescriptor);
}
@NotNull @NotNull
private static JvmClassName getJvmInternalName(BindingTrace bindingTrace, @NotNull DeclarationDescriptor descriptor) { public static JvmClassName getJvmInternalName(BindingTrace bindingTrace, @NotNull DeclarationDescriptor descriptor) {
descriptor = descriptor.getOriginal(); descriptor = descriptor.getOriginal();
JvmClassName name = bindingTrace.getBindingContext().get(FQN, descriptor); JvmClassName name = bindingTrace.getBindingContext().get(FQN, descriptor);
if (name != null) { if (name != null) {
@@ -261,8 +261,7 @@ public abstract class CodegenContext {
final ClassDescriptor enclosingClass = getEnclosingClass(); final ClassDescriptor enclosingClass = getEnclosingClass();
outerExpression = enclosingClass != null outerExpression = enclosingClass != null
? StackValue ? StackValue
.field(typeMapper.mapType(enclosingClass), CodegenBinding.getJvmClassName( .field(typeMapper.mapType(enclosingClass), CodegenBinding.getJvmInternalName(typeMapper.getBindingTrace(), classDescriptor), CodegenUtil.THIS$0,
typeMapper.getBindingTrace(), classDescriptor), CodegenUtil.THIS$0,
false) false)
: null; : null;
} }
@@ -297,7 +297,7 @@ public class JetTypeMapper extends BindingTraceAware {
} }
if (descriptor instanceof ClassDescriptor) { if (descriptor instanceof ClassDescriptor) {
JvmClassName name = getJvmClassName(bindingTrace, (ClassDescriptor) descriptor); JvmClassName name = getJvmInternalName(bindingTrace, (ClassDescriptor) descriptor);
Type asmType; Type asmType;
if (kind == JetTypeMapperMode.TRAIT_IMPL) { if (kind == JetTypeMapperMode.TRAIT_IMPL) {
asmType = Type.getObjectType(name.getInternalName() + JvmAbi.TRAIT_IMPL_SUFFIX); asmType = Type.getObjectType(name.getInternalName() + JvmAbi.TRAIT_IMPL_SUFFIX);