scala/scala — pull request #2936 by paulp (2013-09-11 16:11:22+00:00)
Title: Consolidate Position classes.

Having now been burned several times thinking I had a chunk
of positions under my belt only to find my pants had vanished
when I forged ahead, I am carving out some intermediate stages
for positions.

This one only reshuffles the internals. It consolidates almost
all the behavior into one class, leaving little stub subclasses
to mimic the classes which came before - since nothing is final
or has access anything less than public, there's no way to touch
any constructor without breakage, so they all have to stay.

I removed redundant/incorrect documentation and rewrote the
rest of it, although I don't expect the lifespan of any of it
to be enormous.

The overall thinking behind the existing design was a bit elusive.
Concrete exception-throwing implementations were provided in the base
class for every method, with less exceptional overrides defined
in selected subclasses. If you're going to define every method
in the base class, concretely no less, then there is little
advantage and lots of disadvantage to spreading out over a bunch
of subclasses.

Note that now Position contains no state and has no constructor,
characteristics which behoove its possibly distant ambition
toward AnyValhood. Though that does ignore the "api" class it
inherits which brims with implementation detail, api.Position.
It is a burden which will likely prove heavy.