SI-6026 REPL checks for javap before tools.jar

If javap is already available, don't go hunting for tools.jar

This avoids the getResource bug in AbstractFileClassLoader.
[nomaster] SI-6026 backport getResource bug fix

Submitted to master under SI-4936, this fix allows :javap
to work when tools.jar is discovered by REPL.
SI-7295 Fix windows batch file with args containing parentheses

In command scripts, substitution of `FOO` in `if cond ( %FOO% )` happens
*before* the condition is evaluated. One can use delayed expansion with
`if cond (!FOO!)` to get a saner behaviour. Or, as I ended up doing here,
use a goto in the body of the if rather than referring directly to variables
there.

Here's a cut down version to demonstrate the old problem:

    C:\Users\IEUser>type test.cmd
    @echo off

    setlocal enableextensions enabledelayedexpansion

    if [%~1]==[-toolcp] (
      set CP=%~2
      shift
      shift
    )
    echo -toolcp %CP%
    echo %~1 %~2

    C:\Users\IEUser>test.cmd a b
    -toolcp
    a b

    C:\Users\IEUser>test.cmd -toolcp "c:\program files" a b
    -toolcp c:\program files
    a b

    C:\Users\IEUser>test.cmd -toolcp "c:\program files" "a()b" "c()d"
    -toolcp c:\program files
    a()b c()d

    C:\Users\IEUser>test.cmd "a()b" "c()d"
    d was unexpected at this time.

I don't understand exactly why the parentheses only mess things
up in this situation. But regardless, lets find another way.

My first attempt to fix this was based on the suggestion in the ticket.
But, as shown below, this fails to capture the -toolcp.

    C:\Users\IEUser>type test.cmd
    @echo off

    setlocal enableextensions enabledelayedexpansion

    if [%~1]==[-toolcp] (
      set CP=!2!
      shift
      shift
    )
    echo -toolcp %CP%
    echo %~1 %~2
    C:\Users\IEUser>test.cmd "a()b" "c()d"
    -toolcp
    a()b c()d

    C:\Users\IEUser>test.cmd -toolcp "c:\program files" "a()b" "c()d"
    -toolcp
    a()b c()d

Last stop was the goto you'll find in this patch.

With this patch applied, I tested on Windows 8 with the following:

    C:\Users\IEUser>type Desktop\temp.cmd
    ::#!
    @echo off
    call scala %0 %*
    goto :eof
    ::!#
    println("hello, world")
    println(argv.toList)

    C:\Users\IEUser>scala Desktop\temp.cmd "foo(bar)baz"
    "java" -Xmx256M -Xms32M -Dscala.home="C:\PROGRA~3\scala\bin\.."
    -Denv.emacs="" -Dscala.usejavacp=true  -cp "..."
    scala.tools.nsc.MainGenericRunner Desktop\temp.cmd "foo(bar)baz"

    hello, world
    List(foo(bar)baz)

    C:\Users\IEUser>scala -toolcp "c:\program files" Desktop\temp.cmd "foo(bar)baz"
    "java" -Xmx256M -Xms32M -Dscala.home="C:\PROGRA~3\scala\bin\.."
     -Denv.emacs="" -Dscala.usejavacp=true  -cp "...;c:\program files"
     scala.tools.nsc.MainGenericRunner  -toolcp "c:\program files" Desktop\temp.cmd "foo(bar)baz"

    hello, world
    List(foo(bar)baz)
Merge pull request #3065 from retronym/ticket/7295

 Fix windows batch file with args containing parentheses
[nomaster] SI-7519 Less brutal attribute resetting in adapt fallback

Prefers `resetLocalAttrs` over `resetAllAttrs`. The latter loses
track of which enclosing class of the given name is referenced by
a `This` node which prefixes the an applied implicit view.

The code that `resetAllAttrs` originally landed in: https://github.com/scala/scala/commit/d4c63b#L6R804

Cherry picked from 433880e91cba9e1e926e9fcbf04ecd4aeb1d73eb

Conflicts:
	src/compiler/scala/tools/nsc/typechecker/Typers.scala
SI-7519: Additional test case covering sbt/sbt#914

(cherry picked from commit e72c32db03b44d6eaf1c1872765a578c5445e15f)
Merge pull request #3052 from som-snytt/issue/6026-javap-loading

SI-6026 REPL checks for javap before tools.jar
Merge pull request #3053 from som-snytt/issue/6026-AFCL-findresource

[nomaster] SI-6026 backport getResource bug fix
Merge pull request #3072 from retronym/backport/7519

[nomaster] SI-7519 Less brutal attribute resetting in adapt fallback
Remove tools/make-release-notes

This has lived in scala/make-release-notes for some time.
Remove outdated build scripts.

Only used on the 2.9.x series:

    /code/jenkins-config grep -R epfl-build .
    ./jobs/scala-nightly-checkinit-2.9.x/config.xml:      <command>./tools/epfl-build 2.9.x -Xcheckinit</command>
    ./jobs/scala-nightly-main-2.9.x/config.xml:./tools/epfl-build 2.9.x &amp;&amp; ./tools/epfl-publish 2.9.x

    /code/jenkins-config grep -R epfl-publish .
    ./jobs/scala-nightly-main-2.9.x/config.xml:./tools/epfl-build 2.9.x &amp;&amp; ./tools/epfl-publish 2.9.x
Remove tools/updatescalacheck

We no longer maintain a fork.
Remove tools/test-renamer

It delivered us the terser 't1234' naming convention for test
cases. Its work is done.

This commit does the bidding of the script's author:

> Despite its shameful hackiness, checked in for posterity.
> It'll live on forever in the git history; then I can remove it.
Remove tools/remotetest

I suggest using the scala-checkin-manual Jenkins job instead.
Remove tools/*{cp, _scala, _scalac}, and tools/*pickled

The scripts to fire up a compiler or REPL from build products
have bitrotted just enough to get rid of them. They do not
include the correct JLine, nor the scala modules.

I've also removed showPickled and diffPickled which were
based on these, and were also based on some code in
ShowPickled that no longer exists since 48cc8b4.
SI-7938 - parallel collections should use default ExecutionContext

Parallel collections now use `scala.concurrent.ExecutionContext`
by default.

The `ExecutionContextTaskSupport` is optimized to use the
`ForkJoinPool` underlying the `ExecutionContext` if possible.
Otherwise, a fallback `TaskSupport` that creates a reduction tree and
execute an operation through `Future`s is used.
SI-7944 FOUND: stray undetermined type params in vicinity of implicits

Implicit search created a nested Context into which the results of
its typechecking, namely, errors and undetermined type parameters
(roughly: those inferred as Nothing) are stashed.

The code the drives the process was checking for errors, but
discarded those undetermined type parameters.

This commit copies them from the child context to the parent,
which lets `Typer#adapt` to get to:

    else if (hasUndetsInMonoMode) { // (9)
      assert(!context.inTypeConstructorAllowed, context) //@M
      instantiatePossiblyExpectingUnit(tree, mode, pt)
    }

Our lost TypeVar has found its way home! The reward for which
is being instantiated, based on another type inference session
adapting the expression's type to the expected type.
Collections: remove redundant calls to .seq

Students of Scala's history might recall that at introduction of
parallel collections, GenIterable et al were *not* added; instead
the parallel collections inherited from the existing interfaces.

This of course was an invitation to widespread disaster as any
existing code that foreach-ed over a collection might now experience
unwanted concurrency.

The first attempt to fix this was to add the `.seq` method to
convert a parallel colleciton to a sequential one. This was added
in e579152f732, and call sites in the standard library with
side-effecting foreach calls were changed to use that.

But this was (rightly) deemed inadequate, as we could hardly expect
people to change existing code or remember to do this in new code.

So later, in 3de96153e5b, GenIterable was sprouted, and parallel
collections were re-parented.

This commit removes residual needless calls to .seq when the static
type of the receiver is already a plain Iterable, which are no-ops.
Don't use runtime reflection from the batch compiler.

Not only does this save a big chunk of time on startup by avoiding
classloading and symbol table population, but it also seems to
improve steady state performance of the compiler.

Theory: JIT can optimize more aggressively without the
SynchronizedXxx decorators and the like being in the classloader.
See "Class Heirarchy Analyis" in [1]

This commit does this by:

  - Avoiding use of FromString in pattern matcher, instead
    using an established mechanism to parse system properties.
  - Changes FromString back to use OptManifest. AFAICT, this
    is now only a dependency of scala.tools.cmd.gen.Codegen,
    so this is just a defensive measure.

The REPL still uses runtime reflection, so will pay a little
performance tax.

Benchmark:

    avg shortest 10 times 744ms  # before
    avg shortest 10 times 675ms  # after

[1] https://wikis.oracle.com/display/HotSpotInternals/PerformanceTechniques
Make future-spec tests not spawn threads in constructors.
The future-spec tests were spawning threads in object constructors which
meant they were on the ragged edge of entering deadlock from the static
initialization lock acquired during the static initialization blocks we
use to construct object reference fields. My work on restructuring
lambdas pushed it over the edge. This commit refactors the tests to use
class constructors rather than object constructors.