diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2013-01-31 11:49:19 +0100 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2013-02-04 22:41:39 +0100 |
commit | 02ed5fb3bc8d792872223ceecfd8fd0ae089d923 (patch) | |
tree | 9cffc064d77e94b1d3a577ade5ace0e1e4a6cc7f /src/compiler | |
parent | 2fa859e1b3eb2ac57058feaba87d96adfbac9209 (diff) | |
download | scala-02ed5fb3bc8d792872223ceecfd8fd0ae089d923.tar.gz scala-02ed5fb3bc8d792872223ceecfd8fd0ae089d923.tar.bz2 scala-02ed5fb3bc8d792872223ceecfd8fd0ae089d923.zip |
SI-6989 privateWithin is now populated in reflect
Runtime reflection in JavaMirrors previously forgot to fill in
privateWithin when importing Java reflection artifacts. Now this is fixed.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala index a708a262e7..19b32dd5fb 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala @@ -548,8 +548,8 @@ abstract class ClassfileParser { skipMembers() // methods if (!isScala) { clazz setFlag sflags - setPrivateWithin(clazz, jflags) - setPrivateWithin(staticModule, jflags) + importPrivateWithinFromJavaFlags(clazz, jflags) + importPrivateWithinFromJavaFlags(staticModule, jflags) clazz.setInfo(classInfo) moduleClass setInfo staticInfo staticModule.setInfo(moduleClass.tpe) @@ -612,7 +612,7 @@ abstract class ClassfileParser { if (isEnum) ConstantType(Constant(sym)) else info } - setPrivateWithin(sym, jflags) + importPrivateWithinFromJavaFlags(sym, jflags) parseAttributes(sym, info) getScope(jflags).enter(sym) @@ -663,7 +663,7 @@ abstract class ClassfileParser { info = MethodType(newParams, clazz.tpe) } sym.setInfo(info) - setPrivateWithin(sym, jflags) + importPrivateWithinFromJavaFlags(sym, jflags) parseAttributes(sym, info) if ((jflags & JAVA_ACC_VARARGS) != 0) { sym.setInfo(arrayToRepeated(sym.info)) @@ -1263,19 +1263,6 @@ abstract class ClassfileParser { protected def getScope(flags: Int): Scope = if (isStatic(flags)) staticScope else instanceScope - private def setPrivateWithin(sym: Symbol, jflags: Int) { - if ((jflags & (JAVA_ACC_PRIVATE | JAVA_ACC_PROTECTED | JAVA_ACC_PUBLIC)) == 0) - // See ticket #1687 for an example of when topLevelClass is NoSymbol: it - // apparently occurs when processing v45.3 bytecode. - if (sym.enclosingTopLevelClass != NoSymbol) - sym.privateWithin = sym.enclosingTopLevelClass.owner - - // protected in java means package protected. #3946 - if ((jflags & JAVA_ACC_PROTECTED) != 0) - if (sym.enclosingTopLevelClass != NoSymbol) - sym.privateWithin = sym.enclosingTopLevelClass.owner - } - private def isPrivate(flags: Int) = (flags & JAVA_ACC_PRIVATE) != 0 private def isStatic(flags: Int) = (flags & JAVA_ACC_STATIC) != 0 private def hasAnnotation(flags: Int) = (flags & JAVA_ACC_ANNOTATION) != 0 |