Skip to content

Commit 498bb7f

Browse files
authored
Use optionalVLong (#53149)
Updates SamlServiceProviderDocument to use the new read/writeOptionalVLong methods from #53145
1 parent 0af00f8 commit 498bb7f

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

x-pack/plugin/identity-provider/src/main/java/org/elasticsearch/xpack/idp/saml/sp/SamlServiceProviderDocument.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ public SamlServiceProviderDocument(StreamInput in) throws IOException {
268268
created = in.readInstant();
269269
lastModified = in.readInstant();
270270
nameIdFormats = in.readSet(StreamInput::readString);
271-
authenticationExpiryMillis = in.readBoolean() ? in.readVLong() : null;
271+
authenticationExpiryMillis = in.readOptionalVLong();
272272

273273
privileges.application = in.readOptionalString();
274274
privileges.resource = in.readString();
@@ -295,12 +295,7 @@ public void writeTo(StreamOutput out) throws IOException {
295295
out.writeInstant(created);
296296
out.writeInstant(lastModified);
297297
out.writeCollection(nameIdFormats, StreamOutput::writeString);
298-
if (authenticationExpiryMillis == null) {
299-
out.writeBoolean(false);
300-
} else {
301-
out.writeBoolean(true);
302-
out.writeVLong(authenticationExpiryMillis);
303-
}
298+
out.writeOptionalVLong(authenticationExpiryMillis);
304299

305300
out.writeOptionalString(privileges.application);
306301
out.writeString(privileges.resource);

0 commit comments

Comments
 (0)