chore: 优化 JSR305 注解的使用

This commit is contained in:
2025-03-22 15:30:29 +08:00
parent 90da2b8eaa
commit 2f1df1b188
22 changed files with 155 additions and 134 deletions

View File

@@ -36,6 +36,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
@Slf4j
@SuppressWarnings("null")
public class YearQuarterTests {
// ================================
@@ -588,7 +589,7 @@ public class YearQuarterTests {
Year.MIN_VALUE,
Year.MAX_VALUE,
})
void of_ValidYearMonth_CreatesYearMnoth_Q1(int year) {
void of_ValidYearMonth_CreatesYearMonth_Q1(int year) {
{
YearMonth yearMonth = YearMonth.of(year, 1);
YearQuarter yearQuarter = YearQuarter.of(yearMonth);
@@ -619,7 +620,7 @@ public class YearQuarterTests {
Year.MIN_VALUE,
Year.MAX_VALUE,
})
void of_ValidYearMonth_CreatesYearMnoth_Q2(int year) {
void of_ValidYearMonth_CreatesYearMonth_Q2(int year) {
{
YearMonth yearMonth = YearMonth.of(year, 4);
YearQuarter yearQuarter = YearQuarter.of(yearMonth);
@@ -650,7 +651,7 @@ public class YearQuarterTests {
Year.MIN_VALUE,
Year.MAX_VALUE,
})
void of_ValidYearMonth_CreatesYearMnoth_Q3(int year) {
void of_ValidYearMonth_CreatesYearMonth_Q3(int year) {
{
YearMonth yearMonth = YearMonth.of(year, 7);
YearQuarter yearQuarter = YearQuarter.of(yearMonth);
@@ -681,7 +682,7 @@ public class YearQuarterTests {
Year.MIN_VALUE,
Year.MAX_VALUE,
})
void of_ValidYearMonth_CreatesYearMnoth_Q4(int year) {
void of_ValidYearMonth_CreatesYearMonth_Q4(int year) {
{
YearMonth yearMonth = YearMonth.of(year, 10);
YearQuarter yearQuarter = YearQuarter.of(yearMonth);
@@ -712,7 +713,7 @@ public class YearQuarterTests {
Year.MIN_VALUE,
Year.MAX_VALUE,
})
void of_NullYearMonth_CreatesYearMnoth_Q4(int year) {
void of_NullYearMonth_CreatesYearMonth_Q4(int year) {
YearMonth yearMonth = null;
assertThrows(NullPointerException.class,
() -> YearQuarter.of(yearMonth));

View File

@@ -27,6 +27,7 @@ import org.junit.jupiter.api.Test;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@SuppressWarnings("null")
public class BigDecimalsTests {
@Test

View File

@@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
@SuppressWarnings("deprecation")
@SuppressWarnings({"deprecation", "null"})
public
class EnumToolsTests {

View File

@@ -35,6 +35,7 @@ import org.junit.jupiter.api.Test;
/**
* {@link OptionalTools} 单元测试
*/
@SuppressWarnings("null")
public
class OptionalToolsTests {

View File

@@ -28,6 +28,7 @@ import org.junit.jupiter.api.Test;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@SuppressWarnings("null")
public
class RegexToolsTests {

View File

@@ -28,6 +28,7 @@ import java.util.Arrays;
import org.junit.jupiter.api.Test;
@SuppressWarnings("null")
public
class StringToolsTests {

View File

@@ -39,6 +39,7 @@ import cn.hutool.core.util.ObjectUtil;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@SuppressWarnings("null")
class TreeBuilderTests {
private static final Logger log = LoggerFactory.getLogger(TreeBuilderTests.class);