Issue Details (XML | Word | Printable)

Key: NET-104
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Dave Cee
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons Net

[net] POP3Client ProtocolCommandListener protocolReplyReceived method event.getMessage() is empty/blank

Created: 23/Mar/05 01:51 AM   Updated: 20/Sep/07 05:31 AM
Return to search
Component/s: None
Affects Version/s: Nightly Builds
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments:
  Size
Text File patch.txt 2005-03-23 01:54 AM Dave Cee 0.5 kB
Environment:
Operating System: All
Platform: All

Bugzilla Id: 34133


 Description  « Hide
Using POP3Client.addProtocolCommandListener, when the listener's
protocolReplyReceived method is called with a ProtocolCommandEvent object, the
getMessage() method of this object returns a blank string. It should return the
reply string. Caused by POP3.__getReply() calling the listener before it has
saved the reply string in _replyLines.

Pseudocode example:

public class TestPOP3 implements ProtocolCommandLister
{
public void connect()

{ POP3Client client = new POP3Client(); client.addProtocolCommandListener(this); client.connect(emailServer); client.login(emailUsername, emailPassword); client.disconnect(); }

public void protocolCommandSent(ProtocolCommandEvent vent)

{ log.debug(">" + event.getMessage()); }

public void protocolReplyReceived(ProtocolCommandEvent vent)

{ // bug: event.getMessage() is always an empty string ere log.debug("<" + event.getMessage()); }

}



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Dave Cee added a comment - 23/Mar/05 01:54 AM
Created an attachment (id=14536)
Suggested patch for POP3.java, diff on 1.3.0 source

Dave Cee added a comment - 23/Mar/05 01:57 AM
(From update of attachment 14536)
>--- POP3.java 2005-03-22 16:39:31.974738700 +0000
>+++ POP3.java 2005-03-22 16:41:29.273405900 +0000
>@@ -124,11 +124,11 @@
> MalformedServerReplyException(
> "Received invalid POP3 protocol response from server.");
>
>- if (commandSupport.getListenerCount() > 0)
>- commandSupport.fireReplyReceived(_replyCode, getReplyString());
>-
> _replyLines.addElement(line);
> _lastReplyLine = line;
>+
>+ if (commandSupport.getListenerCount() > 0)
>+ commandSupport.fireReplyReceived(_replyCode, getReplyString());
> }
>

Dave Cee added a comment - 23/Mar/05 01:58 AM
(From update of attachment 14536)
>--- POP3.java 2005-03-22 16:39:31.974738700 +0000
>+++ POP3.java 2005-03-22 16:41:29.273405900 +0000
>@@ -124,11 +124,11 @@
> MalformedServerReplyException(
> "Received invalid POP3 protocol response from server.");
>
>- if (commandSupport.getListenerCount() > 0)
>- commandSupport.fireReplyReceived(_replyCode, getReplyString());
>-
> _replyLines.addElement(line);
> _lastReplyLine = line;
>+
>+ if (commandSupport.getListenerCount() > 0)
>+ commandSupport.fireReplyReceived(_replyCode, getReplyString());
> }
>

Dave Cee added a comment - 23/Mar/05 02:02 AM
Sorry, I'm a Bugzilla newbie, ignore the comments about the edits of the patch file.

Daniel Savarese added a comment - 23/Mar/05 04:43 AM
Thanks. I applied the fix. Please verify before closing.