You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by "Rick McGuire (JIRA)" <ji...@apache.org> on 2008/06/18 14:12:44 UTC
[jira] Closed: (GERONIMO-4126) NPE if null argument specified for
InternetHeaders.getMatchingHeaders()
[ https://issues.apache.org/jira/browse/GERONIMO-4126?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rick McGuire closed GERONIMO-4126.
----------------------------------
Resolution: Fixed
Committed revision 669143.
> NPE if null argument specified for InternetHeaders.getMatchingHeaders()
> -----------------------------------------------------------------------
>
> Key: GERONIMO-4126
> URL: https://issues.apache.org/jira/browse/GERONIMO-4126
> Project: Geronimo
> Issue Type: Bug
> Security Level: public(Regular issues)
> Reporter: Rick McGuire
> Assignee: Rick McGuire
> Priority: Minor
> Fix For: 2.2
>
>
> The InternetHeaders getMatchingHeaders(), getNonMatchingHeaders(), etc. methods give an NPE if a null match list is provided. The Sun implementation treats this the same as an empty array. The following simple program can demonstrate the problem:
> import javax.mail.internet.InternetHeaders;
> import javax.mail.Header;
> import java.util.Enumeration;
> public class TestMatchHeaders
> {
> static public void main(String [] args) {
> InternetHeaders headers = new InternetHeaders();
> headers.setHeader("Subject", "Hello");
> headers.setHeader("From", "Me");
>
> Enumeration e = headers.getMatchingHeaderLines(null);
>
> System.out.println(">>>>> Matching lines");
>
> while (e.hasMoreElements()) {
> System.out.println((String)e.nextElement());
> }
>
> e = headers.getNonMatchingHeaderLines(null);
>
> System.out.println(">>>>> Non-Matching lines");
>
> while (e.hasMoreElements()) {
> System.out.println((String)e.nextElement());
> }
>
> }
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.