Let a few tab characters slip in - Eclipse wasn't configured yet. Replacing with spaces.

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@486525 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Henri Yandell 2006-12-13 07:12:38 +00:00
parent dd23ae863a
commit 868dd28444
2 changed files with 7 additions and 7 deletions

View File

@ -355,10 +355,10 @@ public class DurationFormatUtils {
months += 12 * years;
years = 0;
} else {
while ( (start.get(Calendar.YEAR) != end.get(Calendar.YEAR))) {
while ( (start.get(Calendar.YEAR) != end.get(Calendar.YEAR))) {
days += start.getActualMaximum(Calendar.DAY_OF_YEAR);
start.add(Calendar.YEAR, 1);
}
}
years = 0;
}
}
@ -366,9 +366,9 @@ public class DurationFormatUtils {
if (!Token.containsTokenWithValue(tokens, M) && months != 0) {
while(start.get(Calendar.MONTH) != end.get(Calendar.MONTH)) {
String date = start.getTime().toString();
days += start.getActualMaximum(Calendar.DAY_OF_MONTH);
start.add(Calendar.MONTH, 1);
String date = start.getTime().toString();
days += start.getActualMaximum(Calendar.DAY_OF_MONTH);
start.add(Calendar.MONTH, 1);
}
days += leapDays;
months = 0;

View File

@ -424,12 +424,12 @@ public class DurationFormatUtilsTest extends TestCase {
assertEqualDuration( "01 26", new int[] { 2006, 0, 15, 0, 0, 0 },
new int[] { 2006, 2, 10, 0, 0, 0 }, "MM dd");
assertEqualDuration( "54", new int[] { 2006, 0, 15, 0, 0, 0 },
new int[] { 2006, 2, 10, 0, 0, 0 }, "dd");
new int[] { 2006, 2, 10, 0, 0, 0 }, "dd");
assertEqualDuration( "09 12", new int[] { 2006, 1, 20, 0, 0, 0 },
new int[] { 2006, 11, 4, 0, 0, 0 }, "MM dd");
assertEqualDuration( "287", new int[] { 2006, 1, 20, 0, 0, 0 },
new int[] { 2006, 11, 4, 0, 0, 0 }, "dd");
new int[] { 2006, 11, 4, 0, 0, 0 }, "dd");
assertEqualDuration( "11 30", new int[] { 2006, 0, 2, 0, 0, 0 },
new int[] { 2007, 0, 1, 0, 0, 0 }, "MM dd");