Permalink
Browse files

[nomaster] inline importPrivateWithinFromJavaFlags into SymbolTable

This reworks 02ed5fb so that we don't change JavaUniverse's super classes.

This is necessary to maintain binary compatibility with 2.10.0.
  • Loading branch information...
1 parent ddfe3a0 commit 2f9b708b748e7a2fb252ae1ab546f4824ec0f283 @adriaanm adriaanm committed Feb 10, 2013
@@ -85,10 +85,10 @@ filter {
# matchName="scala.reflect.runtime.SymbolLoaders.initClassModule"
# problemName=MissingMethodProblem
# },
- {
- matchName="scala.reflect.runtime.JavaUniverse"
- problemName=MissingTypesProblem
- },
+ # {
+ # matchName="scala.reflect.runtime.JavaUniverse"
+ # problemName=MissingTypesProblem
+ # },
# {
# matchName="scala.reflect.runtime.JavaUniverse.initClassAndModule"
# problemName=MissingMethodProblem
@@ -1,23 +0,0 @@
-package scala.reflect
-package internal
-
-import ClassfileConstants._
-
-trait PrivateWithin {
- self: SymbolTable =>
-
- def importPrivateWithinFromJavaFlags(sym: Symbol, jflags: Int): Symbol = {
- 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
-
- sym
- }
-}
@@ -38,7 +38,6 @@ abstract class SymbolTable extends macros.Universe
with StdAttachments
with StdCreators
with BuildUtils
- with PrivateWithin
{
val gen = new TreeGen { val global: SymbolTable.this.type = SymbolTable.this }
@@ -352,6 +351,21 @@ abstract class SymbolTable extends macros.Universe
*/
implicit val StringContextStripMarginOps: StringContext => StringContextStripMarginOps = util.StringContextStripMarginOps
+ def importPrivateWithinFromJavaFlags(sym: Symbol, jflags: Int): Symbol = {
+ import ClassfileConstants._
+ 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
+
+ sym
+ }
}
object SymbolTableStats {

0 comments on commit 2f9b708

Please sign in to comment.