Skip to content

Commit c30328f

Browse files
Changes merged
1 parent c5fd928 commit c30328f

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

debug-db/src/main/java/com/amitshekhar/server/ClientServer.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
import android.content.Context;
2828
import android.content.SharedPreferences;
29-
import android.content.pm.LabeledIntent;
3029
import android.content.res.AssetManager;
3130
import android.database.Cursor;
3231
import android.database.sqlite.SQLiteDatabase;
@@ -374,17 +373,17 @@ private Response query(String sql) {
374373

375374
if (cursor.getCount() > 0) {
376375
do {
377-
List row = new ArrayList();
376+
List<Object> row = new ArrayList<>();
378377
for (int i = 0; i < cursor.getColumnCount(); i++) {
379378
switch (cursor.getType(i)) {
380379
case Cursor.FIELD_TYPE_BLOB:
381380
row.add(cursor.getBlob(i));
382381
break;
383382
case Cursor.FIELD_TYPE_FLOAT:
384-
row.add(Float.valueOf(cursor.getFloat(i)));
383+
row.add(cursor.getFloat(i));
385384
break;
386385
case Cursor.FIELD_TYPE_INTEGER:
387-
row.add(Integer.valueOf(cursor.getInt(i)));
386+
row.add(cursor.getInt(i));
388387
break;
389388
case Cursor.FIELD_TYPE_STRING:
390389
row.add(cursor.getString(i));
@@ -409,9 +408,9 @@ private Response query(String sql) {
409408

410409
public Response getDBList() {
411410
Response response = new Response();
412-
if (mDatabaseDir != null) {
411+
if (mDatabaseDir != null && mDatabaseDir.list() != null) {
413412
String[] list = mDatabaseDir.list();
414-
if(list != null) {
413+
if (list != null) {
415414
Collections.addAll(response.rows, list);
416415
}
417416
}
@@ -462,4 +461,4 @@ public Response getAllPrefData(String tag) {
462461
return response;
463462
}
464463

465-
}
464+
}

0 commit comments

Comments
 (0)