From 225325768bc78004e7808044b126f34b3c0e423f Mon Sep 17 00:00:00 2001 From: Edson Amaya Date: Mon, 16 Sep 2024 14:32:44 -0600 Subject: [PATCH] Change Nonnull & Nullable annotation to jakarta.annotation (#488) --- analytics-core/pom.xml | 5 +++++ .../java/com/segment/analytics/messages/GroupMessage.java | 2 +- .../java/com/segment/analytics/messages/IdentifyMessage.java | 2 +- .../main/java/com/segment/analytics/messages/Message.java | 4 ++-- .../java/com/segment/analytics/messages/PageMessage.java | 2 +- .../java/com/segment/analytics/messages/ScreenMessage.java | 2 +- .../java/com/segment/analytics/messages/TrackMessage.java | 2 +- analytics/pom.xml | 5 +++++ .../com/segment/analytics/AnalyticsRequestInterceptor.java | 2 +- .../java/com/segment/analytics/internal/FlushMessage.java | 4 ++-- .../java/com/segment/analytics/internal/StopMessage.java | 4 ++-- 11 files changed, 22 insertions(+), 12 deletions(-) diff --git a/analytics-core/pom.xml b/analytics-core/pom.xml index 974b079b..b3ff7932 100644 --- a/analytics-core/pom.xml +++ b/analytics-core/pom.xml @@ -40,6 +40,11 @@ guava provided + + jakarta.annotation + jakarta.annotation-api + 2.1.1 + junit diff --git a/analytics-core/src/main/java/com/segment/analytics/messages/GroupMessage.java b/analytics-core/src/main/java/com/segment/analytics/messages/GroupMessage.java index 55cbb04d..b51ddf0c 100644 --- a/analytics-core/src/main/java/com/segment/analytics/messages/GroupMessage.java +++ b/analytics-core/src/main/java/com/segment/analytics/messages/GroupMessage.java @@ -2,9 +2,9 @@ import com.google.auto.value.AutoValue; import com.segment.analytics.gson.AutoGson; +import jakarta.annotation.Nullable; import java.util.Date; import java.util.Map; -import javax.annotation.Nullable; /** * The group API call is how you associate an individual user with a group—be it a company, diff --git a/analytics-core/src/main/java/com/segment/analytics/messages/IdentifyMessage.java b/analytics-core/src/main/java/com/segment/analytics/messages/IdentifyMessage.java index 024b2e85..dcfa0596 100644 --- a/analytics-core/src/main/java/com/segment/analytics/messages/IdentifyMessage.java +++ b/analytics-core/src/main/java/com/segment/analytics/messages/IdentifyMessage.java @@ -2,9 +2,9 @@ import com.google.auto.value.AutoValue; import com.segment.analytics.gson.AutoGson; +import jakarta.annotation.Nullable; import java.util.Date; import java.util.Map; -import javax.annotation.Nullable; /** * The identify call ties a customer and their actions to a recognizable ID and traits like their diff --git a/analytics-core/src/main/java/com/segment/analytics/messages/Message.java b/analytics-core/src/main/java/com/segment/analytics/messages/Message.java index 4e6197ba..9fdafa2e 100644 --- a/analytics-core/src/main/java/com/segment/analytics/messages/Message.java +++ b/analytics-core/src/main/java/com/segment/analytics/messages/Message.java @@ -1,9 +1,9 @@ package com.segment.analytics.messages; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.util.Date; import java.util.Map; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; /** * Encapsulates properties common to all messages. Although not enforced by the compiler, either the diff --git a/analytics-core/src/main/java/com/segment/analytics/messages/PageMessage.java b/analytics-core/src/main/java/com/segment/analytics/messages/PageMessage.java index 0c3d4a3b..2c74e32f 100644 --- a/analytics-core/src/main/java/com/segment/analytics/messages/PageMessage.java +++ b/analytics-core/src/main/java/com/segment/analytics/messages/PageMessage.java @@ -2,9 +2,9 @@ import com.google.auto.value.AutoValue; import com.segment.analytics.gson.AutoGson; +import jakarta.annotation.Nullable; import java.util.Date; import java.util.Map; -import javax.annotation.Nullable; /** * The page call lets you record whenever a user sees a page of your website, along with any diff --git a/analytics-core/src/main/java/com/segment/analytics/messages/ScreenMessage.java b/analytics-core/src/main/java/com/segment/analytics/messages/ScreenMessage.java index 4ae95091..3b4f1a7b 100644 --- a/analytics-core/src/main/java/com/segment/analytics/messages/ScreenMessage.java +++ b/analytics-core/src/main/java/com/segment/analytics/messages/ScreenMessage.java @@ -2,9 +2,9 @@ import com.google.auto.value.AutoValue; import com.segment.analytics.gson.AutoGson; +import jakarta.annotation.Nullable; import java.util.Date; import java.util.Map; -import javax.annotation.Nullable; /** * The screen call lets you record whenever a user sees a screen, along with any properties about diff --git a/analytics-core/src/main/java/com/segment/analytics/messages/TrackMessage.java b/analytics-core/src/main/java/com/segment/analytics/messages/TrackMessage.java index 6caddf5f..fde6f290 100644 --- a/analytics-core/src/main/java/com/segment/analytics/messages/TrackMessage.java +++ b/analytics-core/src/main/java/com/segment/analytics/messages/TrackMessage.java @@ -2,9 +2,9 @@ import com.google.auto.value.AutoValue; import com.segment.analytics.gson.AutoGson; +import jakarta.annotation.Nullable; import java.util.Date; import java.util.Map; -import javax.annotation.Nullable; /** * The track API call is how you record any actions your users perform, along with any properties diff --git a/analytics/pom.xml b/analytics/pom.xml index 06995866..127fd658 100644 --- a/analytics/pom.xml +++ b/analytics/pom.xml @@ -68,6 +68,11 @@ mockito-core test + + jakarta.annotation + jakarta.annotation-api + 2.1.1 + diff --git a/analytics/src/main/java/com/segment/analytics/AnalyticsRequestInterceptor.java b/analytics/src/main/java/com/segment/analytics/AnalyticsRequestInterceptor.java index e9b9d561..ff50fc3b 100644 --- a/analytics/src/main/java/com/segment/analytics/AnalyticsRequestInterceptor.java +++ b/analytics/src/main/java/com/segment/analytics/AnalyticsRequestInterceptor.java @@ -1,7 +1,7 @@ package com.segment.analytics; +import jakarta.annotation.Nonnull; import java.io.IOException; -import javax.annotation.Nonnull; import okhttp3.Interceptor; import okhttp3.Request; diff --git a/analytics/src/main/java/com/segment/analytics/internal/FlushMessage.java b/analytics/src/main/java/com/segment/analytics/internal/FlushMessage.java index b3ee9dc2..aa3d2689 100644 --- a/analytics/src/main/java/com/segment/analytics/internal/FlushMessage.java +++ b/analytics/src/main/java/com/segment/analytics/internal/FlushMessage.java @@ -1,10 +1,10 @@ package com.segment.analytics.internal; import com.segment.analytics.messages.Message; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.util.Date; import java.util.Map; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; class FlushMessage implements Message { static final FlushMessage POISON = new FlushMessage(); diff --git a/analytics/src/main/java/com/segment/analytics/internal/StopMessage.java b/analytics/src/main/java/com/segment/analytics/internal/StopMessage.java index eccd278c..ad8e1352 100644 --- a/analytics/src/main/java/com/segment/analytics/internal/StopMessage.java +++ b/analytics/src/main/java/com/segment/analytics/internal/StopMessage.java @@ -1,10 +1,10 @@ package com.segment.analytics.internal; import com.segment.analytics.messages.Message; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.util.Date; import java.util.Map; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; class StopMessage implements Message { static final StopMessage STOP = new StopMessage();