[Httpunit-commit] CVS: httpunit/src/com/meterware/servletunit ServletUnitHttpRequest.java,1.22,1.23
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2003-02-13 15:37:10
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/servletunit
In directory sc8-pr-cvs1:/tmp/cvs-serv18094/src/com/meterware/servletunit
Modified Files:
ServletUnitHttpRequest.java
Log Message:
setAttribute now permits multiple calls with the same value
Index: ServletUnitHttpRequest.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/servletunit/ServletUnitHttpRequest.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- ServletUnitHttpRequest.java 11 Feb 2003 04:32:00 -0000 1.22
+++ ServletUnitHttpRequest.java 13 Feb 2003 15:37:00 -0000 1.23
@@ -473,13 +473,10 @@
*
* Stores an attribute in the context of this request.
* Attributes are reset between requests.
- *
- * @exception IllegalStateException if the specified attribute already has a value
- *
**/
public void setAttribute( String key, Object o ) {
- if (_attributes.get( key ) != null) throw new IllegalStateException( "Attribute '" + key + "' already has a value" );
- _attributes.put( key, o );
+ if (o == null) _attributes.remove( key );
+ else _attributes.put( key, o );
}
|