[JIRA] (JSSH-15) Consider use of Java "record" language feature
Ian Young (Jira)
jira at shibboleth.atlassian.net
Thu Sep 29 16:26:50 UTC 2022
Ian Young ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Ae127cb03-43ed-473d-b6ba-592949cb4be8 ) *created* an issue
Shibboleth Shared - Java ( https://shibboleth.atlassian.net/browse/JSSH?atlOrigin=eyJpIjoiYTNhNWI3ZDY4ZTc1NDEyZmEwZjg5YmEzZDQ4NGY0ZDIiLCJwIjoiaiJ9 ) / Task ( https://shibboleth.atlassian.net/browse/JSSH-15?atlOrigin=eyJpIjoiYTNhNWI3ZDY4ZTc1NDEyZmEwZjg5YmEzZDQ4NGY0ZDIiLCJwIjoiaiJ9 ) JSSH-15 ( https://shibboleth.atlassian.net/browse/JSSH-15?atlOrigin=eyJpIjoiYTNhNWI3ZDY4ZTc1NDEyZmEwZjg5YmEzZDQ4NGY0ZDIiLCJwIjoiaiJ9 ) Consider use of Java "record" language feature ( https://shibboleth.atlassian.net/browse/JSSH-15?atlOrigin=eyJpIjoiYTNhNWI3ZDY4ZTc1NDEyZmEwZjg5YmEzZDQ4NGY0ZDIiLCJwIjoiaiJ9 )
Issue Type: Task Affects Versions: 9.0.0 Assignee: Unassigned Created: 29/Sep/22 12:26 PM Priority: Trivial Reporter: Ian Young ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Ae127cb03-43ed-473d-b6ba-592949cb4be8 )
Java 14 introduced record types into Java (with some small additions in Java 16).
Now that our code assumes a Java 17 baseline, we should consider the use of this language feature where appropriate (specialised, immutable, POJOs).
One place that might be worth looking is the Pair class defined in net.shibboleth.shared.collection. It’s fairly likely that at least some of the uses of this fall into the design space for record}}s: little custom wrappers for which we used {{Pair simply because we couldn’t be bothered writing all that boilerplate.
Note that Pair is not immutable, however: there are a very small number of places where the second field is set post-creation. Those are probably not candidates for conversion to record (although they might be candidates for more conventional wrapper types).
( https://shibboleth.atlassian.net/browse/JSSH-15#add-comment?atlOrigin=eyJpIjoiYTNhNWI3ZDY4ZTc1NDEyZmEwZjg5YmEzZDQ4NGY0ZDIiLCJwIjoiaiJ9 ) Add Comment ( https://shibboleth.atlassian.net/browse/JSSH-15#add-comment?atlOrigin=eyJpIjoiYTNhNWI3ZDY4ZTc1NDEyZmEwZjg5YmEzZDQ4NGY0ZDIiLCJwIjoiaiJ9 )
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#100207- sha1:ee9e30a )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/commits/attachments/20220929/444e7fda/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-comment-icon-2a20a09a-01ba-4e2a-bb16-d2141ecfcd96
Type: image/png
Size: 1084 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20220929/444e7fda/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-trivial-b249f41e-78b7-4b43-a42d-79c85eeb7581
Type: image/png
Size: 563 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20220929/444e7fda/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-footer-desktop-logo-e65a29b5-f8d2-4406-9d89-ca1aded432ec
Type: image/png
Size: 10805 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20220929/444e7fda/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-avatar-b318569a-134d-41c1-b2a8-c3b3b19e2db5
Type: image/png
Size: 468 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20220929/444e7fda/attachment-0007.png>
More information about the commits
mailing list