]> source.dussan.org Git - jgit.git/commit
Avoid bad rounding "1 year, 12 months" in date formatter 95/109895/3
authorMichael Keppler <Michael.Keppler@gmx.de>
Thu, 12 Oct 2017 07:38:31 +0000 (09:38 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Tue, 17 Oct 2017 22:39:46 +0000 (00:39 +0200)
commitb81c980a351cf85743afb22525d2d850a8fc5f3f
tree02589bcdc2dd7cd204c14b25bbda42b700d0572d
parent0c5ea86af336da3cc5967467f3917ce9e7244102
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