Author: sebb
Date: Tue Oct 23 06:43:17 2007
New Revision: 587506
URL: http://svn.apache.org/viewvc?rev=587506&view=rev
Log:
Protect against storing null as responseData
Remove deprecated getResponseDataAsBA() as no longer used
Modified:
jakarta/jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java
Modified:
jakarta/jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java
URL:
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java?rev=587506&r1=587505&r2=587506&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java
(original)
+++ jakarta/jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java
Tue Oct 23 06:43:17 2007
@@ -464,11 +464,14 @@
/**
* Sets the responseData attribute of the SampleResult object.
*
+ * If the parameter is null, then the responseData is set to an empty
byte array.
+ * This ensures that getResponseData() can never be null.
+ *
* @param response
* the new responseData value
*/
public void setResponseData(byte[] response) {
- responseData = response;
+ responseData = response == null ? EMPTY_BA : response;
}
/**
@@ -486,7 +489,7 @@
/**
* Gets the responseData attribute of the SampleResult object.
*
- * @return the responseData value
+ * @return the responseData value (cannot be null)
*/
public byte[] getResponseData() {
return responseData;
@@ -505,18 +508,6 @@
return new String(responseData);
}
}
-
- /**
- * Convenience method to get responseData as a non-null byte array
- *
- * @return the responseData. If responseData is null then an empty byte
- * array is returned rather than null.
- *
- * @deprecated - no longer needed, as getResponseData() does not return
null
- */
- public byte[] getResponseDataAsBA() {
- return responseData == null ? EMPTY_BA : responseData;
- }
public void setSamplerData(String s) {
samplerData = s;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]