Add Duration.toCoarsest method
SI-7479 Make test/files/run/tailcalls.scala pass on Avian

This commit modifies the test and check file to use the new diff filter.
Removed redundant `retypedMethod` in `Duplicators`

It was never used since its introduction in 3ee6b3653 by @dragos.

Review by @dragos or @axel22 or @paulp.
Merge pull request #2647 from retronym/topic/merge-v2.10.2-RC1-35-ga54d86b-to-master

merge 2.10.x to master
SI-7343 Fixed phase ordering in specialization

Specialization rewires class parents during info transformation, and
the new info then guides the tree changes. But if a symbol is created
during duplication, which runs after specialization, its info is not
visited and thus the corresponding tree is not specialized.

One manifestation is the following:
```
object Test {

  class Parent[@specialized(Int) T]

  def spec_method[@specialized(Int) T](t: T, expectedXSuper: String) = {
     class X extends Parent[T]()
     // even in the specialized variant, the local X class
     // doesn't extend Parent$mcI$sp, since its symbol has
     // been created after specialization and was not seen
     // by specialzation's info transformer.
     ...
  }
}
```
We can fix this by forcing duplication to take place before specialization.

Review by @dragos, @paulp or @axel22.
Merge pull request #2645 from soc/SI-6747

SI-6747 Deprecate Range#{numRange,last,terminal}Element{s,}
Merge pull request #2641 from soc/SI-6811-cloneable-definition

SI-6811 Remove scala.annotation.cloneable
SI-6221 inference with Function1 subtypes.

There appears to be no upper bound on the number of places
we have to remove calls to typeSymbol and introduce calls to
baseType. This one was type inference for function parameter
types: worked when expected type was A => B, but not if there
was an implicit conversion from A => B to the expected type.
Removed sbt build.

Difficult though it may be to accept, it must go. We couldn't keep it
working with active maintenance; after eight months of neglect there is
no chance. Nobody is working on it or using it. The code will remain in
the history if anyone wants it.

One of the most annoying experiences one can have when building a new
project is finding out one has been fiddling with an abandoned build
system which isn't even expected to work. Sometimes I check out a scala
project and there is a build.xml, a pom.xml, and a project directory.
We should not be among those who sow such build confusion.
SI-7439 Avoid NPE in `isMonomorphicType` with stub symbols.

`originalInfo` can return null for stub symbols; deal with that
as we used to before a regression in 016bc3db.

After this change, we can once again delete A_1.class and still compile
code instantiating B_1. (A_1 is only referred to in a method signature
of B_1 which is not called from our code.)

	scala> new B_1
	warning: Class A_1 not found - continuing with a stub.
	res0: B_1 = B_1@5284b8f9

In practice, this situation arises when someone uses a third
party class that was compiled against other libraries not avaialable
on the current compilation classpath.
Merge pull request #2652 from paulp/no-sbt-build

Removed sbt build.
Add support for JUnit tests

Add `test.junit` ant target that compiles and runs JUnit tests
found in `test/junit` directory.

Add `scala.tools.nsc.SampleTest` that demonstrates working
testing infrastructure.
Add Eclipse project for JUnit tests.
SI-7584 Fix typer regression with by-name parameter types

It regressed in fada1ef6b#L4L614. Partially reverting just
this change restores the correct behaviour:

```
-        if (sym.isStable && pre.isStable && !isByNameParamType(tree.tpe) &&
+        if (treeInfo.admitsTypeSelection(tree) &&
```

This patch embeds the check for by-name parameter types into
`TreeInfo.isStableIdentifier`. That code already checks for
`Symbol#isStable`, which exludes direct references to by-name
parameters. But the additional check is required to deal with
by-name parameters in function types, e.g `(=> Int) => Any`.

Open question: should we go further and embed this check in `isStable`?

Currently:

    final def isStable        = isTerm && !isMutable && !(hasFlag(BYNAMEPARAM)) && (!isMethod || hasStableFlag)

Such function types are an underspecified corner of the language,
albeit one that is pretty useful writing, for example, in the
signature of a lazy foldRight that can operate over infinite
structures:

    def foldRight[A, B](fa: F[A], z: => B)(f: (A, => B) => B): B

The next commit subjects them to a little testing.
SI-7584 Test and spurious warning fix for by-name closures

The enclosed test case exercises by-name closures, which were
the subject of the previous commit. In the process, a spurious
warning was eliminated.
Merge remote-tracking branch 'scala-2.10.x/junit' into master
Move WeakHashSetTest to junit tests.

The WeakHashSetTest was written as unit test but put into partest's
`run` category as we were missing direct unit testing support.
That got fixed so moving the test now.
SI-7582 ClassfileParser: populate privateWithin of Java module class

The `privateWithin` attribute of Java companion module classes was
correctly set under joint compilation (ie, when using JavaParser),
but not under separate compilation.

This commit remedies this. The test covers variety of Java symbols.
Merge pull request #2656 from gkossakowski/junit

Add JUnit support
Merge pull request #2561 from soc/SI-7479

SI-7479 Make test/files/run/tailcalls.scala pass on Avian