File tree Expand file tree Collapse file tree 2 files changed +9
-41
lines changed
src/com/rabbitmq/client/impl Expand file tree Collapse file tree 2 files changed +9
-41
lines changed Original file line number Diff line number Diff line change @@ -328,9 +328,6 @@ else if(value instanceof byte[]) {
328328 else if (value instanceof List ) {
329329 acc += 4 + arraySize ((List <?>)value );
330330 }
331- else if (value instanceof Object []) {
332- acc += 4 + arraySize ((Object [])value );
333- }
334331 else if (value == null ) {
335332 }
336333 else {
@@ -349,17 +346,6 @@ public static long arraySize(List<?> values)
349346 }
350347 return acc ;
351348 }
352-
353- /** Computes the AMQP wire-protocol length of an encoded field-array */
354- public static long arraySize (Object [] values )
355- throws UnsupportedEncodingException
356- {
357- long acc = 0 ;
358- for (Object value : values ) {
359- acc += fieldValueSize (value );
360- }
361- return acc ;
362- }
363349
364350 /** Computes the AMQP wire-protocol length of a protocol-encoded long string. */
365351 private static int longStrSize (String str )
Original file line number Diff line number Diff line change @@ -189,43 +189,25 @@ else if(value instanceof List) {
189189 writeOctet ('A' );
190190 writeArray ((List <?>)value );
191191 }
192- else if (value instanceof Object []) {
193- writeOctet ('A' );
194- writeArray ((Object [])value );
195- }
196192 else {
197193 throw new IllegalArgumentException
198194 ("Invalid value type: " + value .getClass ().getName ());
199195 }
200196 }
201197
202198 public void writeArray (List <?> value )
203- throws IOException
204- {
205- if (value ==null ) {
206- out .write (0 );
207- }
208- else {
209- out .writeInt ((int )Frame .arraySize (value ));
210- for (Object item : value ) {
211- writeFieldValue (item );
199+ throws IOException
200+ {
201+ if (value ==null ) {
202+ out .write (0 );
212203 }
213- }
214- }
215-
216- public void writeArray (Object [] value )
217- throws IOException
218- {
219- if (value ==null ) {
220- out .write (0 );
221- }
222- else {
223- out .writeInt ((int )Frame .arraySize (value ));
224- for (Object item : value ) {
225- writeFieldValue (item );
204+ else {
205+ out .writeInt ((int )Frame .arraySize (value ));
206+ for (Object item : value ) {
207+ writeFieldValue (item );
208+ }
226209 }
227210 }
228- }
229211
230212 /** Public API - encodes an octet from an int. */
231213 public final void writeOctet (int octet )
You can’t perform that action at this time.
0 commit comments