Rank based take/drop/slice.

Tree navigation based on node rank is faster than using compare
method. rank is simply count(tree.left) + 1.
SI-6374 Scala reflection now supports Java CRTP

Translation of Java types to Scala types has previously been
existentionalizing raw types of ParameterizedType arguments.

As shown in https://issues.scala-lang.org/browse/SI-6374
this leads to cyclic reference errors. If you wonder about the
mechanism of the error, take a look at the comments to the
aforementioned issue - there's a detailed explanation.

However calling rawToExistential is completely unnecessary, because
existential parameters of the results are immediately discarded,
and only prefix and symbol are used later on (which means that
existential extrapolation performed by rawToExistential also doesn't
after the result).

Finding out this was tough, but the rest was a piece of cake.
Getting rid of the call to rawToExistential when translating ParameterizedType
fixed the problem.
Reflection no longer produces faux existentials

Because of using plain ExistentialType factory of a case class
typeToScala sometimes returned existentials with empty quantifieds.

Changing ExistentialType to newExistentialType, which simply returns
the underlying types if params are empty, fixed the problem.
SI-6374 Reflection now works for anns with enum fields

Enum members are static and, therefore, they need to be looked up in
classSymbol(<enum>).companionModule, rather than in classSymbol(<enum>).
Fixes SI-6337 by disallowing nested value classes.

It seems for the moment too hard to allow this, and the functionality to have value classes wrap other value classes does not seem essential.
Fixed comment.
refactors java reflection tests

All javac-produced artifacts are now placed into test/files/lib
SI-6287 fixes synthetic symbol clashes in toolbox

Apparently synthetic classes like $anonfun$1 have two properties:
1) Their names are generated using a counter unique to a compilation unit
2) After flatten they levitate to the nearest enclosing package

As a result if we use an empty package to wrap toolbox codegen,
then this package will soon be overflown by $anonfun$1 symbols, because:
1) New codegen session = new compilation unit = new counter which starts at 0
2) New codegen session = new anon funs that end up as children of empty package

Creating a freshly named package for each codegen session fixed the problem.
Now anonfuns from different sessions end up with different parents.
Removed many @inline annotations and final modifiers.

It is my belief that these @inlines and finals landed between
unhelpful and harmful. I am sure this will be disputed in some
cases. It's too much and too difficult to measure except in the
aggregate unless we have specific @inline sites to discuss.
I don't know upon whom the burden of proof lies.  I think we
should err on the side given here, since there is no evidence
of any consistent rationale being applied and it is easy to
verify the negative impact scala compiler inlining can have on
hotspot's far more sophisticated inlining.
improved reflection documentation
enable integer multiplication/divison on FiniteDuration, see SI-6389

- without this "2.seconds * 2" will not return FiniteDuration but
  Duration
- added test case verifying this behavior
- matches normal arithmetics: integers throw on div-by-zero while
  doubles yield infinity; extended here to include overflow protection
  on integer multiplication
existentially typed expansions now work fine

If one tries to compile the following code with the parent of this commit:

  ru.reify(new Object().getClass)

then the following error will occur:

  Test.scala:2: error: type mismatch;
    found   : $u.Expr[Class[_ <: Object]]
    required: reflect.runtime.universe.Expr[Class[?0(in value <local Test>)]]
              where type ?0(in value <local Test>) <: Object
    ru.reify(new Object().getClass)
            ^

This happens because macro expansions are always typechecked against the
return type of their macro definitions instantiated in the context of expandee.

In this case the expected type contains skolems which are incompatible
with wildcards in the type of the expansion.

I tried all the incantations I could think of - without any success.
Luckily I met Martin who pointed me at the same problem solved in adapt
(see the diff w.r.t Typers.scala).
test case closes SI-5418

Now, when the existential reification bug is fixed, I've been able
to take a look at SI-5418, and, apparently, the problem with importers
has fixed itself during these 9 months of the bug being active.
clarify caveats of App trait
SI-6336 Now also catches return types

As Mark's comments on SI-6336 shows, we also need to disallow value classes
as return types of structural types.
test case closes SI-5770
Retain Ordering in drop/take/slice signatures.

Addresses code review feedback by @axel22.
Add RedBlackTree tests for take/drop/slice.

Addresses review feedback by axel22.
Fixes SI-6305 scala.tools.nsc.io split between jars.

* migrates scala.tools.nsc.io portions into scala.reflect.io
* marks all classes in scala.reflect.io experimental/internal
* rewires src/reflect to use new io locations
* creates forwarders in scala.tools.nsci.io package object.
Adds OSGi support / tests to Scala.  Fixes SI-5822.

* Adds BND manifest generation to the build.
* Adds OSGi pax-exam testing infrastructure
* Adds simple OSGi verification test for bundle resolution.
* Modifies distribution to use bundles.