mirror of
https://github.com/ankidroid/Anki-Android.git
synced 2024-09-20 12:02:16 +02:00
NF: remove useless casts, and related warning
This commit is contained in:
parent
dfbd491b3d
commit
34c87ba75f
@ -1160,7 +1160,7 @@ public class Reviewer extends AbstractFlashcardViewer {
|
||||
// This is how all other whiteboard settings are
|
||||
Integer whiteboardPenColor = MetaDB.getWhiteboardPenColor(this, getParentDid()).fromPreferences(sharedPrefs);
|
||||
if (whiteboardPenColor != null) {
|
||||
mWhiteboard.setPenColor((int) whiteboardPenColor);
|
||||
mWhiteboard.setPenColor(whiteboardPenColor);
|
||||
}
|
||||
|
||||
mWhiteboard.setOnPaintColorChangeListener(color -> MetaDB.storeWhiteboardPenColor(this, getParentDid(), !CardAppearance.isInNightMode(sharedPrefs), color));
|
||||
|
@ -240,7 +240,7 @@ public class CardContentProvider extends ContentProvider {
|
||||
/* Search for notes using direct SQL query */
|
||||
String[] proj = sanitizeNoteProjection(projection);
|
||||
String sql = SQLiteQueryBuilder.buildQueryString(false, "notes", proj, selection, null, null, order, null);
|
||||
return col.getDb().query(sql, (Object[])selectionArgs);
|
||||
return col.getDb().query(sql, selectionArgs);
|
||||
}
|
||||
case NOTES: {
|
||||
/* Search for notes using the libanki browser syntax */
|
||||
|
@ -82,7 +82,7 @@ public class PeripheralCommand {
|
||||
}
|
||||
|
||||
private static PeripheralCommand unicode(char unicodeChar, @ViewerCommandDef int command, CardSide side, ModifierKeys modifierKeys) {
|
||||
return new PeripheralCommand((Character) unicodeChar, command, side, modifierKeys);
|
||||
return new PeripheralCommand(unicodeChar, command, side, modifierKeys);
|
||||
}
|
||||
|
||||
public static PeripheralCommand keyCode(int keyCode, @ViewerCommandDef int command, CardSide side) {
|
||||
|
@ -104,14 +104,14 @@ public class DeckAdapter<T extends AbstractDeckTreeNode<T>> extends RecyclerView
|
||||
|
||||
public ViewHolder(View v) {
|
||||
super(v);
|
||||
deckLayout = (RelativeLayout) v.findViewById(R.id.DeckPickerHoriz);
|
||||
countsLayout = (LinearLayout) v.findViewById(R.id.counts_layout);
|
||||
deckExpander = (ImageButton) v.findViewById(R.id.deckpicker_expander);
|
||||
indentView = (ImageButton) v.findViewById(R.id.deckpicker_indent);
|
||||
deckName = (TextView) v.findViewById(R.id.deckpicker_name);
|
||||
deckNew = (TextView) v.findViewById(R.id.deckpicker_new);
|
||||
deckLearn = (TextView) v.findViewById(R.id.deckpicker_lrn);
|
||||
deckRev = (TextView) v.findViewById(R.id.deckpicker_rev);
|
||||
deckLayout = v.findViewById(R.id.DeckPickerHoriz);
|
||||
countsLayout = v.findViewById(R.id.counts_layout);
|
||||
deckExpander = v.findViewById(R.id.deckpicker_expander);
|
||||
indentView = v.findViewById(R.id.deckpicker_indent);
|
||||
deckName = v.findViewById(R.id.deckpicker_name);
|
||||
deckNew = v.findViewById(R.id.deckpicker_new);
|
||||
deckLearn = v.findViewById(R.id.deckpicker_lrn);
|
||||
deckRev = v.findViewById(R.id.deckpicker_rev);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2661,7 +2661,8 @@ public class SchedV2 extends AbstractSched {
|
||||
"select id from cards where id in " + Utils.ids2str(ids) + " and (queue != " + Consts.QUEUE_TYPE_NEW + " or type != " + Consts.CARD_TYPE_NEW + ")");
|
||||
mCol.getDb().execute("update cards set reps=0, lapses=0 where id in " + Utils.ids2str(nonNew));
|
||||
forgetCards(nonNew);
|
||||
mCol.log((Object[]) ids);
|
||||
//noinspection RedundantCast
|
||||
mCol.log((Object[]) ids); // Cast useful to indicate to indicate how to interpret varargs
|
||||
}
|
||||
|
||||
|
||||
|
@ -42,7 +42,7 @@ public class UtilsTest {
|
||||
ZipFile zipFile = new ZipFile(file);
|
||||
Enumeration<ZipArchiveEntry> zipEntries = zipFile.getEntries();
|
||||
while (zipEntries.hasMoreElements()) {
|
||||
ZipArchiveEntry ze2 = (ZipArchiveEntry) zipEntries.nextElement();
|
||||
ZipArchiveEntry ze2 = zipEntries.nextElement();
|
||||
Utils.unzipFiles(zipFile, "/tmp", new String[]{ze2.getName()}, null);
|
||||
}
|
||||
Assert.fail("Expected an IOException");
|
||||
|
Loading…
Reference in New Issue
Block a user