package scala.tools.nsc
package backend
import io.AbstractFile
import util.JavaClassPath
import util.ClassPath.{ JavaContext, DefaultJavaContext }
import scala.tools.util.PathResolver
trait JavaPlatform extends Platform[AbstractFile] {
import global._
import definitions._
lazy val classPath = new PathResolver(settings).result
def rootLoader = new loaders.JavaPackageLoader(classPath)
private def depAnalysisPhase =
if (settings.make.isDefault) Nil
else List(dependencyAnalysis)
def platformPhases = List(
flatten,
liftcode,
genJVM
) ++ depAnalysisPhase
lazy val externalEquals = getMember(BoxesRunTimeClass, nme.equals_)
lazy val externalEqualsNumNum = getMember(BoxesRunTimeClass, "equalsNumNum")
lazy val externalEqualsNumChar = getMember(BoxesRunTimeClass, "equalsNumChar")
lazy val externalEqualsNumObject = getMember(BoxesRunTimeClass, "equalsNumObject")
def isMaybeBoxed(sym: Symbol) = {
(sym == ObjectClass) ||
(sym == JavaSerializableClass) ||
(sym == ComparableClass) ||
(sym isNonBottomSubClass BoxedNumberClass) ||
(sym isNonBottomSubClass BoxedCharacterClass) ||
(sym isNonBottomSubClass BoxedBooleanClass)
}
}