The number of labelPositions is lineStringLength/labelDistance
Current code computes too many positions. It is a regression introduced in 4e29da6, committed on 28/08/2015.
Consequence of this regression is that the painter tries to draw one or more labels at each ends of the line. It is particularly visible with tiles as labels may accumulate on the border of each tile (especially with a nonNull maxDisplacement value).
To test it use option DISABLE_LETTER_LEVEL_CONFLICT defined in LabelCacheImpl (disabling letter_level_conflict will switch the code to the old function where the number of labels was computed correctly).