File tree Expand file tree Collapse file tree 6 files changed +16
-14
lines changed
main/java/ru/mystamps/web
test/java/ru/mystamps/web Expand file tree Collapse file tree 6 files changed +16
-14
lines changed Original file line number Diff line number Diff line change 494
494
<dockerfile .plugin.version>1.4.6</dockerfile .plugin.version>
495
495
<enforcer .plugin.version>1.4.1</enforcer .plugin.version>
496
496
<error-prone-javac .version>9+181-r4173-1</error-prone-javac .version>
497
- <error-prone .version>2.3.2 </error-prone .version>
497
+ <error-prone .version>2.3.3 </error-prone .version>
498
498
<failsafe .plugin.version>2.22.0</failsafe .plugin.version>
499
499
<fest .assert.version>2.0M8</fest .assert.version>
500
500
<gmavenplus .plugin.version>1.5</gmavenplus .plugin.version>
804
804
<!--
805
805
The following checks have been disabled:
806
806
- MissingOverride: produce false positives with @Getter from Lombok
807
- - ParameterName: workaround for https://github.com/google/error-prone/issues/780
807
+ - MixedMutabilityReturnType: because I like to use Collections.empty*() methods
808
808
-->
809
- <compilerArg >-Xplugin:ErrorProne -Xep:MissingOverride:OFF -Xep:ParameterName :OFF</compilerArg >
809
+ <compilerArg >-Xplugin:ErrorProne -Xep:MissingOverride:OFF -Xep:MixedMutabilityReturnType :OFF</compilerArg >
810
810
</compilerArgs >
811
811
<annotationProcessorPaths >
812
812
<path >
Original file line number Diff line number Diff line change @@ -33,9 +33,7 @@ public class ReplaceRepeatingSpacesEditor extends PropertyEditorSupport {
33
33
34
34
@ Override
35
35
public void setAsText (String name ) throws IllegalArgumentException {
36
- String text = name ;
37
-
38
- text = name .trim ();
36
+ String text = name .trim ();
39
37
40
38
if (text .contains (" " )) {
41
39
text = REPEATING_SPACES .matcher (text ).replaceAll (" " );
Original file line number Diff line number Diff line change 24
24
import java .time .LocalDate ;
25
25
import java .time .Year ;
26
26
import java .time .YearMonth ;
27
+ import java .time .ZoneOffset ;
27
28
28
29
/**
29
30
* @author Sergey Chechenev
@@ -73,7 +74,7 @@ private static boolean yearInFuture(AddSeriesDto dto) {
73
74
}
74
75
75
76
return Year .of (dto .getYear ())
76
- .isAfter (Year .now ());
77
+ .isAfter (Year .now (ZoneOffset . UTC ));
77
78
}
78
79
79
80
private static boolean yearAndMonthInFuture (AddSeriesDto dto ) {
@@ -82,7 +83,7 @@ private static boolean yearAndMonthInFuture(AddSeriesDto dto) {
82
83
}
83
84
84
85
return YearMonth .of (dto .getYear (), dto .getMonth ())
85
- .isAfter (YearMonth .now ());
86
+ .isAfter (YearMonth .now (ZoneOffset . UTC ));
86
87
}
87
88
88
89
private static boolean dateInFuture (AddSeriesDto dto ) {
@@ -91,7 +92,7 @@ private static boolean dateInFuture(AddSeriesDto dto) {
91
92
}
92
93
93
94
return LocalDate .of (dto .getYear (), dto .getMonth (), dto .getDay ())
94
- .isAfter (LocalDate .now ());
95
+ .isAfter (LocalDate .now (ZoneOffset . UTC ));
95
96
}
96
97
97
98
}
Original file line number Diff line number Diff line change 64
64
import javax .validation .groups .Default ;
65
65
import java .io .IOException ;
66
66
import java .time .Year ;
67
+ import java .time .ZoneOffset ;
67
68
import java .util .Collections ;
68
69
import java .util .HashMap ;
69
70
import java .util .LinkedHashMap ;
80
81
@ SuppressWarnings ({ "PMD.AvoidDuplicateLiterals" , "PMD.TooManyMethods" , "PMD.GodClass" })
81
82
public class SeriesController {
82
83
83
- private static final Integer CURRENT_YEAR = Integer .valueOf (Year .now ().getValue ());
84
-
84
+ private static final Integer CURRENT_YEAR ;
85
85
private static final Map <Integer , Integer > YEARS ;
86
86
87
87
private final CategoryService categoryService ;
@@ -93,6 +93,7 @@ public class SeriesController {
93
93
private final ParticipantService participantService ;
94
94
95
95
static {
96
+ CURRENT_YEAR = Integer .valueOf (Year .now (ZoneOffset .UTC ).getValue ());
96
97
YEARS = new LinkedHashMap <>();
97
98
for (Integer i = CURRENT_YEAR ; i >= MIN_RELEASE_YEAR ; i --) {
98
99
YEARS .put (i , i );
Original file line number Diff line number Diff line change 53
53
import ru .mystamps .web .tests .Random ;
54
54
import ru .mystamps .web .util .SlugUtils ;
55
55
56
- import java .math .BigDecimal ;
57
56
import java .nio .charset .StandardCharsets ;
58
57
import java .util .Collections ;
59
58
import java .util .Date ;
@@ -77,7 +76,6 @@ public final class TestObjects {
77
76
78
77
private static final String TEST_NAME = "Test Name" ;
79
78
private static final String TEST_URL = "test.example.org" ;
80
- private static final BigDecimal TEST_PRICE = new BigDecimal ("100.99" );
81
79
82
80
private static final String TEST_ENTITY_NAME = TEST_NAME ;
83
81
private static final String TEST_ENTITY_SLUG = "test-slug" ;
Original file line number Diff line number Diff line change 34
34
import java .text .ParseException ;
35
35
import java .text .SimpleDateFormat ;
36
36
import java .time .Year ;
37
+ import java .time .ZoneOffset ;
37
38
import java .util .Arrays ;
38
39
import java .util .Date ;
39
40
import java .util .List ;
@@ -187,7 +188,10 @@ public static String sellerName() {
187
188
}
188
189
189
190
public static Integer issueYear () {
190
- return between (ValidationRules .MIN_RELEASE_YEAR , Year .now ().getValue ()).integer ();
191
+ return between (
192
+ ValidationRules .MIN_RELEASE_YEAR ,
193
+ Year .now (ZoneOffset .UTC ).getValue ()
194
+ ).integer ();
191
195
}
192
196
193
197
public static Integer quantity () {
You can’t perform that action at this time.
0 commit comments