Skip to content
This repository was archived by the owner on Aug 30, 2023. It is now read-only.

Commit 8d66f6a

Browse files
committed
make EventProcessor.process Nullable
Null return is used when the event should be dropped. This aligns with the current handling in code and also with the Sentry unified API definition of event processors.
1 parent e8b5549 commit 8d66f6a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

sentry-core/src/main/java/io/sentry/core/EventProcessor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
import org.jetbrains.annotations.Nullable;
44

55
public interface EventProcessor {
6+
@Nullable
67
SentryEvent process(SentryEvent event, @Nullable Object hint);
78
}

sentry-core/src/main/java/io/sentry/core/MainEventProcessor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import java.util.ArrayList;
77
import java.util.List;
88
import org.jetbrains.annotations.ApiStatus;
9+
import org.jetbrains.annotations.NotNull;
910
import org.jetbrains.annotations.Nullable;
1011

1112
@ApiStatus.Internal
@@ -38,7 +39,7 @@ public final class MainEventProcessor implements EventProcessor {
3839
}
3940

4041
@Override
41-
public SentryEvent process(SentryEvent event, @Nullable Object hint) {
42+
public @NotNull SentryEvent process(SentryEvent event, @Nullable Object hint) {
4243
if (event.getPlatform() == null) {
4344
// this actually means JVM related.
4445
event.setPlatform("java");

0 commit comments

Comments
 (0)