[JIRA] (JSPT-114) PredicateDrivenFunction violates contract of FunctionSupport.constant

Ian Young (Jira) jira at shibboleth.atlassian.net
Tue Mar 1 17:15:11 UTC 2022


Ian Young ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Ae127cb03-43ed-473d-b6ba-592949cb4be8 ) *created* an issue

Java Support ( https://shibboleth.atlassian.net/browse/JSPT?atlOrigin=eyJpIjoiYjFiYWYxNjM0NmJiNGFhNWJhZTJhY2UxMTc5NzFmMTEiLCJwIjoiaiJ9 ) / Bug ( https://shibboleth.atlassian.net/browse/JSPT-114?atlOrigin=eyJpIjoiYjFiYWYxNjM0NmJiNGFhNWJhZTJhY2UxMTc5NzFmMTEiLCJwIjoiaiJ9 ) JSPT-114 ( https://shibboleth.atlassian.net/browse/JSPT-114?atlOrigin=eyJpIjoiYjFiYWYxNjM0NmJiNGFhNWJhZTJhY2UxMTc5NzFmMTEiLCJwIjoiaiJ9 ) PredicateDrivenFunction violates contract of FunctionSupport.constant ( https://shibboleth.atlassian.net/browse/JSPT-114?atlOrigin=eyJpIjoiYjFiYWYxNjM0NmJiNGFhNWJhZTJhY2UxMTc5NzFmMTEiLCJwIjoiaiJ9 )

Issue Type: Bug Affects Versions: 8.2.1 Assignee: Unassigned Components: logic Created: 01/Mar/22 12:15 PM Priority: Trivial Reporter: Ian Young ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Ae127cb03-43ed-473d-b6ba-592949cb4be8 )

PredicateDrivenFunction calls FunctionSupport.constant(null). However, constant 's signature does not allow a null argument:

... constant(@Nonnull @ParameterName(name="target") final T2 target)

The easiest fix is probably to open the @Nonnull up to be a @Nullable. That would be an API change, however.

The implementation of FunctionSupport.constant uses the Guava Functions.constant which is constant(@Nullable E value). So the non-API-changing alternative would probably be to cut out the middle-man and call Functions.constant(null) directly.

( https://shibboleth.atlassian.net/browse/JSPT-114#add-comment?atlOrigin=eyJpIjoiYjFiYWYxNjM0NmJiNGFhNWJhZTJhY2UxMTc5NzFmMTEiLCJwIjoiaiJ9 ) Add Comment ( https://shibboleth.atlassian.net/browse/JSPT-114#add-comment?atlOrigin=eyJpIjoiYjFiYWYxNjM0NmJiNGFhNWJhZTJhY2UxMTc5NzFmMTEiLCJwIjoiaiJ9 )

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#100192- sha1:31e1add )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/commits/attachments/20220301/b0e8cb70/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-comment-icon-8c6d7c7d-642d-4431-9fec-28c6cd2cb545
Type: image/png
Size: 1084 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20220301/b0e8cb70/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-trivial-80a4fdde-4d5f-45db-aee9-c97012026713
Type: image/png
Size: 563 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20220301/b0e8cb70/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-avatar-281f40ff-d7b4-418a-b2b5-dbb62f6c8975
Type: image/png
Size: 425 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20220301/b0e8cb70/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-footer-desktop-logo-a845c5a0-2cd6-48bc-89c8-988ceac4e3f9
Type: image/png
Size: 10805 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20220301/b0e8cb70/attachment-0007.png>


More information about the commits mailing list