[JIRA] (MDA-242) API Review: thread safety and synchronization

Ian Young (Jira) jira at shibboleth.atlassian.net
Fri Aug 26 11:05:56 UTC 2022


Ian Young ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Ae127cb03-43ed-473d-b6ba-592949cb4be8 ) *commented* on MDA-242 ( https://shibboleth.atlassian.net/browse/MDA-242?atlOrigin=eyJpIjoiMWQ5OWE3NGVjNTNhNGRiNmE0OGU3MjE3YTJiYmE5NTkiLCJwIjoiaiJ9 )

Re: API Review: thread safety and synchronization ( https://shibboleth.atlassian.net/browse/MDA-242?atlOrigin=eyJpIjoiMWQ5OWE3NGVjNTNhNGRiNmE0OGU3MjE3YTJiYmE5NTkiLCJwIjoiaiJ9 )

Added some additional synchronizations suggested by SpotBugs analysis, commit ac63302e95243684d4848bc9a348a1a176110426.

Some of these (the synchronized on some doInitialize methods in particular) are not truly required, as those methods are always in practice executed while the object’s monitor is held by the initialize method in one of the parent classes. SpotBugs doesn’t know that, and I suppose in principle that constraint might be violated at some point in the future. So I decided to go ahead and synchronize those methods on the basis that synchronization while the monitor is already held is reputedly inexpensive and it means that there aren’t a lot of SpotBugs warnings I am ignoring because “I know it’s wrong about that”, which is a pretty risky approach to a tool.

In principle, it would be possible to ignore specific SpotBugs warnings on methods with specific names, but that also seems like a bad approach in general.

( https://shibboleth.atlassian.net/browse/MDA-242#add-comment?atlOrigin=eyJpIjoiMWQ5OWE3NGVjNTNhNGRiNmE0OGU3MjE3YTJiYmE5NTkiLCJwIjoiaiJ9 ) Add Comment ( https://shibboleth.atlassian.net/browse/MDA-242#add-comment?atlOrigin=eyJpIjoiMWQ5OWE3NGVjNTNhNGRiNmE0OGU3MjE3YTJiYmE5NTkiLCJwIjoiaiJ9 )

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#100206- sha1:4ed3dc7 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/commits/attachments/20220826/719a37c3/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-avatar-e832bb1f-ad55-4995-88db-e21702bc87b2
Type: image/png
Size: 452 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20220826/719a37c3/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-comment-icon-f9d09eb2-85bf-4690-8de7-2f9675ae3715
Type: image/png
Size: 1084 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20220826/719a37c3/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-footer-desktop-logo-9867498d-0025-4e22-bb1d-c2090374e1d3
Type: image/png
Size: 10805 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20220826/719a37c3/attachment-0005.png>


More information about the commits mailing list