Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core
In directory usw-pr-cvs1:/tmp/cvs-serv6546
Modified Files:
Channel.java
Log Message:
Fixed null pointer exception in old sendXXX methods
Index: Channel.java
===================================================================
RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/Channel.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** Channel.java 2001/07/10 01:17:52 1.14
--- Channel.java 2001/07/30 12:59:03 1.15
***************
*** 135,138 ****
--- 135,141 ----
private Object applicationData = null;
+ /* this is to support deprecated sendXXX methods */
+ private MessageMSG currentMSG;
+
// in shutting down the session
// something for waiting synchronous messages (semaphores or something)
***************
*** 391,397 ****
public MessageStatus sendANS(DataStream stream) throws BEEPException
{
! Message m = (Message)this.recvMSGQueue.get(0);
!
! return m.sendANS(stream);
}
--- 394,398 ----
public MessageStatus sendANS(DataStream stream) throws BEEPException
{
! return this.currentMSG.sendANS(stream);
}
***************
*** 523,527 ****
public MessageStatus sendNUL() throws BEEPException
{
! Message m = (Message)this.recvMSGQueue.get(0);
return m.sendNUL();
--- 524,529 ----
public MessageStatus sendNUL() throws BEEPException
{
! Message m = this.currentMSG;
! this.currentMSG = null;
return m.sendNUL();
***************
*** 543,547 ****
public MessageStatus sendRPY(DataStream stream) throws BEEPException
{
! Message m = (Message)this.recvMSGQueue.get(0);
return m.sendRPY(stream);
--- 545,550 ----
public MessageStatus sendRPY(DataStream stream) throws BEEPException
{
! Message m = this.currentMSG;
! this.currentMSG = null;
return m.sendRPY(stream);
***************
*** 563,567 ****
public MessageStatus sendERR(BEEPError error) throws BEEPException
{
! Message m = (Message)this.recvMSGQueue.get(0);
return m.sendERR(error);
--- 566,571 ----
public MessageStatus sendERR(BEEPError error) throws BEEPException
{
! Message m = this.currentMSG;
! this.currentMSG = null;
return m.sendERR(error);
***************
*** 584,588 ****
throws BEEPException
{
! Message m = (Message)this.recvMSGQueue.get(0);
return m.sendERR(code, diagnostic);
--- 588,593 ----
throws BEEPException
{
! Message m = this.currentMSG;
! this.currentMSG = null;
return m.sendERR(code, diagnostic);
***************
*** 607,611 ****
throws BEEPException
{
! Message m = (Message)this.recvMSGQueue.get(0);
return m.sendERR(code, diagnostic, xmlLang);
--- 612,617 ----
throws BEEPException
{
! Message m = this.currentMSG;
! this.currentMSG = null;
return m.sendERR(code, diagnostic, xmlLang);
***************
*** 691,694 ****
--- 697,701 ----
}
+ this.currentMSG = m;
((MessageListener) this.listener).receiveMSG(m);
***************
*** 750,753 ****
--- 757,764 ----
mstatus.setMessageStatus(MessageStatus.MESSAGE_STATUS_RECEIVED_REPLY);
+ Log.logEntry(Log.SEV_DEBUG_VERBOSE,
+ "Notifying reply listener =>" + replyListener +
+ "for NUL message");
+
replyListener.receiveNUL(m);
|