Skip to content

Commit

Permalink
Merge pull request #25 from mP1/feature/Month-getDisplayName-removed
Browse files Browse the repository at this point in the history
Month.getDisplayName removed
  • Loading branch information
mP1 authored Dec 19, 2019
2 parents f35ab64 + 685ebe4 commit 2ee2555
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
7 changes: 4 additions & 3 deletions src/main/java/org/threeten/bp/Month.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

import java.util.Locale;

import javaemul.internal.annotations.GwtIncompatible;
import org.threeten.bp.chrono.Chronology;
import org.threeten.bp.chrono.IsoChronology;
import org.threeten.bp.format.DateTimeFormatterBuilder;
Expand Down Expand Up @@ -226,9 +227,9 @@ public int getValue() {
* @param locale the locale to use, not null
* @return the text value of the month-of-year, not null
*/
public String getDisplayName(TextStyle style, Locale locale) {
return new DateTimeFormatterBuilder().appendText(MONTH_OF_YEAR, style).toFormatter(locale).format(this);
}
// public String getDisplayName(TextStyle style, Locale locale) {
// return new DateTimeFormatterBuilder().appendText(MONTH_OF_YEAR, style).toFormatter(locale).format(this);
// }

//-----------------------------------------------------------------------
/**
Expand Down
28 changes: 14 additions & 14 deletions src/test/java/org/threeten/bp/TestMonth.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,20 +156,20 @@ public void test_query_null() {
//-----------------------------------------------------------------------
// getDisplayName()
//-----------------------------------------------------------------------
@Test
public void test_getDisplayName() {
assertEquals(Month.JANUARY.getDisplayName(TextStyle.SHORT, Locale.US), "Jan");
}

@Test(expectedExceptions = NullPointerException.class)
public void test_getDisplayName_nullStyle() {
Month.JANUARY.getDisplayName(null, Locale.US);
}

@Test(expectedExceptions = NullPointerException.class)
public void test_getDisplayName_nullLocale() {
Month.JANUARY.getDisplayName(TextStyle.FULL, null);
}
// @Test
// public void test_getDisplayName() {
// assertEquals(Month.JANUARY.getDisplayName(TextStyle.SHORT, Locale.US), "Jan");
// }

// @Test(expectedExceptions = NullPointerException.class)
// public void test_getDisplayName_nullStyle() {
// Month.JANUARY.getDisplayName(null, Locale.US);
// }
//
// @Test(expectedExceptions = NullPointerException.class)
// public void test_getDisplayName_nullLocale() {
// Month.JANUARY.getDisplayName(TextStyle.FULL, null);
// }

//-----------------------------------------------------------------------
// plus(long), plus(long,unit)
Expand Down

0 comments on commit 2ee2555

Please sign in to comment.