[JIRA] (MDA-291) Make StatusMetadata a sealed class
Ian Young (Jira)
jira at shibboleth.atlassian.net
Thu May 25 14:01:42 UTC 2023
Ian Young ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Ae127cb03-43ed-473d-b6ba-592949cb4be8 ) *created* an issue
Metadata Aggregator ( https://shibboleth.atlassian.net/browse/MDA?atlOrigin=eyJpIjoiNTUzZWJiNTdmYzM2NGI5YWFjODNhMjJjYjllYjNlOTkiLCJwIjoiaiJ9 ) / Sub-task ( https://shibboleth.atlassian.net/browse/MDA-291?atlOrigin=eyJpIjoiNTUzZWJiNTdmYzM2NGI5YWFjODNhMjJjYjllYjNlOTkiLCJwIjoiaiJ9 ) MDA-291 ( https://shibboleth.atlassian.net/browse/MDA-291?atlOrigin=eyJpIjoiNTUzZWJiNTdmYzM2NGI5YWFjODNhMjJjYjllYjNlOTkiLCJwIjoiaiJ9 ) Make StatusMetadata a sealed class ( https://shibboleth.atlassian.net/browse/MDA-291?atlOrigin=eyJpIjoiNTUzZWJiNTdmYzM2NGI5YWFjODNhMjJjYjllYjNlOTkiLCJwIjoiaiJ9 )
Issue Type: Sub-task Affects Versions: 0.9.2 Assignee: Ian Young ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Ae127cb03-43ed-473d-b6ba-592949cb4be8 ) Components: Pipeline Created: 25/May/23 10:01 AM Fix Versions: 0.10.0 Priority: Trivial Reporter: Ian Young ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Ae127cb03-43ed-473d-b6ba-592949cb4be8 )
There are only three subclasses of StatusMetadata. Not only do I have no intention of extending that set, but it’s actually an assumption elsewhere, e.g., in the md-validator protocol specification.
I think it would be best to guarantee that part of the contract and now that we are baselined on Java 17 it is possible to do so, by making StatusMetadata a sealed class, and designated the three existing subclasses as the permitted subclasses.
I don’t know if anyone currently subclasses, for example, ErrorStatus. In some ways, these are obvious candidates for being final or indeed turned into record}}s but that would rule out the sort of thing you can get by subclassing {{Exception types, of being able to catch categories of issue by class. That’s a lot of what the item metadata bag being a ClassToInstanceMultiMap is about.
So at present I think the correct (and minimally disruptive) approach is to make the subclasses explicitly non-sealed.
( https://shibboleth.atlassian.net/browse/MDA-291#add-comment?atlOrigin=eyJpIjoiNTUzZWJiNTdmYzM2NGI5YWFjODNhMjJjYjllYjNlOTkiLCJwIjoiaiJ9 ) Add Comment ( https://shibboleth.atlassian.net/browse/MDA-291#add-comment?atlOrigin=eyJpIjoiNTUzZWJiNTdmYzM2NGI5YWFjODNhMjJjYjllYjNlOTkiLCJwIjoiaiJ9 )
Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100225- sha1:0428b75 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/commits/attachments/20230525/2c690ad5/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-avatar-ed836873-7593-4f10-9f19-952e4d446272
Type: image/png
Size: 457 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20230525/2c690ad5/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-comment-icon-24669ad9-be39-49dd-8289-9a9053c2ff79
Type: image/png
Size: 1084 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20230525/2c690ad5/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-trivial-065d7989-82cb-42df-93cf-5b76cae9574d
Type: image/png
Size: 446 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20230525/2c690ad5/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-footer-desktop-logo-f11b6fd9-447f-4a9a-8baa-de3c96c96e41
Type: image/png
Size: 10805 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20230525/2c690ad5/attachment-0007.png>
More information about the commits
mailing list