Skip to content

Commit 6146fcf

Browse files
authored
YerushalmiYomiCalculator - Add default constructor to avoid warnings on recent JDKs
- Add default constructor to avoid warnings on recent JDKs - Minor whitespace and documentation changes
1 parent 84472a6 commit 6146fcf

File tree

1 file changed

+22
-16
lines changed

1 file changed

+22
-16
lines changed

src/main/java/com/kosherjava/zmanim/hebrewcalendar/YerushalmiYomiCalculator.java

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Zmanim Java API
3-
* Copyright (C) 2017 - 2023 Eliyahu Hershfeld
3+
* Copyright (C) 2017 - 2025 Eliyahu Hershfeld
44
*
55
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
66
* Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
@@ -21,10 +21,10 @@
2121

2222
/**
2323
* This class calculates the <a href="https://en.wikipedia.org/wiki/Jerusalem_Talmud">Talmud Yerusalmi</a> <a href=
24-
* "https://en.wikipedia.org/wiki/Daf_Yomi">Daf Yomi</a> page ({@link Daf}) for the given date.
24+
* "https://en.wikipedia.org/wiki/Daf_Yomi">Daf Yomi</a> page ({@link Daf}) for the a given date.
2525
*
2626
* @author &copy; elihaidv
27-
* @author &copy; Eliyahu Hershfeld 2017 - 2023
27+
* @author &copy; Eliyahu Hershfeld 2017 - 2025
2828
*/
2929
public class YerushalmiYomiCalculator {
3030

@@ -41,6 +41,13 @@ public class YerushalmiYomiCalculator {
4141
68, 37, 34, 44, 31, 59, 26, 33, 28, 20, 13, 92, 65, 71, 22, 22, 42, 26, 26, 33, 34, 22,
4242
19, 85, 72, 47, 40, 47, 54, 48, 44, 37, 34, 44, 9, 57, 37, 19, 13};
4343

44+
/**
45+
* Default constructor.
46+
*/
47+
public YerushalmiYomiCalculator() {
48+
// nothing here
49+
}
50+
4451
/**
4552
* Returns the <a href="https://en.wikipedia.org/wiki/Daf_Yomi">Daf Yomi</a>
4653
* <a href="https://en.wikipedia.org/wiki/Jerusalem_Talmud">Yerusalmi</a> page ({@link Daf}) for a given date.
@@ -95,26 +102,25 @@ public static Daf getDafYomiYerushalmi(JewishCalendar calendar) {
95102
int total = dafNo - specialDays;
96103

97104
// Finally find the daf.
98-
for (int i : BLATT_PER_MASECHTA) {
99-
100-
if (total < i) {
101-
dafYomi = new Daf(masechta, total + 1);
102-
break;
103-
}
104-
total -= i;
105-
masechta++;
106-
}
105+
for (int i : BLATT_PER_MASECHTA) {
106+
if (total < i) {
107+
dafYomi = new Daf(masechta, total + 1);
108+
break;
109+
}
110+
total -= i;
111+
masechta++;
112+
}
107113

108114
return dafYomi;
109115
}
110116

111117
/**
112-
* Return the number of special days (Yom Kippur and Tisha Beav, where there are no dafim on these days),
113-
* from the start date (as a <code>Calendar</code>) given until the end date (also as a <code>Calendar</code>).
118+
* Return the number of special days (Yom Kippur and Tisha Beav, where there are no dafim), between the start date
119+
* (as a <code>Calendar</code>) and end date (also as a <code>Calendar</code>).
114120
*
115121
* @param start date to start calculating from
116122
* @param end date to finish calculating at
117-
* @return the number of special days between the start time and end time
123+
* @return the number of special days between the start and end dates
118124
*/
119125
private static int getNumOfSpecialDays(Calendar start, Calendar end) {
120126

@@ -153,7 +159,7 @@ private static int getNumOfSpecialDays(Calendar start, Calendar end) {
153159
* @param end the end date
154160
* @return if the date is between the start and end dates
155161
*/
156-
private static boolean isBetween(Calendar start, Calendar date, Calendar end) {
162+
private static boolean isBetween(Calendar start, Calendar date, Calendar end ) {
157163
return start.before(date) && end.after(date);
158164
}
159165

0 commit comments

Comments
 (0)