diff --git a/library/src/main/java/com/orm/util/ReflectionUtil.java b/library/src/main/java/com/orm/util/ReflectionUtil.java index a740b42d..81047a6c 100644 --- a/library/src/main/java/com/orm/util/ReflectionUtil.java +++ b/library/src/main/java/com/orm/util/ReflectionUtil.java @@ -159,7 +159,7 @@ public static void setFieldValueFromCursor(Cursor cursor, Field field, Object ob if (colName.equalsIgnoreCase("id")) { long cid = cursor.getLong(columnIndex); - field.set(object, Long.valueOf(cid)); + field.set(object, cid); } else if (fieldType.equals(long.class) || fieldType.equals(Long.class)) { field.set(object, cursor.getLong(columnIndex)); @@ -212,7 +212,8 @@ public static void setFieldValueFromCursor(Cursor cursor, Field field, Object ob Log.e("Sugar", "Enum cannot be read from Sqlite3 database. Please check the type of field " + field.getName()); } } else - Log.e("Sugar", "Class cannot be read from Sqlite3 database. Please check the type of field " + field.getName() + "(" + field.getType().getName() + ")"); + Log.e("Sugar", "Class cannot be read from Sqlite3 database. Please check the type of field " + + field.getName() + "(" + field.getType().getName() + ")"); } catch (IllegalArgumentException e) { Log.e("field set error", e.getMessage()); } catch (IllegalAccessException e) { @@ -324,7 +325,7 @@ private static List getAllClasses(Context context) throws PackageManager private static void populateFiles(File path, List fileNames, String parent) { if (path.isDirectory()) { for (File newPath : path.listFiles()) { - if ("".equals(parent)) { + if (parent.isEmpty()) { populateFiles(newPath, fileNames, path.getName()); } else { populateFiles(newPath, fileNames, parent + "." + path.getName()); @@ -335,7 +336,7 @@ private static void populateFiles(File path, List fileNames, String pare String classSuffix = ".class"; pathName = pathName.endsWith(classSuffix) ? pathName.substring(0, pathName.length() - classSuffix.length()) : pathName; - if ("".equals(parent)) { + if (parent.isEmpty()) { fileNames.add(pathName); } else { fileNames.add(parent + "." + pathName);