File tree Expand file tree Collapse file tree
s2a/src/main/java/io/grpc/s2a Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ public static final class Builder {
7373 @ CanIgnoreReturnValue
7474 public Builder setLocalSpiffeId (String localSpiffeId ) {
7575 checkNotNull (localSpiffeId );
76+ checkArgument (localIdentity == null , "localIdentity is already set." );
7677 localIdentity = S2AIdentity .fromSpiffeId (localSpiffeId );
7778 return this ;
7879 }
@@ -85,6 +86,7 @@ public Builder setLocalSpiffeId(String localSpiffeId) {
8586 @ CanIgnoreReturnValue
8687 public Builder setLocalHostname (String localHostname ) {
8788 checkNotNull (localHostname );
89+ checkArgument (localIdentity == null , "localIdentity is already set." );
8890 localIdentity = S2AIdentity .fromHostname (localHostname );
8991 return this ;
9092 }
@@ -97,6 +99,7 @@ public Builder setLocalHostname(String localHostname) {
9799 @ CanIgnoreReturnValue
98100 public Builder setLocalUid (String localUid ) {
99101 checkNotNull (localUid );
102+ checkArgument (localIdentity == null , "localIdentity is already set." );
100103 localIdentity = S2AIdentity .fromUid (localUid );
101104 return this ;
102105 }
You can’t perform that action at this time.
0 commit comments