Skip to content

Commit

Permalink
Merge ea17a26 into b071538
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanosiano committed Jun 25, 2024
2 parents b071538 + ea17a26 commit bda581e
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- Properly reset metric flush flag on metric emission ([#3493](https://github.com/getsentry/sentry-java/pull/3493))
- Use SecureRandom in favor of Random for Metrics ([#3495](https://github.com/getsentry/sentry-java/pull/3495))
- Fix UncaughtExceptionHandlerIntegration Memory Leak ([#3398](https://github.com/getsentry/sentry-java/pull/3398))
- Deprecated User.segment ([#3511](https://github.com/getsentry/sentry-java/pull/3511))

### Dependencies

Expand Down
14 changes: 14 additions & 0 deletions sentry/src/main/java/io/sentry/Baggage.java
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,21 @@ public void setUserId(final @Nullable String userId) {
set(DSCKeys.USER_ID, userId);
}

/**
* @deprecated has no effect and will be removed in the next major update.
*/
@Deprecated
@SuppressWarnings("InlineMeSuggester")
@ApiStatus.Internal
public @Nullable String getUserSegment() {
return get(DSCKeys.USER_SEGMENT);
}

/**
* @deprecated has no effect and will be removed in the next major update.
*/
@Deprecated
@SuppressWarnings("InlineMeSuggester")
@ApiStatus.Internal
public void setUserSegment(final @Nullable String userSegment) {
set(DSCKeys.USER_SEGMENT, userSegment);
Expand Down Expand Up @@ -403,6 +413,10 @@ public void setValuesFromScope(
setSampled(null);
}

/**
* @deprecated has no effect and will be removed in the next major update.
*/
@Deprecated
private static @Nullable String getSegment(final @NotNull User user) {
if (user.getSegment() != null) {
return user.getSegment();
Expand Down
8 changes: 8 additions & 0 deletions sentry/src/main/java/io/sentry/TraceContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ public final class TraceContext implements JsonUnknown, JsonSerializable {
return userId;
}

/**
* @deprecated has no effect and will be removed in the next major update.
*/
@Deprecated
public @Nullable String getUserSegment() {
return userSegment;
}
Expand Down Expand Up @@ -116,6 +120,10 @@ private TraceContextUser(final @Nullable String id, final @Nullable String segme
return id;
}

/**
* @deprecated has no effect and will be removed in the next major update.
*/
@Deprecated
public @Nullable String getSegment() {
return segment;
}
Expand Down
9 changes: 8 additions & 1 deletion sentry/src/main/java/io/sentry/protocol/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ public final class User implements JsonUnknown, JsonSerializable {
/** Username of the user. */
private @Nullable String username;

private @Nullable String segment;
/**
* @deprecated has no effect and will be removed in the next major update.
*/
@Deprecated private @Nullable String segment;

/** Remote IP address of the user. */
private @Nullable String ipAddress;
Expand Down Expand Up @@ -224,7 +227,9 @@ public void setUsername(final @Nullable String username) {
* Gets the segment of the user.
*
* @return the user segment.
* @deprecated has no effect and will be removed in the next major update.
*/
@Deprecated
public @Nullable String getSegment() {
return segment;
}
Expand All @@ -233,7 +238,9 @@ public void setUsername(final @Nullable String username) {
* Sets the segment of the user.
*
* @param segment the segment.
* @deprecated has no effect and will be removed in the next major update.
*/
@Deprecated
public void setSegment(final @Nullable String segment) {
this.segment = segment;
}
Expand Down

0 comments on commit bda581e

Please sign in to comment.