Skip to content
This repository has been archived by the owner on Mar 20, 2018. It is now read-only.

Commit

Permalink
Remove irrelevent conversion methods
Browse files Browse the repository at this point in the history
  • Loading branch information
jodastephen committed Jan 29, 2012
1 parent 9d33e4b commit 5763170
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 55 deletions.
10 changes: 5 additions & 5 deletions src-openjdk/test/java/java/util/TestGregorianCalendar.java
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ public void test_toLocalTime() {
assertEquals(test.getMinuteOfHour(), gcal.get(Calendar.MINUTE));
assertEquals(test.getSecondOfMinute(), gcal.get(Calendar.SECOND));
assertEquals(test.getNanoOfSecond(), gcal.get(Calendar.MILLISECOND) * 1000000);
assertEquals(test.toLocalTime().toNanoOfDay(), 0);
assertEquals(test.toNanoOfDay(), 0);
gcal.add(Calendar.DATE, 1);
}
}
Expand All @@ -331,7 +331,7 @@ public void test_toLocalTime_endOfDay() {
gcal.set(Calendar.MILLISECOND, 0);
for (int i = 0; i < 500; i++) {
LocalTime test = gcal.toLocalTime();
assertEquals(test.toLocalTime().toNanoOfDay(), (24L * 60L * 60L - 1L) * 1000000000L);
assertEquals(test.toNanoOfDay(), (24L * 60L * 60L - 1L) * 1000000000L);
gcal.add(Calendar.DATE, 1);
}
}
Expand All @@ -342,7 +342,7 @@ public void test_toLocalTime_fixedOffset() {
gcal.set(Calendar.MILLISECOND, 0);
for (int i = 0; i < 500; i++) {
LocalTime test = gcal.toLocalTime();
assertEquals(test.toLocalTime().toNanoOfDay(), 0);
assertEquals(test.toNanoOfDay(), 0);
gcal.add(Calendar.DATE, 1);
}
}
Expand All @@ -353,7 +353,7 @@ public void test_toLocalTime_variableOffset() {
gcal.set(Calendar.MILLISECOND, 0);
for (int i = 0; i < 500; i++) {
LocalTime test = gcal.toLocalTime();
assertEquals(test.toLocalTime().toNanoOfDay(), 0);
assertEquals(test.toNanoOfDay(), 0);
gcal.add(Calendar.DATE, 1);
}
}
Expand All @@ -366,7 +366,7 @@ public void test_toLocalTime_manualOffset() {
gcal.set(Calendar.DST_OFFSET, 15 * 60 * 1000);
for (int i = 0; i < 500; i++) {
LocalTime test = gcal.toLocalTime();
assertEquals(test.toLocalTime().toNanoOfDay(), 0);
assertEquals(test.toNanoOfDay(), 0);
gcal.add(Calendar.DATE, 1);
gcal.set(Calendar.ZONE_OFFSET, 30 * 60 * 1000);
gcal.set(Calendar.DST_OFFSET, 15 * 60 * 1000);
Expand Down
11 changes: 0 additions & 11 deletions src/main/java/javax/time/LocalDate.java
Original file line number Diff line number Diff line change
Expand Up @@ -1306,17 +1306,6 @@ public ZonedDateTime atStartOfDayInZone(ZoneId zone) {
return ZonedDateTime.of(this, LocalTime.MIDNIGHT, zone, ZoneResolvers.postGapPreOverlap());
}

//-----------------------------------------------------------------------
/**
* Converts this date to a {@code LocalDate}, trivially
* returning {@code this}.
*
* @return {@code this}, not null
*/
public LocalDate toLocalDate() {
return this;
}

//-----------------------------------------------------------------------
/**
* Converts this {@code LocalDate} to Epoch Days.
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/javax/time/LocalDateTime.java
Original file line number Diff line number Diff line change
Expand Up @@ -1679,16 +1679,6 @@ public LocalTime toLocalTime() {
return time;
}

/**
* Converts this date-time to a {@code LocalDateTime},
* trivially returning {@code this}.
*
* @return {@code this}, not null
*/
public LocalDateTime toLocalDateTime() {
return this;
}

//-----------------------------------------------------------------------
/**
* Compares this {@code LocalDateTime} to another date-time.
Expand Down
11 changes: 0 additions & 11 deletions src/main/java/javax/time/LocalTime.java
Original file line number Diff line number Diff line change
Expand Up @@ -858,17 +858,6 @@ public OffsetTime atOffset(ZoneOffset offset) {
return OffsetTime.of(this, offset);
}

//-----------------------------------------------------------------------
/**
* Converts this time to a {@code LocalTime}, trivially
* returning {@code this}.
*
* @return {@code this}, not null
*/
public LocalTime toLocalTime() {
return this;
}

//-----------------------------------------------------------------------
/**
* Extracts the time as seconds of day,
Expand Down
9 changes: 0 additions & 9 deletions src/test/java/javax/time/TestLocalDate.java
Original file line number Diff line number Diff line change
Expand Up @@ -2428,15 +2428,6 @@ public void test_atStartOfDayInZone_nullTimeZone() {
t.atStartOfDayInZone((ZoneId) null);
}

//-----------------------------------------------------------------------
// toLocalDate()
//-----------------------------------------------------------------------
@Test(dataProvider="sampleDates")
public void test_toLocalDate(int year, int month, int day) {
LocalDate t = LocalDate.of(year, month, day);
assertSame(t.toLocalDate(), t);
}

//-----------------------------------------------------------------------
// toEpochDay()
//-----------------------------------------------------------------------
Expand Down
9 changes: 0 additions & 9 deletions src/test/java/javax/time/TestLocalTime.java
Original file line number Diff line number Diff line change
Expand Up @@ -1733,15 +1733,6 @@ public void test_atOffset_nullZoneOffset() {
t.atOffset((ZoneOffset) null);
}

//-----------------------------------------------------------------------
// toLocalTime()
//-----------------------------------------------------------------------
@Test(dataProvider="sampleTimes")
public void test_toLocalTime(int h, int m, int s, int ns) {
LocalTime t = LocalTime.of(h, m, s, ns);
assertSame(t.toLocalTime(), t);
}

//-----------------------------------------------------------------------
// toSecondOfDay()
//-----------------------------------------------------------------------
Expand Down

0 comments on commit 5763170

Please sign in to comment.