A null @NonnullAfterInit getId() ?

Ian Young ian at iay.org.uk
Fri Nov 3 07:03:50 EDT 2017



> On 3 Nov 2017, at 00:43, Cantor, Scott <cantor.2 at osu.edu> wrote:
> 
> I suspect a lot will blow up if we add a constraint check to the ID in the initialize step.

Unless I misunderstand context, we already have such a check in AbstractIdentifiedInitializableComponent, so anything descended from that already has one:

    /**
     * This method checks to ensure that the component ID is not null.
     * 
     * {@inheritDoc}
     */
    protected void doInitialize() throws ComponentInitializationException {
        super.doInitialize();
        
        if (getId() == null) {
            throw new ComponentInitializationException("Component identifier can not be null");
        }
    }

Of course not all components are initializable ones.

    -- Ian

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3854 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/dev/attachments/20171103/059b0c50/attachment-0001.p7s>


More information about the dev mailing list