From a524fd3e5a5e991c2c32010fd32e4bd6596a8cb2 Mon Sep 17 00:00:00 2001 From: laoyuyu <511455842@qq.com> Date: Mon, 23 Dec 2019 21:00:02 +0800 Subject: [PATCH] fix bug https://github.com/AriaLyy/Aria/issues/573 --- DEV_LOG.md | 2 ++ .../com/arialyy/aria/orm/DelegateFind.java | 18 ++++++++++++------ .../com/arialyy/aria/util/ComponentUtil.java | 1 - README.md | 2 ++ .../simple/core/upload/HttpUploadActivity.java | 1 + 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/DEV_LOG.md b/DEV_LOG.md index 2d90f30c..6d6cae72 100644 --- a/DEV_LOG.md +++ b/DEV_LOG.md @@ -1,4 +1,6 @@ ## 开发日志 + + v_3.8.2 + - fix bug https://github.com/AriaLyy/Aria/issues/573 + v_3.8.1 (2019/12/22) - 修复一个表创建失败的问题 https://github.com/AriaLyy/Aria/issues/570 - 修复一个非分块模式下导致下载失败的问题 https://github.com/AriaLyy/Aria/issues/571 diff --git a/PublicComponent/src/main/java/com/arialyy/aria/orm/DelegateFind.java b/PublicComponent/src/main/java/com/arialyy/aria/orm/DelegateFind.java index 21f2af4f..55dbfffc 100644 --- a/PublicComponent/src/main/java/com/arialyy/aria/orm/DelegateFind.java +++ b/PublicComponent/src/main/java/com/arialyy/aria/orm/DelegateFind.java @@ -422,13 +422,19 @@ class DelegateFind extends AbsDelegate { private List exeNormalDataSql(SQLiteDatabase db, Class clazz, String sql, String[] selectionArgs) { SqlUtil.checkTable(db, clazz); - String[] temp = new String[selectionArgs.length]; - int i = 0; - for (String arg : selectionArgs) { - temp[i] = SqlUtil.encodeStr(arg); - i++; + Cursor cursor; + if (selectionArgs != null) { + + String[] temp = new String[selectionArgs.length]; + int i = 0; + for (String arg : selectionArgs) { + temp[i] = SqlUtil.encodeStr(arg); + i++; + } + cursor = db.rawQuery(sql, temp); + } else { + cursor = db.rawQuery(sql, null); } - Cursor cursor = db.rawQuery(sql, temp); List data = cursor.getCount() > 0 ? newInstanceEntity(clazz, cursor) : null; closeCursor(cursor); return data; diff --git a/PublicComponent/src/main/java/com/arialyy/aria/util/ComponentUtil.java b/PublicComponent/src/main/java/com/arialyy/aria/util/ComponentUtil.java index 75d9a2a0..5ea85006 100644 --- a/PublicComponent/src/main/java/com/arialyy/aria/util/ComponentUtil.java +++ b/PublicComponent/src/main/java/com/arialyy/aria/util/ComponentUtil.java @@ -28,7 +28,6 @@ import java.lang.ref.SoftReference; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Proxy; import java.util.List; /** diff --git a/README.md b/README.md index bed787dc..3cc991f4 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,8 @@ protected void onCreate(Bundle savedInstanceState) { ### [文档地址](https://aria.laoyuyu.me/aria_doc/) +### QQ群:524329160 + ### 版本日志 + v_3.8.1 (2019/12/22) diff --git a/app/src/main/java/com/arialyy/simple/core/upload/HttpUploadActivity.java b/app/src/main/java/com/arialyy/simple/core/upload/HttpUploadActivity.java index 4f6082a9..1413b02d 100644 --- a/app/src/main/java/com/arialyy/simple/core/upload/HttpUploadActivity.java +++ b/app/src/main/java/com/arialyy/simple/core/upload/HttpUploadActivity.java @@ -53,6 +53,7 @@ public class HttpUploadActivity extends BaseActivity { @Override protected void init(Bundle savedInstanceState) { setTile("D_HTTP 上传"); super.init(savedInstanceState); + Aria.upload(this).getTaskList(); mEntity = Aria.upload(this).getFirstUploadEntity(FILE_PATH);