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.3 #526

Open
wants to merge 3 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.3
45112b9ff729c0b774bed69b9d1bcaa99e3873f4
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.3"
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
4 changes: 2 additions & 2 deletions core/js/src/main/scala/java/util/SimpleTimeZone.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package java.util

class SimpleTimeZone(rawOffset: Int, var ID: String) extends TimeZone {
override def getRawOffset = rawOffset
override def getRawOffset = rawOffset
/* concrete methods */
override def getID: String = ID
override def getID: String = ID
override def setID(id: String): Unit = ID = id

}
6 changes: 3 additions & 3 deletions core/js/src/main/scala/java/util/TimeZone.scala
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ object TimeZone {
new SimpleTimeZone(offsetInMillis, timeZone)
}

def getDefault: TimeZone = default
def getDefault: TimeZone = default
def setDefault(timeZone: TimeZone): Unit = default = timeZone

def getTimeZone(timeZone: String): TimeZone = getTimeZone(ZoneId.of(timeZone))
def getTimeZone(zoneId: ZoneId): TimeZone = {
def getTimeZone(zoneId: ZoneId): TimeZone = {
val rules = zoneId.getRules
val offsetInMillis = rules.getStandardOffset(Instant.now).getTotalSeconds * 1000
new SimpleTimeZone(offsetInMillis, zoneId.getId)
Expand All @@ -80,7 +80,7 @@ abstract class TimeZone extends Serializable with Cloneable {
// def useDaylightTime: Boolean

/* concrete methods */
def getID: String = ID
def getID: String = ID
def setID(id: String): Unit = ID = id

def getDisplayName(daylight: Boolean, style: Int, locale: Locale): String = {
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
4 changes: 2 additions & 2 deletions core/native/src/main/scala/java/util/SimpleTimeZone.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package java.util

class SimpleTimeZone(rawOffset: Int, var ID: String) extends TimeZone {
override def getRawOffset = rawOffset
override def getRawOffset = rawOffset
/* concrete methods */
override def getID: String = ID
override def getID: String = ID
override def setID(id: String): Unit = ID = id

}
6 changes: 3 additions & 3 deletions core/native/src/main/scala/java/util/TimeZone.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ object TimeZone {
// TODO: implement this functionality, perhaps using https://github.com/scala-native/scala-native/blob/master/posixlib/src/main/scala/scala/scalanative/posix/time.scala
new SimpleTimeZone(0, "UTC")

def getDefault: TimeZone = default
def getDefault: TimeZone = default
def setDefault(timeZone: TimeZone): Unit = default = timeZone

def getTimeZone(timeZone: String): TimeZone = getTimeZone(ZoneId.of(timeZone))
def getTimeZone(zoneId: ZoneId): TimeZone = {
def getTimeZone(zoneId: ZoneId): TimeZone = {
val rules = zoneId.getRules
val offsetInMillis = rules.getStandardOffset(Instant.now).getTotalSeconds * 1000
new SimpleTimeZone(offsetInMillis, zoneId.getId)
Expand All @@ -42,7 +42,7 @@ abstract class TimeZone extends Serializable with Cloneable {
// def useDaylightTime: Boolean

/* concrete methods */
def getID: String = ID
def getID: String = ID
def setID(id: String): Unit = ID = id

def getDisplayName(daylight: Boolean, style: Int, locale: Locale): String = {
Expand Down
Loading
Loading