[jboss-jira] [JBoss JIRA] Created: (JBXB-79) Array parameter is being appended rather than passed intact

David Boeren (JIRA) jira-events at jboss.com
Mon Aug 28 14:32:46 EDT 2006


Array parameter is being appended rather than passed intact
-----------------------------------------------------------

                 Key: JBXB-79
                 URL: http://jira.jboss.com/jira/browse/JBXB-79
             Project: JBoss XML Binding (JBossXB)
          Issue Type: Bug
            Reporter: David Boeren


When I call a webservice method and pass an object containing an array of another object type, the server receives the array with additional elements.  The array elements that I pass are appended, so that if I send 1 element the server receives 81.  If  I send 80 elements, the server receives 160.  There are always 80 element preceding the first one that I pass.

The value 80 comes from code in the object constructor that preinitializes the array to this size.

This form causes the bug:
public class Coils implements Serializable{
	private int			numberOfCoils;
	private CoilData[]	array = new CoilData[80];
}

This form likewise causes the bug:
public class Coils implements Serializable{
	private int			numberOfCoils;
	private CoilData[]	array;
	public Coils() {
            array = new CoilData[80];
        }
}

This form does not cause the bug:
public class Coils implements Serializable{
	private int			numberOfCoils;
	private CoilData[]	array;
	public Coils() {
        }
}
Coils coils = new Coils();
coils.setArray(new CoilData[80]);

So, it has something to do with initializing it in the construction of the object.

Attached is a full Eclipse project exhibiting the bug that you can run on JBoss 4.0.4.GA with JBossWS.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list