Skip to content

Commit 1c84f33

Browse files
committed
Reformat with scalafmt 3.4.0
1 parent 99d029c commit 1c84f33

File tree

8 files changed

+67
-55
lines changed

8 files changed

+67
-55
lines changed

core/jvm/src/main/scala/org/threeten/bp/chrono/HijrahDateConfigurator.scala

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ object HijrahDateConfigurator {
5757
line = line.trim
5858
parseLine(line, num)
5959
}
60-
} finally if (br != null)
61-
br.close()
60+
} finally
61+
if (br != null)
62+
br.close()
6263
}
6364
}
6465

@@ -183,9 +184,10 @@ object HijrahDateConfigurator {
183184
if (file.isDirectory) {
184185
val f: File = new File(path + FILE_SEP + DEFAULT_CONFIG_PATH, fileName)
185186
if (f.exists)
186-
try return new FileInputStream(
187-
path + FILE_SEP + DEFAULT_CONFIG_PATH + FILE_SEP + fileName
188-
)
187+
try
188+
return new FileInputStream(
189+
path + FILE_SEP + DEFAULT_CONFIG_PATH + FILE_SEP + fileName
190+
)
189191
catch {
190192
case ioe: IOException => throw ioe
191193
}

core/shared/src/main/scala-2.x/org/threeten/bp/format/internal/TTBPDateTimeFormatterBuilder.scala

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,15 @@ object TTBPDateTimeFormatterBuilder {
4444
val length: Int = buf.length
4545
if (optional)
4646
context.startOptional()
47-
try for (pp <- printerParsers)
48-
if (!pp.print(context, buf)) {
49-
buf.setLength(length)
50-
return true
51-
} finally if (optional)
52-
context.endOptional()
47+
try
48+
for (pp <- printerParsers)
49+
if (!pp.print(context, buf)) {
50+
buf.setLength(length)
51+
return true
52+
}
53+
finally
54+
if (optional)
55+
context.endOptional()
5356
true
5457
}
5558

core/shared/src/main/scala/org/threeten/bp/chrono/ChronoLocalDate.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ trait ChronoLocalDate extends Temporal with TemporalAdjuster with Ordered[Chrono
491491
* This method differs from the comparison in {@link #compareTo} in that it only compares the
492492
* underlying date and not the chronology. This allows dates in different calendar systems to be
493493
* compared based on the time-line position. This is equivalent to using {@code date1.toEpochDay()
494-
* == date2.toEpochDay()}.
494+
* \== date2.toEpochDay()}.
495495
*
496496
* @param other
497497
* the other date to compare to, not null

core/shared/src/main/scala/org/threeten/bp/chrono/ChronoLocalDateImpl.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ import org.threeten.bp.temporal.TemporalUnit
6565
*
6666
* // Print the Hijrah date and calendar ChronoLocalDate date = Chrono.of("Hijrah").dateNow(); int
6767
* day = date.get(ChronoField.DAY_OF_MONTH); int dow = date.get(ChronoField.DAY_OF_WEEK); int month
68-
* = date.get(ChronoField.MONTH_OF_YEAR); int year = date.get(ChronoField.YEAR); System.out.printf("
69-
* Today is %s %s %d-%s-%d%n", date.getChrono().getID(), dow, day, month, year);
68+
* \= date.get(ChronoField.MONTH_OF_YEAR); int year = date.get(ChronoField.YEAR);
69+
* System.out.printf(" Today is %s %s %d-%s-%d%n", date.getChrono().getID(), dow, day, month, year);
7070
*
7171
* // Print today's date and the last day of the year ChronoLocalDate now1 =
7272
* Chrono.of("Hijrah").dateNow(); ChronoLocalDate first = now1.with(ChronoField.DAY_OF_MONTH, 1)

core/shared/src/main/scala/org/threeten/bp/temporal/Temporal.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ trait Temporal extends TemporalAccessor {
251251
*
252252
* Some example code indicating how and why this method is used: <pre> date = date.minus(period);
253253
* // subtract a Period instance date = date.minus(duration); // subtract a Duration instance date
254-
* = date.minus(workingDays(6)); // example user-written workingDays method </pre>
254+
* \= date.minus(workingDays(6)); // example user-written workingDays method </pre>
255255
*
256256
* Note that calling {@code plus} followed by {@code minus} is not guaranteed to return the same
257257
* date-time.

tests/shared/src/test/scala/org/threeten/bp/TestLocalDateTime.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2831,12 +2831,11 @@ class TestLocalDateTime
28312831
}
28322832
}
28332833

2834-
val provider_sampleDateTimes: List[List[Int]] = {
2834+
val provider_sampleDateTimes: List[List[Int]] =
28352835
for {
28362836
d <- provider_sampleDates
28372837
h <- provider_sampleTimes
28382838
} yield d ::: h
2839-
}
28402839

28412840
test("test_equals_true") {
28422841
provider_sampleDateTimes.foreach {

tests/shared/src/test/scala/org/threeten/bp/TestZonedDateTime.scala

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -675,10 +675,11 @@ class TestZonedDateTime
675675

676676
test("factory_ofStrict_LDT_ZI_ZO_inGap") {
677677
assertThrows[DateTimeException] {
678-
try ZonedDateTime.ofStrict(TEST_PARIS_GAP_2008_03_30_02_30,
679-
TestZonedDateTime.OFFSET_0100,
680-
TestZonedDateTime.ZONE_PARIS
681-
)
678+
try
679+
ZonedDateTime.ofStrict(TEST_PARIS_GAP_2008_03_30_02_30,
680+
TestZonedDateTime.OFFSET_0100,
681+
TestZonedDateTime.ZONE_PARIS
682+
)
682683
catch {
683684
case ex: DateTimeException =>
684685
assertEquals(ex.getMessage.contains(" gap"), true)
@@ -689,10 +690,11 @@ class TestZonedDateTime
689690

690691
test("factory_ofStrict_LDT_ZI_ZO_inOverlap_invalidOfset") {
691692
assertThrows[DateTimeException] {
692-
try ZonedDateTime.ofStrict(TEST_PARIS_OVERLAP_2008_10_26_02_30,
693-
TestZonedDateTime.OFFSET_0130,
694-
TestZonedDateTime.ZONE_PARIS
695-
)
693+
try
694+
ZonedDateTime.ofStrict(TEST_PARIS_OVERLAP_2008_10_26_02_30,
695+
TestZonedDateTime.OFFSET_0130,
696+
TestZonedDateTime.ZONE_PARIS
697+
)
696698
catch {
697699
case ex: DateTimeException =>
698700
assertEquals(ex.getMessage.contains(" is not valid for "), true)
@@ -703,10 +705,11 @@ class TestZonedDateTime
703705

704706
test("factory_ofStrict_LDT_ZI_ZO_invalidOffset") {
705707
assertThrows[DateTimeException] {
706-
try ZonedDateTime.ofStrict(TEST_LOCAL_2008_06_30_11_30_59_500,
707-
TestZonedDateTime.OFFSET_0130,
708-
TestZonedDateTime.ZONE_PARIS
709-
)
708+
try
709+
ZonedDateTime.ofStrict(TEST_LOCAL_2008_06_30_11_30_59_500,
710+
TestZonedDateTime.OFFSET_0130,
711+
TestZonedDateTime.ZONE_PARIS
712+
)
710713
catch {
711714
case ex: DateTimeException =>
712715
assertEquals(ex.getMessage.contains(" is not valid for "), true)

tests/shared/src/test/scala/org/threeten/bp/format/TestDateTimeFormatter.scala

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,8 @@ class TestDateTimeFormatter
173173

174174
test("test_parse_Class_String_parseError") {
175175
assertThrows[DateTimeParseException] {
176-
try TestDateTimeFormatter.DATE_FORMATTER.parse("ONE2012 07 XX",
177-
toTemporalQuery(LocalDate.from)
178-
)
176+
try
177+
TestDateTimeFormatter.DATE_FORMATTER.parse("ONE2012 07 XX", toTemporalQuery(LocalDate.from))
179178
catch {
180179
case ex: DateTimeParseException =>
181180
assertEquals(ex.getMessage.contains("could not be parsed"), true)
@@ -189,10 +188,11 @@ class TestDateTimeFormatter
189188

190189
test("test_parse_Class_String_parseErrorLongText") {
191190
assertThrows[DateTimeParseException] {
192-
try TestDateTimeFormatter.DATE_FORMATTER.parse(
193-
"ONEXXX67890123456789012345678901234567890123456789012345678901234567890123456789",
194-
toTemporalQuery(LocalDate.from)
195-
)
191+
try
192+
TestDateTimeFormatter.DATE_FORMATTER.parse(
193+
"ONEXXX67890123456789012345678901234567890123456789012345678901234567890123456789",
194+
toTemporalQuery(LocalDate.from)
195+
)
196196
catch {
197197
case ex: DateTimeParseException =>
198198
assertEquals(ex.getMessage.contains("could not be parsed"), true)
@@ -213,9 +213,10 @@ class TestDateTimeFormatter
213213

214214
test("test_parse_Class_String_parseIncomplete") {
215215
assertThrows[DateTimeParseException] {
216-
try TestDateTimeFormatter.DATE_FORMATTER.parse("ONE2012 07 27SomethingElse",
217-
toTemporalQuery(LocalDate.from)
218-
)
216+
try
217+
TestDateTimeFormatter.DATE_FORMATTER.parse("ONE2012 07 27SomethingElse",
218+
toTemporalQuery(LocalDate.from)
219+
)
219220
catch {
220221
case ex: DateTimeParseException =>
221222
assertEquals(ex.getMessage.contains("could not be parsed"), true)
@@ -260,10 +261,11 @@ class TestDateTimeFormatter
260261
test("test_parseBest_String_parseError") {
261262
assertThrows[DateTimeParseException] {
262263
val test: DateTimeFormatter = DateTimeFormatter.ofPattern("uuuu-MM[-dd]")
263-
try test.parseBest("2011-XX-30",
264-
toTemporalQuery(LocalDate.from),
265-
toTemporalQuery(YearMonth.from)
266-
)
264+
try
265+
test.parseBest("2011-XX-30",
266+
toTemporalQuery(LocalDate.from),
267+
toTemporalQuery(YearMonth.from)
268+
)
267269
catch {
268270
case ex: DateTimeParseException =>
269271
assertEquals(ex.getMessage.contains("could not be parsed"), true)
@@ -279,11 +281,12 @@ class TestDateTimeFormatter
279281
assertThrows[DateTimeParseException] {
280282
val test: DateTimeFormatter =
281283
fmt.withLocale(Locale.ENGLISH).withDecimalStyle(DecimalStyle.STANDARD)
282-
try test.parseBest(
283-
"ONEXXX67890123456789012345678901234567890123456789012345678901234567890123456789",
284-
toTemporalQuery(LocalDate.from),
285-
toTemporalQuery(YearMonth.from)
286-
)
284+
try
285+
test.parseBest(
286+
"ONEXXX67890123456789012345678901234567890123456789012345678901234567890123456789",
287+
toTemporalQuery(LocalDate.from),
288+
toTemporalQuery(YearMonth.from)
289+
)
287290
catch {
288291
case ex: DateTimeParseException =>
289292
assertEquals(ex.getMessage.contains("could not be parsed"), true)
@@ -306,10 +309,11 @@ class TestDateTimeFormatter
306309
assertThrows[DateTimeParseException] {
307310
val test: DateTimeFormatter =
308311
fmt.withLocale(Locale.ENGLISH).withDecimalStyle(DecimalStyle.STANDARD)
309-
try test.parseBest("ONE30SomethingElse",
310-
toTemporalQuery(YearMonth.from),
311-
toTemporalQuery(LocalDate.from)
312-
)
312+
try
313+
test.parseBest("ONE30SomethingElse",
314+
toTemporalQuery(YearMonth.from),
315+
toTemporalQuery(LocalDate.from)
316+
)
313317
catch {
314318
case ex: DateTimeParseException =>
315319
assertEquals(ex.getMessage.contains("could not be parsed"), true)
@@ -456,9 +460,10 @@ class TestDateTimeFormatter
456460
val test: DateTimeFormatter =
457461
fmt.withLocale(Locale.ENGLISH).withDecimalStyle(DecimalStyle.STANDARD)
458462
val format: Format = test.toFormat
459-
try format.parseObject(
460-
"ONEXXX67890123456789012345678901234567890123456789012345678901234567890123456789"
461-
)
463+
try
464+
format.parseObject(
465+
"ONEXXX67890123456789012345678901234567890123456789012345678901234567890123456789"
466+
)
462467
catch {
463468
case ex: DateTimeParseException =>
464469
assertEquals(ex.getMessage.contains(

0 commit comments

Comments
 (0)