JodaOrg/joda-time — pull request #191 by gswierczynski (2014-10-07 18:08:37+00:00)
Title: #187 Deprecate PeriodFormatter#withLocale. Set correct locale for Period...

...Formatter instances created with help of PeriodFormat class.

Addresses issue #187

It is not something that can be fixed. In my opinion this method should not be there. I suppose it was added during early design.
The value of locale is never used internally (it is passed around, only meaningful usage is the getter - but unless the locale is set with withLocale method it the getter will return null). The PeriodFormat and the PeriodFormatterBuilder never returns a PeriodFormatter with locale different than null.

As to why it is rather not possible to make this method work as one would expect:
The PeriodFormatter contains all of the localized strings required for the it to work. It is does NOT use the stored locale value to pick localized strings during printing/parsing.
PeriodFormatter not only defines the locale but the order of displaying each of the values, prefixes, suffixes etc. One can define a PeriodFormatter so that the year suffix will be 'qwerty' and the month suffix will be 'wsad' and the separator between them will be 'backspace' (you get the picture). I the case like that what kind of PeriodFormatter should be returned from call to withLocale(Locale.CANADA_FRENCH) - I do not know what is the French word for 'backspace', neither does PeriodFormatter class. :-)

We could return a wordBased PeriodFormatter, but I think it is a bad idea - the returned PeriodFormatter would have nothing from the PeriodFormatter instance that the withLocale() was called upon.

I think we should:
* mark this method as deprecated,
* warn that this method does not return a PeriodFormatter that behaves differently than the first one,
* update the PeriodFormat class to produce PeriodFormatter instances with locale different that null.

This pull request does that.