2525package com .tmall .wireless .vaf .virtualview .core ;
2626
2727import java .util .ArrayList ;
28+ import java .util .HashMap ;
2829import java .util .LinkedList ;
2930import java .util .List ;
31+ import java .util .Map ;
32+ import java .util .concurrent .ConcurrentHashMap ;
3033
3134import android .support .v4 .app .ShareCompat .IntentBuilder ;
3235import android .support .v4 .util .ArrayMap ;
3336import android .util .Log ;
3437import android .view .View ;
38+
3539import com .libra .TextUtils ;
3640import com .libra .Utils ;
3741import com .libra .virtualview .common .TextBaseCommon ;
3842import com .libra .virtualview .common .ViewBaseCommon ;
43+
3944import org .json .JSONArray ;
4045import org .json .JSONObject ;
4146
@@ -49,7 +54,7 @@ public class ViewCache {
4954
5055 private List <ViewBase > mCacheView = new ArrayList <>();
5156
52- private ArrayMap <ViewBase , List <Item >> mCacheItem = new ArrayMap <>();
57+ private ConcurrentHashMap <ViewBase , List <Item >> mCacheItem = new ConcurrentHashMap <>();
5358
5459 private Object mComponentData ;
5560
@@ -244,7 +249,6 @@ public void bind(Object jsonObject, boolean isAppend) {
244249 }
245250
246251
247-
248252 break ;
249253 case TYPE_STRING :
250254 mView .setAttribute (mKey , Utils .toString (value ));
@@ -314,8 +318,8 @@ public void destroy() {
314318 mCacheView = null ;
315319 }
316320 if (mCacheItem != null ) {
317- for (int i = 0 , size = mCacheItem .size (); i < size ; i ++ ) {
318- List <Item > items = mCacheItem . valueAt ( i );
321+ for (Map . Entry < ViewBase , List < Item >> entry : mCacheItem .entrySet () ) {
322+ List <Item > items = entry . getValue ( );
319323 if (items != null ) {
320324 for (int j = 0 , length = items .size (); j < length ; j ++) {
321325 Item item = items .get (j );
@@ -481,14 +485,14 @@ public Object getValueFromEL(Object jsonObject) {
481485 result = jsonObject ;
482486 } else {
483487 if (jsonObject instanceof JSONObject ) {
484- result = ((JSONObject )jsonObject ).opt (key );
488+ result = ((JSONObject ) jsonObject ).opt (key );
485489 } else {
486490 break ;
487491 }
488492 }
489493 } else if (node instanceof Integer ) {
490494 if (jsonObject instanceof JSONArray ) {
491- result = ((JSONArray )jsonObject ).opt (((Integer )node ).intValue ());
495+ result = ((JSONArray ) jsonObject ).opt (((Integer ) node ).intValue ());
492496 } else {
493497 break ;
494498 }
@@ -586,23 +590,23 @@ public Object getValueFromEL(Object jsonObject) {
586590 if (conditionValue == null ) {
587591 determine = false ;
588592 } else if (conditionValue instanceof Boolean ) {
589- determine = ((Boolean )conditionValue ).booleanValue ();
593+ determine = ((Boolean ) conditionValue ).booleanValue ();
590594 } else if (conditionValue instanceof String ) {
591- if (TextUtils .isEmpty ((CharSequence )conditionValue )) {
595+ if (TextUtils .isEmpty ((CharSequence ) conditionValue )) {
592596 determine = false ;
593597 } else {
594- if (TextUtils .equals ((CharSequence )conditionValue , "null" )) {
598+ if (TextUtils .equals ((CharSequence ) conditionValue , "null" )) {
595599 determine = false ;
596- } else if (TextUtils .equals (((String )conditionValue ).toLowerCase (), "false" )) {
600+ } else if (TextUtils .equals (((String ) conditionValue ).toLowerCase (), "false" )) {
597601 determine = false ;
598602 }
599603 }
600604 } else if (conditionValue instanceof JSONObject ) {
601- if (((JSONObject )conditionValue ).length () == 0 ) {
605+ if (((JSONObject ) conditionValue ).length () == 0 ) {
602606 determine = false ;
603607 }
604608 } else if (conditionValue instanceof JSONArray ) {
605- if (((JSONArray )conditionValue ).length () == 0 ) {
609+ if (((JSONArray ) conditionValue ).length () == 0 ) {
606610 determine = false ;
607611 }
608612 } else if (conditionValue .equals (JSONObject .NULL )) {
@@ -627,7 +631,7 @@ public Object getValueFromEL(Object jsonObject) {
627631 * so we make Integer.MIN_VALUE as invalid input
628632 */
629633 public static int parseInt (String s ) {
630- return parseInt (s ,10 );
634+ return parseInt (s , 10 );
631635 }
632636
633637 public static int parseInt (String s , int radix ) {
@@ -673,7 +677,7 @@ public static int parseInt(String s, int radix) {
673677 multmin = limit / radix ;
674678 while (i < len ) {
675679 // Accumulating negatively avoids surprises near MAX_VALUE
676- digit = Character .digit (s .charAt (i ++),radix );
680+ digit = Character .digit (s .charAt (i ++), radix );
677681 if (digit < 0 ) {
678682 return Integer .MIN_VALUE ;
679683 }
0 commit comments