]> source.dussan.org Git - jgit.git/commit
Avoid bad rounding "1 year, 12 months" in date formatter 95/110495/1
authorMichael Keppler <Michael.Keppler@gmx.de>
Thu, 12 Oct 2017 07:38:31 +0000 (09:38 +0200)
committerDavid Pursehouse <david.pursehouse@gmail.com>
Mon, 23 Oct 2017 02:33:55 +0000 (11:33 +0900)
commite1a39cbbe7c9f317b5f9ff6f4b7792eb2b837a09
tree252f85dc7c13afc7cd1b1363889798faf929502c
parentadbf0935e105819f6b8f65325013b6def6205f18
Avoid bad rounding "1 year, 12 months" in date formatter

Round first, then calculate the labels. This avoids "x years, 12 months"
and instead produces "x+1 years".

One test case has been added for the original example the bug was found
with, and one assertion has been moved from an existing test case to the
new test case, since it also triggered the bug.

Bug: 525907
Change-Id: I3270af3850c4fb7bae9123a0a6582f93055c9780
Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/util/RelativeDateFormatterTest.java
org.eclipse.jgit/src/org/eclipse/jgit/util/RelativeDateFormatter.java