Skip to content

Commit

Permalink
Field field.isSynthetic 如果为复合字段直接忽略就OK
Browse files Browse the repository at this point in the history
  • Loading branch information
chenguijian committed Oct 5, 2023
1 parent 09ba04a commit a7fb570
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions wedoxdb/src/main/java/com/onedream/wedoxdb/SQLiteHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,13 @@ private static <T> Object setValues2Fields(Cursor c, Class<T> clazz)
Field[] fields = clazz.getDeclaredFields();

for (Field _field : fields) {
//修复:报错not find column $.jacocoData
//private static transient boolean[] .$jacocoData
if(_field.isSynthetic()){ //判断一下当前字段是否为复合字段
printLog("我是复合字段,不处理:"+_field.toString());
break;//复合字段不处理
}
//
Class<? extends Object> typeClass = _field.getType();// 属性类型
for (String columnName : columnNames) {
typeClass = DBUtils.getBasicClass(typeClass);
Expand All @@ -461,8 +468,7 @@ private static <T> Object setValues2Fields(Cursor c, Class<T> clazz)
_field.set(obj, attribute);
break;
}
} else if (typeClass.getName().equals("[Z") || typeClass.getName().equals("java.util.ArrayList") || typeClass.getName().equals("java.util.List") || typeClass.getName().equals("com.android.tools.fd.runtime.IncrementalChange")) {
//private static transient boolean[] .$jacocoData
} else if (typeClass.getName().equals("java.util.ArrayList") || typeClass.getName().equals("java.util.List") || typeClass.getName().equals("com.android.tools.fd.runtime.IncrementalChange")) {
break;
} else {
Object obj2 = setValues2Fields(c, typeClass);// 递归
Expand Down

0 comments on commit a7fb570

Please sign in to comment.