This is not invalid for me and there is definitely something very wrong in the way XWiki#copyDocument works: the parameters are interpreted as "the source with the provided locale is copied to the target without locale" which I really doubt is how anyone would interpret expect it to behave (but not having any javadoc does not help settle this...). I would have It was definitely expected the target obvious to have me that the locale too was supposed to apply to both the source and the target .
It's easy to fix, the only question is: does anyone really expect the current behavior ? In which case it would be a huge breakage.
I'm tempted to just deprecated all the XWiki#copyDocument methods which take a locale (i.e. not touch them to be extra safe) and recommend to simply pass references with locale in them to be very explicit. |
|