diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ClassFileFactory.java b/compiler/backend/src/org/jetbrains/jet/codegen/ClassFileFactory.java index 82747bd5d95..c44321b7f46 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/ClassFileFactory.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ClassFileFactory.java @@ -51,8 +51,8 @@ public final class ClassFileFactory extends GenerationStateAware { this.builderFactory = builderFactory; } - ClassBuilder newVisitor(String outputFilePath, PsiFile sourceFile) { - return newVisitor(outputFilePath, Collections.singletonList(sourceFile)); + ClassBuilder newVisitor(String internalClassName, PsiFile sourceFile) { + return newVisitor(internalClassName + ".class", Collections.singletonList(sourceFile)); } private ClassBuilder newVisitor(String outputFilePath, Collection sourceFiles) { @@ -126,16 +126,16 @@ public final class ClassFileFactory extends GenerationStateAware { if (isPrimitive(type)) { throw new IllegalStateException("Codegen for primitive type is not possible: " + aClass); } - return newVisitor(type.getInternalName() + ".class", sourceFile); + return newVisitor(type.getInternalName(), sourceFile); } public ClassBuilder forNamespacepart(String internalName, PsiFile sourceFile) { - return newVisitor(internalName + ".class", sourceFile); + return newVisitor(internalName, sourceFile); } public ClassBuilder forTraitImplementation(ClassDescriptor aClass, GenerationState state, PsiFile sourceFile) { return newVisitor( - state.getTypeMapper().mapType(aClass.getDefaultType(), JetTypeMapperMode.TRAIT_IMPL).getInternalName() + ".class", + state.getTypeMapper().mapType(aClass.getDefaultType(), JetTypeMapperMode.TRAIT_IMPL).getInternalName(), sourceFile); } diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ClosureCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/ClosureCodegen.java index 1d19a950bdb..ef0cd01c7a8 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/ClosureCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ClosureCodegen.java @@ -70,7 +70,7 @@ public class ClosureCodegen extends GenerationStateAware { public ClosureCodegen gen(JetDeclarationWithBody fun, CodegenContext context, ExpressionCodegen expressionCodegen) { name = classNameForAnonymousClass(state.getBindingContext(), fun); - ClassBuilder cv = state.getFactory().newVisitor(name.getInternalName() + ".class", fun.getContainingFile()); + ClassBuilder cv = state.getFactory().newVisitor(name.getInternalName(), fun.getContainingFile()); FunctionDescriptor funDescriptor = bindingContext.get(BindingContext.FUNCTION, fun); assert funDescriptor != null; diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java index eecb0c39c36..5ee8a86b7a7 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java @@ -109,11 +109,8 @@ public class ExpressionCodegen extends JetVisitor implem ) { JetObjectDeclaration objectDeclaration = literal.getObjectDeclaration(); - JvmClassName className = - classNameForAnonymousClass(bindingContext, objectDeclaration); - ClassBuilder classBuilder = state.getFactory().newVisitor( - className.getInternalName() + ".class", - literal.getContainingFile()); + JvmClassName className = classNameForAnonymousClass(bindingContext, objectDeclaration); + ClassBuilder classBuilder = state.getFactory().newVisitor(className.getInternalName(), literal.getContainingFile()); ClassDescriptor classDescriptor = bindingContext.get(CLASS, objectDeclaration); assert classDescriptor != null; @@ -278,9 +275,7 @@ public class ExpressionCodegen extends JetVisitor implem JvmClassName className = classNameForAnonymousClass(bindingContext, declaration); - ClassBuilder classBuilder = state.getFactory().newVisitor( - className.getInternalName() + ".class", - declaration.getContainingFile() + ClassBuilder classBuilder = state.getFactory().newVisitor(className.getInternalName(), declaration.getContainingFile() ); CodegenContext objectContext = context.intoAnonymousClass(descriptor, this); diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ScriptCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/ScriptCodegen.java index 67d7adeb9f6..361fa1c6a59 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/ScriptCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ScriptCodegen.java @@ -75,9 +75,7 @@ public class ScriptCodegen extends MemberCodegen { JvmClassName className = bindingContext.get(FQN, classDescriptorForScript); assert className != null; - ClassBuilder classBuilder = classFileFactory.newVisitor( - className.getInternalName() + ".class", - scriptDeclaration.getContainingFile() + ClassBuilder classBuilder = classFileFactory.newVisitor(className.getInternalName(), scriptDeclaration.getContainingFile() ); classBuilder.defineClass(scriptDeclaration, V1_6,