Skip to content

Commit

Permalink
Fix deser bug on ssoTokenChanged events (#258)
Browse files Browse the repository at this point in the history
  • Loading branch information
breedloj authored Nov 22, 2024
1 parent 4532524 commit ede0c54
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public final CompletableFuture<ShowDocumentResult> showDocument(final ShowDocume

@Override
public final void ssoTokenChanged(final SsoTokenChangedParams params) {
SsoTokenChangedKind kind = SsoTokenChangedKind.valueOf(params.kind());
SsoTokenChangedKind kind = SsoTokenChangedKind.fromValue(params.kind());
Activator.getLogger().info("Processing " + kind + "ssoTokenChanged notification...");

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ public enum SsoTokenChangedKind {
this.value = value;
}

public static SsoTokenChangedKind fromValue(final String value) {
for (SsoTokenChangedKind kind : values()) {
if (kind.getValue().equalsIgnoreCase(value)) {
return kind;
}
}
throw new IllegalArgumentException("No enum constant " + SsoTokenChangedKind.class.getSimpleName() + " with value " + value);
}

public String getValue() {
return this.value;
}
Expand Down

0 comments on commit ede0c54

Please sign in to comment.