Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/sasl
In directory usw-pr-cvs1:/tmp/cvs-serv7785
Modified Files:
Blob.java
Log Message:
Fixed null pointer exception for empty Blobs
Index: Blob.java
===================================================================
RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/sasl/Blob.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** Blob.java 2001/05/23 16:38:37 1.2
--- Blob.java 2001/07/30 13:04:35 1.3
***************
*** 317,322 ****
}
}
! if(statusMappings == null)
! {
statusMappings = new String[STATUS_LIMIT];
statusMappings[STATUS_NONE] = NONE;
--- 317,321 ----
}
}
! if(statusMappings == null) {
statusMappings = new String[STATUS_LIMIT];
statusMappings[STATUS_NONE] = NONE;
***************
*** 329,336 ****
/**
! * Method getStatus
! *
! * @return String the status used in the blob - can be 'none'.
! *
*/
public String getStatus()
--- 328,332 ----
/**
! * Returns the status used in the blob - can be 'none'.
*/
public String getStatus()
***************
*** 340,358 ****
/**
! * Method getData
! *
! * @return String the data contained in the blob element
! *
*/
public String getData()
{
! return new String( decodedData );
}
/**
! * Method getData
! *
! * @return String the data contained in the blob element
! *
*/
public byte[] getDataBytes()
--- 336,351 ----
/**
! * Returns the blob data as a <code>String</code>.
*/
public String getData()
{
! if (decodedData == null) {
! return "";
! }
! return new String(decodedData);
}
/**
! * Returns the blob data as bytes.
*/
public byte[] getDataBytes()
***************
*** 362,368 ****
/**
! * Method toString
! *
! * @return String a representation of the Blob as it would be sent
* out on the wire (with the data encoded).
*
--- 355,359 ----
/**
! * Returns a representation of the Blob as it would be sent
* out on the wire (with the data encoded).
*
|