Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
[Android] fix ConcurrentModificationException for analyzerList && pri…
Browse files Browse the repository at this point in the history
…nt error log when exception (#2647)
  • Loading branch information
lucky-chen authored and Darin726 committed Jul 3, 2019
1 parent 4695a70 commit 45da9ef
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java
Original file line number Diff line number Diff line change
Expand Up @@ -1652,6 +1652,7 @@ public void onChangeElement(WXComponent component, boolean isOutOfScreen) {

public void onRenderError(final String errCode, final String msg) {
if (mRenderListener != null && mContext != null) {
WXLogUtils.e("onRenderError "+errCode +","+msg);
runOnUiThread(new Runnable() {

@Override
Expand All @@ -1667,6 +1668,7 @@ public void run() {
public void onJSException(final String errCode, final String function, final String exception) {
hasException = true;
if (mRenderListener != null && mContext != null) {
WXLogUtils.e("onJSException "+errCode +","+exception);
runOnUiThread(new Runnable() {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/
package com.taobao.weex.performance;

import java.util.Iterator;
import java.util.List;

import android.util.Log;
Expand Down Expand Up @@ -71,8 +72,10 @@ public static void transferPerformance(String instanceId,String type,String key,
return;
}

for (IWXAnalyzer transfer : transferList) {
transfer.transfer(MODULE_WX_APM, instance.getInstanceId(), type, data);
Iterator<IWXAnalyzer> itr = transferList.iterator();
while (itr.hasNext()){
IWXAnalyzer item = itr.next();
item.transfer(MODULE_WX_APM, instance.getInstanceId(), type, data);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static WXStateRecord getInstance() {

private WXStateRecord() {
mExceptionHistory = new RecordList<>(5);
mActionHistory = new RecordList<>(10);
mActionHistory = new RecordList<>(20);
mJsfmInitHistory = new RecordList<>(3);
mJscCrashHistory = new RecordList<>(3);
mJscReloadHistory = new RecordList<>(5);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public static void commitCriticalExceptionRT(@Nullable final String instanceId,
@Nullable final Map<String,String> extParams ) {

try {
WXLogUtils.e("weex","commitCriticalExceptionRT :"+errCode+"exception"+exception);
WXStateRecord.getInstance().recordException(instanceId,exception);
IWXConfigAdapter configAdapter = WXSDKManager.getInstance().getWxConfigAdapter();
boolean doCheck = true;
Expand Down

0 comments on commit 45da9ef

Please sign in to comment.