[jboss-svn-commits] JBL Code SVN: r16726 - labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Nov 21 05:23:25 EST 2007
Author: tfennelly
Date: 2007-11-21 05:23:25 -0500 (Wed, 21 Nov 2007)
New Revision: 16726
Modified:
labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/AttachmentImpl.java
Log:
http://jira.jboss.com/jira/browse/JBESB-1352
Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/AttachmentImpl.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/AttachmentImpl.java 2007-11-21 10:21:59 UTC (rev 16725)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/AttachmentImpl.java 2007-11-21 10:23:25 UTC (rev 16726)
@@ -60,7 +60,7 @@
public Object put(String name, Object value)
{
- assertValidValue(value);
+ assertValidAttachment(value);
return _table.put(name, (Serializable) value);
}
@@ -87,20 +87,20 @@
public Object replaceItemAt(int index, Object value)
throws IndexOutOfBoundsException
{
- assertValidValue(value);
+ assertValidAttachment(value);
return _list.set(index, (Serializable) value);
}
public void addItem(Object value)
{
- assertValidValue(value);
+ assertValidAttachment(value);
_list.add((Serializable) value);
}
public void addItemAt(int index, Object value)
throws IndexOutOfBoundsException
{
- assertValidValue(value);
+ assertValidAttachment(value);
_list.add(index, (Serializable) value);
}
@@ -288,11 +288,11 @@
return true;
}
- private void assertValidValue(Object value) {
- if(value == null) {
+ private void assertValidAttachment(Object attachment) {
+ if(attachment == null) {
throw new IllegalArgumentException("Cannot set null object as a message attachment. Attachment objects must be non-null and Serializable.");
- } else if(!(value instanceof Serializable)) {
- throw new IllegalArgumentException("Cannot set an Object of type '" + value.getClass().getName() + "' as a message attachment. Attachment objects must be Serializable.");
+ } else if(!(attachment instanceof Serializable)) {
+ throw new IllegalArgumentException("Cannot set an Object of type '" + attachment.getClass().getName() + "' as a message attachment. Attachment objects must be Serializable.");
}
}
More information about the jboss-svn-commits
mailing list