Skip to content

Commit

Permalink
Fixes #24223 Make PrincipalCallback Serializable & prevent JMX exception
Browse files Browse the repository at this point in the history
Signed-off-by: Arjan Tijms <arjan.tijms@omnifish.ee>
  • Loading branch information
arjantijms committed May 22, 2023
1 parent 359ca06 commit 20fba53
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright (c) 2023, 2023 Contributors to the Eclipse Foundation. All rights reserved.
* Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
Expand All @@ -19,6 +20,9 @@
import com.sun.enterprise.config.serverbeans.Domain;
import com.sun.enterprise.config.serverbeans.SecureAdmin;
import com.sun.enterprise.config.serverbeans.SecureAdminPrincipal;

import java.io.Serial;
import java.io.Serializable;
import java.security.Principal;
import java.util.ArrayList;
import java.util.Arrays;
Expand Down Expand Up @@ -200,7 +204,11 @@ private void removeAddedInfo() {
subject.getPublicCredentials().removeAll(subjectToAssemble.getPublicCredentials());
}

static class PrincipalCallback implements Callback {
static class PrincipalCallback implements Callback, Serializable {

@Serial
private static final long serialVersionUID = 1L;

private Principal p;

public void setPrincipal(final Principal p) {
Expand Down

0 comments on commit 20fba53

Please sign in to comment.