@@ -192,16 +192,6 @@ class Definitions {
192
192
cls
193
193
}
194
194
195
- private def completeTransformedJavaClass (cls : ClassSymbol , ensureCtor : Boolean = true ): ClassSymbol = {
196
- // The companion object of a Java class doesn't really exist, `NoType` is the general
197
- // technique to do that. Here we need to set it before completing
198
- // attempt to load Object's classfile, which causes issue #1648.
199
- val companion = JavaLangPackageVal .info.decl(cls.name.toTermName).symbol
200
- companion.moduleClass.info = NoType // to indicate that it does not really exist
201
- companion.info = NoType // to indicate that it does not really exist
202
- completeClass(cls, ensureCtor)
203
- }
204
-
205
195
lazy val RootClass : ClassSymbol = ctx.newPackageSymbol(
206
196
NoSymbol , nme.ROOT , (root, rootcls) => ctx.base.rootLoader(root)).moduleClass.asClass
207
197
lazy val RootPackage : TermSymbol = ctx.newSymbol(
@@ -302,7 +292,14 @@ class Definitions {
302
292
assert(! cls.isCompleted, " race for completing java.lang.Object" )
303
293
cls.info = ClassInfo (cls.owner.thisType, cls, AnyClass .typeRef :: Nil , newScope)
304
294
cls.setFlag(NoInits )
305
- completeTransformedJavaClass(cls)
295
+
296
+ // The companion object of a Java class doesn't really exist, `NoType` is the general
297
+ // technique to do that. Here we need to set it before completing
298
+ // attempt to load Object's classfile, which causes issue #1648.
299
+ val companion = JavaLangPackageVal .info.decl(cls.name.toTermName).symbol
300
+ companion.moduleClass.info = NoType // to indicate that it does not really exist
301
+ companion.info = NoType // to indicate that it does not really exist
302
+ completeClass(cls)
306
303
}
307
304
def ObjectType : TypeRef = ObjectClass .typeRef
308
305
@@ -632,7 +629,7 @@ class Definitions {
632
629
constr.info = newInfo
633
630
constr.termRef.recomputeDenot()
634
631
cls.setFlag(NoInits )
635
- completeTransformedJavaClass( cls, ensureCtor = false )
632
+ cls
636
633
}
637
634
def JavaEnumType = JavaEnumClass .typeRef
638
635
0 commit comments