Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ aa7db3a42121f78a5b3bed3658786c1cef83efe8

# Enable scalafmt for Scala 3
64df4ae51873593a789af5848bd225c14d0baf8a

# Scala Steward: Reformat with scalafmt 3.7.15
727b154f7e8509332917dac64d7f604b7f772e14
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.6.1"
version = "3.7.15"
style = default

maxColumn = 100
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.in(file("core"))
.settings(commonSettings)
.settings(
name := "scala-java-time",
name := "scala-java-time",
libraryDependencies += ("org.portable-scala" %%% "portable-scala-reflect" % "1.1.2")
.cross(CrossVersion.for3Use2_13)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ object JapaneseChronology {
* Japan introduced the Gregorian calendar starting with Meiji 6. Only Meiji and later eras are
* supported; dates before Meiji 6, January 1 are not supported.
*
* The supported {@code ChronoField} instances are: <ul> <li>{@code DAY_OF_WEEK} <li>{@code
* The supported {@@codeChronoField} instances are: <ul> <li>{@code DAY_OF_WEEK} <li>{@code
* DAY_OF_MONTH} <li>{@code DAY_OF_YEAR} <li>{@code EPOCH_DAY} <li>{@code MONTH_OF_YEAR} <li>{@code
* PROLEPTIC_MONTH} <li>{@code YEAR_OF_ERA} <li>{@code YEAR} <li>{@code ERA} </ul>
*
Expand All @@ -141,8 +141,8 @@ final class JapaneseChronology private () extends Chronology with Serializable {
/**
* Gets the ID of the chronology - 'Japanese'.
*
* The ID uniquely identifies the {@code Chronology}. It can be used to lookup the {@code
* Chronology} using {@link #of(String)}.
* The ID uniquely identifies the {@@codeChronology} . It can be used to lookup the {@code
* Chronology} using {@@link#of(String)} .
*
* @return
* the chronology ID - 'Japanese'
Expand All @@ -155,7 +155,7 @@ final class JapaneseChronology private () extends Chronology with Serializable {
* Gets the calendar type of the underlying calendar system - 'japanese'.
*
* The calendar type is an identifier defined by the <em>Unicode Locale Data Markup Language
* (LDML)</em> specification. It can be used to lookup the {@code Chronology} using {@link
* (LDML)</em> specification. It can be used to lookup the {@@codeChronology} using {@link
* #of(String)}. It can also be used as part of a locale, accessible via {@link
* Locale#getUnicodeLocaleType(String)} with the key 'ca'.
*
Expand Down Expand Up @@ -194,7 +194,7 @@ final class JapaneseChronology private () extends Chronology with Serializable {
* @throws DateTimeException
* if unable to create the date
* @throws ClassCastException
* if the { @code era} is not a { @code JapaneseEra}
* if the {@@codeera} is not a {@@codeJapaneseEra}
*/
override def dateYearDay(era: Era, yearOfEra: Int, dayOfYear: Int): JapaneseDate =
if (!era.isInstanceOf[JapaneseEra]) throw new ClassCastException("Era must be JapaneseEra")
Expand Down Expand Up @@ -276,16 +276,16 @@ final class JapaneseChronology private () extends Chronology with Serializable {
/**
* Returns the calendar system era object from the given numeric value.
*
* See the description of each Era for the numeric values of: {@link JapaneseEra#HEISEI}, {@link
* JapaneseEra#SHOWA},{@link JapaneseEra#TAISHO}, {@link JapaneseEra#MEIJI}), only Meiji and later
* eras are supported.
* See the description of each Era for the numeric values of: {@@linkJapaneseEra#HEISEI} , {@link
* JapaneseEra#SHOWA},{@link JapaneseEra#TAISHO}, {@@linkJapaneseEra#MEIJI} ), only Meiji and
* later eras are supported.
*
* @param eraValue
* the era value
* @return
* the Japanese { @code Era} for the given numeric era value
* the Japanese {@@codeEra} for the given numeric era value
* @throws DateTimeException
* if { @code eraValue} is invalid
* if {@@codeeraValue} is invalid
*/
def eraOf(eraValue: Int): JapaneseEra = JapaneseEra.of(eraValue)

Expand Down
66 changes: 33 additions & 33 deletions core/jvm/src/main/scala/org/threeten/bp/chrono/JapaneseDate.scala
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ object JapaneseDate {
private[chrono] val MIN_DATE: LocalDate = LocalDate.of(1873, 1, 1)

/**
* Obtains the current {@code JapaneseDate} from the system clock in the default time-zone.
* Obtains the current {@@codeJapaneseDate} from the system clock in the default time-zone.
*
* This will query the {@link Clock#systemDefaultZone() system clock} in the default time-zone to
* This will query the {@@linkClock#systemDefaultZone() system clock} in the default time-zone to
* obtain the current date.
*
* Using this method will prevent the ability to use an alternate clock for testing because the
Expand All @@ -69,9 +69,9 @@ object JapaneseDate {
def now: JapaneseDate = now(Clock.systemDefaultZone)

/**
* Obtains the current {@code JapaneseDate} from the system clock in the specified time-zone.
* Obtains the current {@@codeJapaneseDate} from the system clock in the specified time-zone.
*
* This will query the {@link Clock#system(ZoneId) system clock} to obtain the current date.
* This will query the {@@linkClock#system(ZoneId) system clock} to obtain the current date.
* Specifying the time-zone avoids dependence on the default time-zone.
*
* Using this method will prevent the ability to use an alternate clock for testing because the
Expand All @@ -85,11 +85,11 @@ object JapaneseDate {
def now(zone: ZoneId): JapaneseDate = now(Clock.system(zone))

/**
* Obtains the current {@code JapaneseDate} from the specified clock.
* Obtains the current {@@codeJapaneseDate} from the specified clock.
*
* This will query the specified clock to obtain the current date - today. Using this method
* allows the use of an alternate clock for testing. The alternate clock may be introduced using
* {@linkplain Clock dependency injection}.
* {@@linkplainClock dependency injection} .
*
* @param clock
* the clock to use, not null
Expand All @@ -101,10 +101,10 @@ object JapaneseDate {
def now(clock: Clock): JapaneseDate = new JapaneseDate(LocalDate.now(clock))

/**
* Obtains a {@code JapaneseDate} representing a date in the Japanese calendar system from the
* Obtains a {@@codeJapaneseDate} representing a date in the Japanese calendar system from the
* era, year-of-era, month-of-year and day-of-month fields.
*
* This returns a {@code JapaneseDate} with the specified fields. The day must be valid for the
* This returns a {@@codeJapaneseDate} with the specified fields. The day must be valid for the
* year and month, otherwise an exception will be thrown.
*
* The Japanese month and day-of-month are the same as those in the ISO calendar system. They are
Expand Down Expand Up @@ -140,10 +140,10 @@ object JapaneseDate {
}

/**
* Obtains a {@code JapaneseDate} representing a date in the Japanese calendar system from the
* Obtains a {@@codeJapaneseDate} representing a date in the Japanese calendar system from the
* era, year-of-era and day-of-year fields.
*
* This returns a {@code JapaneseDate} with the specified fields. The day must be valid for the
* This returns a {@@codeJapaneseDate} with the specified fields. The day must be valid for the
* year, otherwise an exception will be thrown. The Japanese day-of-year is reset when the era
* changes.
*
Expand Down Expand Up @@ -180,10 +180,10 @@ object JapaneseDate {
}

/**
* Obtains a {@code JapaneseDate} representing a date in the Japanese calendar system from the
* Obtains a {@@codeJapaneseDate} representing a date in the Japanese calendar system from the
* proleptic-year, month-of-year and day-of-month fields.
*
* This returns a {@code JapaneseDate} with the specified fields. The day must be valid for the
* This returns a {@@codeJapaneseDate} with the specified fields. The day must be valid for the
* year and month, otherwise an exception will be thrown.
*
* The Japanese proleptic year, month and day-of-month are the same as those in the ISO calendar
Expand All @@ -205,24 +205,24 @@ object JapaneseDate {
new JapaneseDate(LocalDate.of(prolepticYear, month, dayOfMonth))

/**
* Obtains a {@code JapaneseDate} from a temporal object.
* Obtains a {@@codeJapaneseDate} from a temporal object.
*
* This obtains a date in the Japanese calendar system based on the specified temporal. A {@code
* TemporalAccessor} represents an arbitrary set of date and time information, which this factory
* converts to an instance of {@code JapaneseDate}.
* converts to an instance of {@@codeJapaneseDate} .
*
* The conversion typically uses the {@link ChronoField#EPOCH_DAY EPOCH_DAY} field, which is
* The conversion typically uses the {@@linkChronoField#EPOCH_DAY EPOCH_DAY} field, which is
* standardized across calendar systems.
*
* This method matches the signature of the functional interface {@link TemporalQuery} allowing it
* to be used as a query via method reference, {@code JapaneseDate::from}.
* This method matches the signature of the functional interface {@@linkTemporalQuery} allowing it
* to be used as a query via method reference, {@@codeJapaneseDate::from} .
*
* @param temporal
* the temporal object to convert, not null
* @return
* the date in Japanese calendar system, not null
* @throws DateTimeException
* if unable to convert to a { @code JapaneseDate}
* if unable to convert to a {@@codeJapaneseDate}
*/
def from(temporal: TemporalAccessor): JapaneseDate = JapaneseChronology.INSTANCE.date(temporal)

Expand All @@ -231,7 +231,7 @@ object JapaneseDate {
/**
* A date in the Japanese Imperial calendar system.
*
* This date operates using the {@linkplain JapaneseChronology Japanese Imperial calendar}. This
* This date operates using the {@@linkplainJapaneseChronology Japanese Imperial calendar} . This
* calendar system is primarily used in Japan.
*
* The Japanese Imperial calendar system is the same as the ISO calendar system apart from the
Expand All @@ -241,17 +241,17 @@ object JapaneseDate {
* supported.
*
* For example, the Japanese year "Heisei 24" corresponds to ISO year "2012".<br> Calling {@code
* japaneseDate.get(YEAR_OF_ERA)} will return 24.<br> Calling {@code japaneseDate.get(YEAR)} will
* return 2012.<br> Calling {@code japaneseDate.get(ERA)} will return 2, corresponding to {@code
* japaneseDate.get(YEAR_OF_ERA)} will return 24.<br> Calling {@@codejapaneseDate.get(YEAR)} will
* return 2012.<br> Calling {@@codejapaneseDate.get(ERA)} will return 2, corresponding to {@code
* JapaneseChEra.HEISEI}.<br>
*
* <h3>Specification for implementors</h3> This class is immutable and thread-safe.
*
* @constructor
* Constructs a {@code JapaneseDate}.
* Constructs a {@@codeJapaneseDate} .
*
* This constructor does NOT validate the given parameters, and {@code era} and {@code year} must
* agree with {@code isoDate}.
* This constructor does NOT validate the given parameters, and {@@codeera} and {@@codeyear} must
* agree with {@@codeisoDate} .
* @param era
* the era, validated not null
* @param yearOfEra
Expand Down Expand Up @@ -298,17 +298,17 @@ final class JapaneseDate private[chrono] (
* Checks if the specified field is supported.
*
* This checks if this date can be queried for the specified field. If false, then calling the
* {@link #range(TemporalField) range} and {@link #get(TemporalField) get} methods will throw an
* {@@link#range(TemporalField) range} and {@@link#get(TemporalField) get} methods will throw an
* exception.
*
* If the field is a {@link ChronoField} then the query is implemented here. The supported fields
* If the field is a {@@linkChronoField} then the query is implemented here. The supported fields
* are: <ul> <li>{@code DAY_OF_WEEK} <li>{@code DAY_OF_MONTH} <li>{@code DAY_OF_YEAR} <li>{@code
* EPOCH_DAY} <li>{@code MONTH_OF_YEAR} <li>{@code PROLEPTIC_MONTH} <li>{@code YEAR_OF_ERA}
* <li>{@code YEAR} <li>{@code ERA} </ul> All other {@code ChronoField} instances will return
* <li>{@code YEAR} <li>{@code ERA} </ul> All other {@@codeChronoField} instances will return
* false.
*
* If the field is not a {@code ChronoField}, then the result of this method is obtained by
* invoking {@code TemporalField.isSupportedBy(TemporalAccessor)} passing {@code this} as the
* If the field is not a {@@codeChronoField} , then the result of this method is obtained by
* invoking {@@codeTemporalField.isSupportedBy(TemporalAccessor)} passing {@@codethis} as the
* argument. Whether the field is supported is determined by the field.
*
* @param field
Expand Down Expand Up @@ -418,9 +418,9 @@ final class JapaneseDate private[chrono] (
* @param yearOfEra
* the year-of-era to set in the returned date
* @return
* a { @code JapaneseDate} based on this date with the requested year, never null
* a {@@codeJapaneseDate} based on this date with the requested year, never null
* @throws DateTimeException
* if { @code year} is invalid
* if {@@codeyear} is invalid
*/
private def withYear(era: JapaneseEra, yearOfEra: Int): JapaneseDate = {
val year: Int = JapaneseChronology.INSTANCE.prolepticYear(era, yearOfEra)
Expand All @@ -438,9 +438,9 @@ final class JapaneseDate private[chrono] (
* @param year
* the year to set in the returned date
* @return
* a { @code JapaneseDate} based on this date with the requested year-of-era, never null
* a {@@codeJapaneseDate} based on this date with the requested year-of-era, never null
* @throws DateTimeException
* if { @code year} is invalid
* if {@@codeyear} is invalid
*/
private def withYear(year: Int): JapaneseDate = withYear(getEra, year)

Expand Down
22 changes: 11 additions & 11 deletions core/jvm/src/main/scala/org/threeten/bp/chrono/JapaneseEra.scala
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,16 @@ object JapaneseEra {
)

/**
* Obtains an instance of {@code JapaneseEra} from an {@code int} value.
* Obtains an instance of {@@codeJapaneseEra} from an {@@codeint} value.
*
* The {@link #SHOWA} era that contains 1970-01-01 (ISO calendar system) has the value 1 Later era
* is numbered 2 ({@link #HEISEI}). Earlier eras are numbered 0 ({@link #TAISHO}),
* -1 ({@link #MEIJI}), only Meiji and later eras are supported.
* The {@@link#SHOWA} era that contains 1970-01-01 (ISO calendar system) has the value 1 Later era
* is numbered 2 ({@link #HEISEI}). Earlier eras are numbered 0 ({@link #TAISHO}), -1 ({@link
* #MEIJI}), only Meiji and later eras are supported.
*
* @param japaneseEra
* the era to represent
* @return
* the { @code JapaneseEra} singleton, not null
* the {@@codeJapaneseEra} singleton, not null
* @throws DateTimeException
* if the value is invalid
*/
Expand All @@ -104,15 +104,15 @@ object JapaneseEra {
}

/**
* Returns the {@code JapaneseEra} with the name.
* Returns the {@@codeJapaneseEra} with the name.
*
* The string must match exactly the name of the era. (Extraneous whitespace characters are not
* permitted.)
*
* @param japaneseEra
* the japaneseEra name; non-null
* @return
* the { @code JapaneseEra} singleton, never null
* the {@@codeJapaneseEra} singleton, never null
* @throws IllegalArgumentException
* if there is not JapaneseEra with the specified name
*/
Expand All @@ -136,7 +136,7 @@ object JapaneseEra {
def values: Array[JapaneseEra] = Arrays.copyOf(KNOWN_ERAS.get, KNOWN_ERAS.get.length)

/**
* Obtains an instance of {@code JapaneseEra} from a date.
* Obtains an instance of {@@codeJapaneseEra} from a date.
*
* @param date
* the date, not null
Expand Down Expand Up @@ -174,7 +174,7 @@ object JapaneseEra {
* This class defines the valid eras for the Japanese chronology. Japan introduced the Gregorian
* calendar starting with Meiji 6. Only Meiji and later eras are supported; dates before Meiji 6,
* January 1 are not supported. <p> The four supported eras are hard-coded. A single additional era
* may be registered using {@link #registerEra(LocalDate, String)}.
* may be registered using {@@link#registerEra(LocalDate, String)} .
*
* <h3>Specification for implementors</h3> This class is immutable and thread-safe.
*
Expand Down Expand Up @@ -213,9 +213,9 @@ final class JapaneseEra private[chrono] (
}

/**
* Returns the numeric value of this {@code JapaneseEra}.
* Returns the numeric value of this {@@codeJapaneseEra} .
*
* The {@link #SHOWA} era that contains 1970-01-01 (ISO calendar system) has the value 1. Later
* The {@@link#SHOWA} era that contains 1970-01-01 (ISO calendar system) has the value 1. Later
* eras are numbered from 2 ({@link #HEISEI}). Earlier eras are numbered 0 ({@link #TAISHO}) and
* -1 ({@link #MEIJI}).
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import java.util.Arrays
object TTBPJapaneseEra {

/**
* Registers an additional instance of {@code JapaneseEra}. <p> A new Japanese era can begin at
* Registers an additional instance of {@@codeJapaneseEra} . <p> A new Japanese era can begin at
* any time. This method allows one new era to be registered without the need for a new library
* version. If needed, callers should assign the result to a static variable accessible across the
* application. This must be done once, in early startup code. <p> NOTE: This method does not
Expand All @@ -19,7 +19,7 @@ object TTBPJapaneseEra {
* @param name
* the name
* @return
* the { @code JapaneseEra} singleton, not null
* the {@@codeJapaneseEra} singleton, not null
* @throws DateTimeException
* if an additional era has already been registered
*/
Expand Down
Loading