commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Elliot Shank <c...@galumph.com>
Subject [net] NullPointerException from nntp.Threader.thread() when all messages in a derived thread are missing.
Date Wed, 02 Apr 2014 20:55:53 GMT
Using v3.3, I'm getting problems like

Exception in thread "main" java.lang.NullPointerException
     at org.apache.commons.net.nntp.Threader.gatherSubjects(Threader.java:342)
     at org.apache.commons.net.nntp.Threader.thread(Threader.java:81)
     at org.apache.commons.net.nntp.Threader.thread(Threader.java:47)

when a particular thread branch has no actual messages in it.

What happens is that the graph returned by findRootSet() at line 71 will look something like

     ...
     <ThreadContainer A with Threadable>
         ...
     <ThreadContainer B without Threadable>
         <ThreadContainer ... without Threadable>
             <ThreadContainer ... without Threadable>
             <ThreadContainer ... without Threadable>
         <ThreadContainer ... without Threadable>
             <ThreadContainer ... without Threadable>
                 <ThreadContainer ... without Threadable>
     <ThreadContainer C with Threadable>
         ...
     ...

And, after pruneEmptyContainers() has had its way with things on line 75, the graph will be

     ...
     <ThreadContainer A with Threadable>
         ...
     <ThreadContainer B without Threadable>
     <ThreadContainer C with Threadable>
         ...
     ...

when it should be

     ...
     <ThreadContainer A with Threadable>
         ...
     <ThreadContainer C with Threadable>
         ...
     ...

I.e., ThreadContainer B should be eliminated entirely.

As it is, with ThreadContainer B present, but not containing any children or a Threadable,
gatherSubjects() chokes.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message