Skip to content

Commit

Permalink
Replace JSR-305 annotations with Checker ones (#199)
Browse files Browse the repository at this point in the history
Closes #195
  • Loading branch information
sleberknight authored Mar 7, 2023
1 parent b30ed12 commit bf3156c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import com.google.common.annotations.Beta;
import lombok.extern.slf4j.Slf4j;

import javax.annotation.Nullable;
import org.checkerframework.checker.nullness.qual.Nullable;

import java.io.Closeable;
import java.time.Duration;
import java.util.concurrent.Executors;
Expand Down
15 changes: 8 additions & 7 deletions src/main/java/org/kiwiproject/beta/dao/DaoHelpers.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@
import com.google.common.annotations.Beta;
import lombok.experimental.UtilityClass;
import lombok.extern.slf4j.Slf4j;

import org.checkerframework.checker.nullness.qual.Nullable;
import org.kiwiproject.collect.KiwiArrays;
import org.kiwiproject.collect.KiwiLists;
import org.kiwiproject.spring.data.KiwiSort;
import org.kiwiproject.spring.data.KiwiSort.Direction;
import org.kiwiproject.spring.data.PagingRequest;
import org.springframework.data.domain.Sort;

import javax.annotation.Nullable;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
Expand Down Expand Up @@ -90,7 +91,7 @@ public static void addSorts(StringBuilder query,
secondarySortDirection);
}

private static KiwiSort.Direction toKiwiSortDirectionOrNull(@Nullable Sort.Direction sortDirection) {
private static KiwiSort.Direction toKiwiSortDirectionOrNull(Sort.@Nullable Direction sortDirection) {
return isNull(sortDirection) ? null : toKiwiSortDirection(sortDirection);
}

Expand Down Expand Up @@ -124,7 +125,7 @@ public static void addSort(StringBuilder query,
public static void addSort(StringBuilder query,
AllowedFields allowedSortFields,
String sortField,
@Nullable KiwiSort.Direction sortDirection) {
@Nullable Direction sortDirection) {

addSorts(query, allowedSortFields, sortField, sortDirection, null, null);
}
Expand Down Expand Up @@ -167,9 +168,9 @@ public static void addSorts(
StringBuilder query,
AllowedFields allowedSortFields,
@Nullable String primarySortField,
@Nullable KiwiSort.Direction primarySortDirection,
@Nullable Direction primarySortDirection,
@Nullable String secondarySortField,
@Nullable KiwiSort.Direction secondarySortDirection) {
@Nullable Direction secondarySortDirection) {

checkQueryNotNull(query);
checkAllowedSortFieldsNotNull(allowedSortFields);
Expand Down Expand Up @@ -203,7 +204,7 @@ public static void addSorts(

private static void logWarningIfOnlySecondarySort(String primarySortField,
String secondarySortField,
@Nullable KiwiSort.Direction secondarySortDirection) {
@Nullable Direction secondarySortDirection) {

if (onlyContainsSecondarySort(primarySortField, secondarySortField)) {
LOG.warn("A secondary sort ({} {}) was specified without a primary sort. Ignoring.",
Expand Down Expand Up @@ -301,7 +302,7 @@ private static void addSort(StringBuilder query,
AllowedFields allowedSortFields,
Connector connector,
String sortField,
@Nullable KiwiSort.Direction sortDirection) {
KiwiSort.@Nullable Direction sortDirection) {

checkQueryNotNull(query);
checkAllowedSortFieldsNotNull(allowedSortFields);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import org.slf4j.Logger;
import org.slf4j.event.Level;

import javax.annotation.concurrent.NotThreadSafe;
import java.time.Duration;

/**
Expand All @@ -20,7 +19,6 @@
* <p>
* <em>Currently, this is intended only to be used within a single thread.</em>
*/
@NotThreadSafe
@Beta
public class TimestampingLogger {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.kiwiproject.collect.KiwiLists.first;

import org.checkerframework.checker.nullness.qual.Nullable;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
Expand All @@ -15,7 +16,6 @@
import org.slf4j.LoggerFactory;
import org.slf4j.event.Level;

import javax.annotation.Nullable;
import java.io.IOException;

/**
Expand Down

0 comments on commit bf3156c

Please sign in to comment.