cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Lagunov <>
Subject NPE during source validity check for ValidatingTransformer
Date Tue, 28 Feb 2012 14:57:16 GMT

I've caught the following NullPointerException:


So what is happening? It appeared that AggregatedValidity.m_list array list held null element.
The null element was added to m_list in ValidationResolver. resolveSource method:
        /* Record the current source in the validities to return */

The javadoc for Source.getValidity() says:
Get the Validity object. This can either wrap the last modification date or some expiry information
or anything else describing this object's validity.
If it is currently not possible to calculate such an information, null is returned.

The fact is that my Source is being loaded from XML DB by custom generator and it seems to
be correct that validity is null. I suppose it's a bug and it can be fixed in the following
        /* Record the current source in the validities to return */
        If (source.getValidity() != null) this.sourceValidity.add(source.getValidity());

This worked for me. I suggest this as an official commit.

Best regards,
Ivan Lagunov

View raw message