This makes sense to me too. The javadoc of javax.mail.Message doesn't tell
that things like subject can't be null.

Can you open an issue for this please?

Cheers,
Marc.


Florent Blondeau wrote:
> 
> Hi there,
> 
> I've got an NPE when performing a <emailStoreMessageId> on a box that 
> contains a message for which getSubject returns null.
> I didn't examine that message to know why it is possible, but what I see 
> in the doMatch() method in AbstractSelectStep seems weird to me
> 
>    
> static boolean doMatch(final String expected, final String actual) {
>         // semantics are: if no expectation then match
>         if (StringUtils.isEmpty(expected)) {
>             return true;
>         }
>          // if actual is null, you're sure to get a NPE
>         if (isRegexMatch(expected)) {
>             return getVerifier(true).verifyStrings(expected.substring(1, 
> expected.length() - 1), actual);
>         }
>         return getVerifier(false).verifyStrings(expected, actual);
>     }
> 
> It may be a development choice, but if we have
> // semantics are: if no expectation then match
> couldn't we have
> // semantics are: if no actual then no match
> with this kind of code
>         if (StringUtils.isEmpty(actual)){
>             return false;
>         }
> 
> Someone can tell me if I'm wrong?
> 
> Cheers
> 
> Florent
> 
> -- 
> Pingwy
> 27, rue des arènes
> 49100 Angers
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/NPE-for-an-IMAP-message-with-null-subject-tf4888063.html#a13991388
Sent from the WebTest mailing list archive at Nabble.com.

_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest

Reply via email to