[jboss-jira] [JBoss JIRA] (ELY-1745) The AvailableRealmsCallback should not result in a NPE if there is no mechanism configuration.

Justin Cook (Jira) issues at jboss.org
Wed Feb 13 16:55:00 EST 2019


    [ https://issues.jboss.org/browse/ELY-1745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13695251#comment-13695251 ] 

Justin Cook commented on ELY-1745:
----------------------------------

[~dlofthouse] What do you mean for "if mechanism configuration is mandatory"? I tried callback.isOptional(), but that method always returns true

> The AvailableRealmsCallback should not result in a NPE if there is no mechanism configuration.
> ----------------------------------------------------------------------------------------------
>
>                 Key: ELY-1745
>                 URL: https://issues.jboss.org/browse/ELY-1745
>             Project: WildFly Elytron
>          Issue Type: Bug
>          Components: API / SPI
>            Reporter: Darran Lofthouse
>            Assignee: Justin Cook
>            Priority: Major
>             Fix For: 1.8.0.CR3
>
>
> The NPE is due to the following code: -
> {noformat}
>                 } else if (callback instanceof AvailableRealmsCallback) {
>                     Collection<String> names = stateRef.get().getMechanismConfiguration().getMechanismRealmNames();
>                     if (log.isTraceEnabled()) {
>                         log.tracef("Handling AvailableRealmsCallback: realms = [%s]", String.join(", ", names));
>                     }
>                     if (! names.isEmpty()) {
>                         ((AvailableRealmsCallback) callback).setRealmNames(names.toArray(new String[names.size()]));
>                     }
>                     handleOne(callbacks, idx + 1);
> {noformat}
> If mechanism configuration is mandatory this should report an appropriate error, if not it should fallback to specifying an empty list.



--
This message was sent by Atlassian Jira
(v7.12.1#712002)


More information about the jboss-jira mailing list