@@ -156,9 +156,12 @@ class ClassfileParser(
156
156
157
157
classRoot.setFlag(sflags)
158
158
moduleRoot.setFlag(Flags .JavaDefined | Flags .ModuleClassCreationFlags )
159
- setPrivateWithin(classRoot, jflags)
160
- setPrivateWithin(moduleRoot, jflags)
161
- setPrivateWithin(moduleRoot.sourceModule, jflags)
159
+
160
+ val privateWithin = getPrivateWithin(jflags)
161
+
162
+ classRoot.privateWithin = privateWithin
163
+ moduleRoot.privateWithin = privateWithin
164
+ moduleRoot.sourceModule.privateWithin = privateWithin
162
165
163
166
for (i <- 0 until in.nextChar) parseMember(method = false )
164
167
for (i <- 0 until in.nextChar) parseMember(method = true )
@@ -212,7 +215,8 @@ class ClassfileParser(
212
215
val name = pool.getName(in.nextChar)
213
216
if (! sflags.is(Flags .Private ) || name == nme.CONSTRUCTOR ) {
214
217
val member = ctx.newSymbol(
215
- getOwner(jflags), name, sflags, memberCompleter, coord = start)
218
+ getOwner(jflags), name, sflags, memberCompleter,
219
+ getPrivateWithin(jflags), coord = start)
216
220
getScope(jflags).enter(member)
217
221
}
218
222
// skip rest of member for now
@@ -263,7 +267,6 @@ class ClassfileParser(
263
267
denot.info = pool.getType(in.nextChar)
264
268
if (isEnum) denot.info = ConstantType (Constant (sym))
265
269
if (isConstructor) normalizeConstructorParams()
266
- setPrivateWithin(denot, jflags)
267
270
denot.info = translateTempPoly(parseAttributes(sym, denot.info))
268
271
if (isConstructor) normalizeConstructorInfo()
269
272
@@ -983,10 +986,11 @@ class ClassfileParser(
983
986
protected def getScope (flags : Int ): MutableScope =
984
987
if (isStatic(flags)) staticScope else instanceScope
985
988
986
- private def setPrivateWithin ( denot : SymDenotation , jflags : Int )(implicit ctx : Context ): Unit = {
989
+ private def getPrivateWithin ( jflags : Int )(implicit ctx : Context ): Symbol =
987
990
if ((jflags & (JAVA_ACC_PRIVATE | JAVA_ACC_PUBLIC )) == 0 )
988
- denot.privateWithin = denot.enclosingPackageClass
989
- }
991
+ classRoot.enclosingPackageClass
992
+ else
993
+ NoSymbol
990
994
991
995
private def isPrivate (flags : Int ) = (flags & JAVA_ACC_PRIVATE ) != 0
992
996
private def isStatic (flags : Int ) = (flags & JAVA_ACC_STATIC ) != 0
0 commit comments