Skip to content

Commit

Permalink
few cleanings for more readeable code
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyMontoya committed Oct 28, 2015
1 parent 0150451 commit b1a66da
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions library/src/main/java/com/orm/util/ReflectionUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -324,7 +325,7 @@ private static List<String> getAllClasses(Context context) throws PackageManager
private static void populateFiles(File path, List<String> 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());
Expand All @@ -335,7 +336,7 @@ private static void populateFiles(File path, List<String> 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);
Expand Down

0 comments on commit b1a66da

Please sign in to comment.