(SupportSQLiteDatabase database, String tableName)
| 84 | } |
| 85 | |
| 86 | @SuppressWarnings("TryFinallyCanBeTryWithResources") |
| 87 | private static Set<String> readColumns(SupportSQLiteDatabase database, String tableName) { |
| 88 | Cursor cursor = database.query("PRAGMA table_info(`" + tableName + "`)"); |
| 89 | Set<String> columns = new HashSet<>(); |
| 90 | try { |
| 91 | if (cursor.getColumnCount() > 0) { |
| 92 | int nameIndex = cursor.getColumnIndex("name"); |
| 93 | while (cursor.moveToNext()) { |
| 94 | columns.add(cursor.getString(nameIndex)); |
| 95 | } |
| 96 | } |
| 97 | } finally { |
| 98 | cursor.close(); |
| 99 | } |
| 100 | return columns; |
| 101 | } |
| 102 | |
| 103 | @SuppressWarnings("TryFinallyCanBeTryWithResources") |
| 104 | private static Set<String> readOptions(SupportSQLiteDatabase database, String tableName) { |
no test coverage detected