1 | if (year != null) {↵ | | 1 | if (y != null) {↵
|
2 | month = SerialDate.stringToMonthCode(s2);↵ | | 2 | w = Week.stringToWeek(s2);↵
|
3 | if (month == -1) {↵ | | 3 | if (w == -1) {↵
|
4 | throw new TimePeriodFormatException(↵ | | 4 | throw new TimePeriodFormatException(↵
|
5 | "Can't evaluate the month."↵ | | 5 | "Can't evaluate the ↵
|
6 | );↵ | | 6 | week.");↵
|
7 | }↵ | | 7 | }↵
|
8 | result = new Month(month, year);↵ | | 8 | result = new Week(w, y);↵
|
9 | }↵ | | 9 | }↵
|
10 | else {↵ | | 10 | else {↵
|
11 | year = Month.evaluateAsYear(s2);↵ | | 11 | y = Week.evaluateAsYear(s2);↵
|
12 | if (year != null) {↵ | | 12 | if (y != null) {↵
|
13 | month = SerialDate.stringToMonthCode(s1);↵ | | 13 | w = Week.stringToWeek(s1);↵
|
14 | if (month == -1) {↵ | | 14 | if (w == -1) {↵
|
15 | throw new TimePeriodFormatException(↵ | | 15 | throw new TimePeriodFormatException(↵
|
16 | "Can't evaluate the month."↵ | | 16 | "Can't evaluate the ↵
|
17 | );↵ | | 17 | week.");↵
|
18 | }↵ | | 18 | }↵
|
19 | result = new Month(month, year);↵ | | 19 | result = new Week(w, y);↵
|
20 | }↵ | | 20 | }↵
|
21 | else {↵ | | 21 | else {↵
|
22 | throw new TimePeriodFormatException(↵ | | 22 | throw new TimePeriodFormatException(↵
|
23 | "Can't evaluate the year."↵ | | 23 | "Can't evaluate the year.");↵
|
24 | | | 24 |
|