Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update scalafmt-core to 3.8.1 #502

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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.8.1
adeb878adf3788f1b68a666b5b082025fa9bc98b
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.8.1"
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 @@ -143,7 +143,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.3")
.cross(CrossVersion.for3Use2_13)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {@code Chronology} . It can be used to lookup the {@code
* Chronology} using {@link #of(String)} .
*
* @return
* the chronology ID - 'Japanese'
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 {@code era} is not a {@code JapaneseEra}
*/
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: {@link JapaneseEra#HEISEI} , {@link
* JapaneseEra#SHOWA},{@link JapaneseEra#TAISHO}, {@link JapaneseEra#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 {@code Era} for the given numeric era value
* @throws DateTimeException
* if { @code eraValue} is invalid
* if {@code eraValue} is invalid
*/
def eraOf(eraValue: Int): JapaneseEra = JapaneseEra.of(eraValue)

Expand Down
24 changes: 12 additions & 12 deletions core/jvm/src/main/scala/org/threeten/bp/chrono/JapaneseDate.scala
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ object JapaneseDate {
*
* 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}.
* {@linkplain Clock dependency injection} .
*
* @param clock
* the clock to use, not null
Expand Down Expand Up @@ -209,20 +209,20 @@ object JapaneseDate {
*
* 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 {@code JapaneseDate} .
*
* The conversion typically uses the {@link ChronoField#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}.
* to be used as a query via method reference, {@code JapaneseDate::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 {@code JapaneseDate}
*/
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 {@linkplain JapaneseChronology 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 @@ -248,10 +248,10 @@ object JapaneseDate {
* <h3>Specification for implementors</h3> This class is immutable and thread-safe.
*
* @constructor
* Constructs a {@code JapaneseDate}.
* Constructs a {@code JapaneseDate} .
*
* This constructor does NOT validate the given parameters, and {@code era} and {@code year} must
* agree with {@code isoDate}.
* agree with {@code isoDate} .
* @param era
* the era, validated not null
* @param yearOfEra
Expand Down Expand Up @@ -307,7 +307,7 @@ final class JapaneseDate private[chrono] (
* <li>{@code YEAR} <li>{@code ERA} </ul> All other {@code ChronoField} instances will return
* false.
*
* If the field is not a {@code ChronoField}, then the result of this method is obtained by
* 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
* argument. Whether the field is supported is determined by the 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 {@code JapaneseDate} based on this date with the requested year, never null
* @throws DateTimeException
* if { @code year} is invalid
* if {@code year} 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 {@code JapaneseDate} based on this date with the requested year-of-era, never null
* @throws DateTimeException
* if { @code year} is invalid
* if {@code year} is invalid
*/
private def withYear(year: Int): JapaneseDate = withYear(getEra, year)

Expand Down
12 changes: 6 additions & 6 deletions core/jvm/src/main/scala/org/threeten/bp/chrono/JapaneseEra.scala
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ object JapaneseEra {
* Obtains an instance of {@code JapaneseEra} from an {@code int} 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.
* 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 {@code JapaneseEra} singleton, not null
* @throws DateTimeException
* if the value is invalid
*/
Expand All @@ -112,7 +112,7 @@ object JapaneseEra {
* @param japaneseEra
* the japaneseEra name; non-null
* @return
* the { @code JapaneseEra} singleton, never null
* the {@code JapaneseEra} singleton, never null
* @throws IllegalArgumentException
* if there is not JapaneseEra with the specified name
*/
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,7 +213,7 @@ final class JapaneseEra private[chrono] (
}

/**
* Returns the numeric value of this {@code JapaneseEra}.
* Returns the numeric value of this {@code JapaneseEra} .
*
* 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
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 {@code JapaneseEra} . <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 {@code JapaneseEra} singleton, not null
* @throws DateTimeException
* if an additional era has already been registered
*/
Expand Down
33 changes: 17 additions & 16 deletions core/shared/src/main/scala-2/org/threeten/bp/DayOfWeek.scala
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ import org.threeten.bp.temporal.ValueRange
* assign different numeric values to the days, declaring Sunday to have the value 1, however this
* class provides no support for this. See {@link WeekFields} for localized week-numbering.
*
* <b>Do not use {@code ordinal()} to obtain the numeric representation of {@code DayOfWeek}. Use
* <b>Do not use {@code ordinal()} to obtain the numeric representation of {@code DayOfWeek} . Use
* {@code getValue()} instead.</b>
*
* This enum represents a common concept that is found in many calendar systems. As such, this enum
Expand All @@ -72,12 +72,13 @@ import org.threeten.bp.temporal.ValueRange
object DayOfWeek {

/**
* The singleton instance for the day-of-week of Monday. This has the numeric value of {@code 1}.
* The singleton instance for the day-of-week of Monday. This has the numeric value of {@code 1} .
*/
lazy val MONDAY = new DayOfWeek("MONDAY", 0)

/**
* The singleton instance for the day-of-week of Tuesday. This has the numeric value of {@code 2}.
* The singleton instance for the day-of-week of Tuesday. This has the numeric value of {@code 2}
* .
*/
lazy val TUESDAY = new DayOfWeek("TUESDAY", 1)

Expand All @@ -94,7 +95,7 @@ object DayOfWeek {
lazy val THURSDAY = new DayOfWeek("THURSDAY", 3)

/**
* The singleton instance for the day-of-week of Friday. This has the numeric value of {@code 5}.
* The singleton instance for the day-of-week of Friday. This has the numeric value of {@code 5} .
*/
lazy val FRIDAY = new DayOfWeek("FRIDAY", 4)

Expand All @@ -105,7 +106,7 @@ object DayOfWeek {
lazy val SATURDAY = new DayOfWeek("SATURDAY", 5)

/**
* The singleton instance for the day-of-week of Sunday. This has the numeric value of {@code 7}.
* The singleton instance for the day-of-week of Sunday. This has the numeric value of {@code 7} .
*/
lazy val SUNDAY = new DayOfWeek("SUNDAY", 6)

Expand Down Expand Up @@ -147,19 +148,19 @@ object DayOfWeek {
* Obtains an instance of {@code DayOfWeek} from a temporal object.
*
* A {@code TemporalAccessor} represents some form of date and time information. This factory
* converts the arbitrary temporal object to an instance of {@code DayOfWeek}.
* converts the arbitrary temporal object to an instance of {@code DayOfWeek} .
*
* The conversion extracts the {@link ChronoField#DAY_OF_WEEK DAY_OF_WEEK} field.
*
* This method matches the signature of the functional interface {@link TemporalQuery} allowing it
* to be used as a query via method reference, {@code DayOfWeek::from}.
* to be used as a query via method reference, {@code DayOfWeek::from} .
*
* @param temporal
* the temporal object to convert, not null
* @return
* the day-of-week, not null
* @throws DateTimeException
* if unable to convert to a { @code DayOfWeek}
* if unable to convert to a {@code DayOfWeek}
*/
def from(temporal: TemporalAccessor): DayOfWeek = {
temporal match {
Expand Down Expand Up @@ -221,7 +222,7 @@ final class DayOfWeek(name: String, ordinal: Int)
* If the field is {@link ChronoField#DAY_OF_WEEK DAY_OF_WEEK} then this method returns true. All
* other {@code ChronoField} instances will return false.
*
* If the field is not a {@code ChronoField}, then the result of this method is obtained by
* 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
* argument. Whether the field is supported is determined by the field.
*
Expand All @@ -247,7 +248,7 @@ final class DayOfWeek(name: String, ordinal: Int)
* from 1 to 7, will be returned. All other {@code ChronoField} instances will throw a {@code
* DateTimeException}.
*
* If the field is not a {@code ChronoField}, then the result of this method is obtained by
* If the field is not a {@code ChronoField} , then the result of this method is obtained by
* invoking {@code TemporalField.rangeRefinedBy(TemporalAccessor)} passing {@code this} as the
* argument. Whether the range can be obtained is determined by the field.
*
Expand All @@ -267,7 +268,7 @@ final class DayOfWeek(name: String, ordinal: Int)
field.rangeRefinedBy(this)

/**
* Gets the value of the specified field from this day-of-week as an {@code int}.
* Gets the value of the specified field from this day-of-week as an {@code int} .
*
* This queries this day-of-week for the value for the specified field. The returned value will
* always be within the valid range of values for the field. If it is not possible to return the
Expand All @@ -277,7 +278,7 @@ final class DayOfWeek(name: String, ordinal: Int)
* from 1 to 7, will be returned. All other {@code ChronoField} instances will throw a {@code
* DateTimeException}.
*
* If the field is not a {@code ChronoField}, then the result of this method is obtained by
* If the field is not a {@code ChronoField} , then the result of this method is obtained by
* invoking {@code TemporalField.getFrom(TemporalAccessor)} passing {@code this} as the argument.
* Whether the value can be obtained, and what the value represents, is determined by the field.
*
Expand All @@ -288,7 +289,7 @@ final class DayOfWeek(name: String, ordinal: Int)
* @throws DateTimeException
* if a value for the field cannot be obtained
* @throws DateTimeException
* if the range of valid values for the field exceeds an { @code int}
* if the range of valid values for the field exceeds an {@code int}
* @throws DateTimeException
* if the value is outside the range of valid values for the field
* @throws ArithmeticException
Expand All @@ -301,7 +302,7 @@ final class DayOfWeek(name: String, ordinal: Int)
range(field).checkValidIntValue(getLong(field), field)

/**
* Gets the value of the specified field from this day-of-week as a {@code long}.
* Gets the value of the specified field from this day-of-week as a {@code long} .
*
* This queries this day-of-week for the value for the specified field. If it is not possible to
* return the value, because the field is not supported or for some other reason, an exception is
Expand All @@ -311,7 +312,7 @@ final class DayOfWeek(name: String, ordinal: Int)
* from 1 to 7, will be returned. All other {@code ChronoField} instances will throw a {@code
* DateTimeException}.
*
* If the field is not a {@code ChronoField}, then the result of this method is obtained by
* If the field is not a {@code ChronoField} , then the result of this method is obtained by
* invoking {@code TemporalField.getFrom(TemporalAccessor)} passing {@code this} as the argument.
* Whether the value can be obtained, and what the value represents, is determined by the field.
*
Expand Down Expand Up @@ -406,7 +407,7 @@ final class DayOfWeek(name: String, ordinal: Int)
* The adjustment is equivalent to using {@link Temporal#with(TemporalField, long)} passing {@link
* ChronoField#DAY_OF_WEEK} as the field. Note that this adjusts forwards or backwards within a
* Monday to Sunday week. See {@link WeekFields#dayOfWeek} for localized week start days. See
* {@link TemporalAdjusters} for other adjusters with more control, such as {@code next(MONDAY)}.
* {@link TemporalAdjusters} for other adjusters with more control, such as {@code next(MONDAY)} .
*
* In most cases, it is clearer to reverse the calling pattern by using {@link
* Temporal#with(TemporalAdjuster)}: <pre> // these two lines are equivalent, but the second
Expand Down
Loading
Loading