1
1
/*
2
- * Copyright 2002-2018 the original author or authors.
2
+ * Copyright 2002-2020 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
17
17
package org .springframework .web .servlet .tags ;
18
18
19
19
import java .io .IOException ;
20
+ import java .util .ArrayList ;
20
21
import java .util .Collection ;
21
22
import java .util .Collections ;
22
- import java .util .LinkedList ;
23
23
import java .util .List ;
24
24
25
25
import javax .servlet .jsp .JspException ;
@@ -255,7 +255,7 @@ public void setJavaScriptEscape(boolean javaScriptEscape) throws JspException {
255
255
256
256
@ Override
257
257
protected final int doStartTagInternal () throws JspException , IOException {
258
- this .nestedArguments = new LinkedList <>();
258
+ this .nestedArguments = new ArrayList <>();
259
259
return EVAL_BODY_INCLUDE ;
260
260
}
261
261
@@ -358,20 +358,7 @@ private Object[] appendArguments(@Nullable Object[] sourceArguments, Object[] ad
358
358
@ Nullable
359
359
protected Object [] resolveArguments (@ Nullable Object arguments ) throws JspException {
360
360
if (arguments instanceof String ) {
361
- String [] stringArray =
362
- StringUtils .delimitedListToStringArray ((String ) arguments , this .argumentSeparator );
363
- if (stringArray .length == 1 ) {
364
- Object argument = stringArray [0 ];
365
- if (argument != null && argument .getClass ().isArray ()) {
366
- return ObjectUtils .toObjectArray (argument );
367
- }
368
- else {
369
- return new Object [] {argument };
370
- }
371
- }
372
- else {
373
- return stringArray ;
374
- }
361
+ return StringUtils .delimitedListToStringArray ((String ) arguments , this .argumentSeparator );
375
362
}
376
363
else if (arguments instanceof Object []) {
377
364
return (Object []) arguments ;
@@ -395,7 +382,7 @@ else if (arguments != null) {
395
382
* @throws IOException if writing failed
396
383
*/
397
384
protected void writeMessage (String msg ) throws IOException {
398
- this .pageContext .getOut ().write (String . valueOf ( msg ) );
385
+ this .pageContext .getOut ().write (msg );
399
386
}
400
387
401
388
/**
0 commit comments