1212import java .util .HashMap ;
1313import java .util .List ;
1414import java .util .Map ;
15- import java .util .concurrent . CopyOnWriteArrayList ;
15+ import java .util .Vector ;
1616
1717class UploadInfoV2 extends UploadInfo {
1818 private final static String TypeKey = "infoType" ;
@@ -38,7 +38,7 @@ private UploadInfoV2(UploadSource source, int dataSize, List<UploadData> dataLis
3838 UploadInfoV2 (UploadSource source , Configuration configuration ) {
3939 super (source );
4040 this .dataSize = Math .min (configuration .chunkSize , maxDataSize );
41- this .dataList = new CopyOnWriteArrayList <>();
41+ this .dataList = new Vector <>(2 , 2 );
4242 }
4343
4444 static UploadInfoV2 infoFromJson (UploadSource source , JSONObject jsonObject ) {
@@ -50,13 +50,14 @@ static UploadInfoV2 infoFromJson(UploadSource source, JSONObject jsonObject) {
5050 String type = null ;
5151 Long expireAt = null ;
5252 String uploadId = null ;
53- List <UploadData > dataList = new CopyOnWriteArrayList <>() ;
53+ List <UploadData > dataList = null ;
5454 try {
5555 type = jsonObject .optString (TypeKey );
5656 dataSize = jsonObject .getInt ("dataSize" );
5757 expireAt = jsonObject .getLong ("expireAt" );
5858 uploadId = jsonObject .optString ("uploadId" );
5959 JSONArray dataJsonArray = jsonObject .getJSONArray ("dataList" );
60+ dataList = new Vector <>(dataJsonArray .length (), 2 );
6061 for (int i = 0 ; i < dataJsonArray .length (); i ++) {
6162 JSONObject dataJson = dataJsonArray .getJSONObject (i );
6263 UploadData data = UploadData .dataFromJson (dataJson );
0 commit comments