Skip to content

Commit 2037619

Browse files
committed
Fix some code syle issues.
1 parent 44561da commit 2037619

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

Mifare Classic Tool/app/src/main/java/de/syss/MifareClassicTool/Activities/DumpEditor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ private void decodeValueBlocks() {
739739
}
740740
}
741741

742-
if (tmpVBs.size() > 0) {
742+
if (!tmpVBs.isEmpty()) {
743743
String[] vb = tmpVBs.toArray(new String[0]);
744744
Intent intent = new Intent(this, ValueBlocksToInt.class);
745745
intent.putExtra(ValueBlocksToInt.EXTRA_VB, vb);

Mifare Classic Tool/app/src/main/java/de/syss/MifareClassicTool/Activities/KeyMapCreator.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ public void onCreateKeyMap(View view) {
366366
fileNames.add(c.getText().toString());
367367
}
368368
}
369-
if (fileNames.size() > 0) {
369+
if (!fileNames.isEmpty()) {
370370
// Check if key files still exists.
371371
ArrayList<File> keyFiles = new ArrayList<>();
372372
for (String fileName : fileNames) {
@@ -384,7 +384,7 @@ public void onCreateKeyMap(View view) {
384384
+ "doesn't exists anymore.");
385385
}
386386
}
387-
if (keyFiles.size() > 0) {
387+
if (!keyFiles.isEmpty()) {
388388
// Save last selected key files as "/"-separated string
389389
// (if corresponding setting is active).
390390
if (saveLastUsedKeyFiles) {

Mifare Classic Tool/app/src/main/java/de/syss/MifareClassicTool/Activities/WriteTag.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ private void checkDumpAndShowSectorChooserDialog(final String[] dump) {
799799
mDumpWithPos.remove(sector);
800800
}
801801
}
802-
if (mDumpWithPos.size() == 0) {
802+
if (mDumpWithPos.isEmpty()) {
803803
// Error. There is nothing to write.
804804
Toast.makeText(context, R.string.info_nothing_to_write,
805805
Toast.LENGTH_LONG).show();
@@ -1147,7 +1147,7 @@ private void checkDumpAgainstTag() {
11471147
}
11481148

11491149
// Show skip/cancel dialog (if needed).
1150-
if (list.size() != 0) {
1150+
if (!list.isEmpty()) {
11511151
// If the user skips all sectors/blocks that are not writable,
11521152
// the writeTag() method will be called.
11531153
LinearLayout ll = new LinearLayout(this);
@@ -1222,7 +1222,7 @@ private void writeDump(
12221222
final HashMap<Integer, HashMap<Integer, Integer>> writeOnPos,
12231223
final SparseArray<byte[][]> keyMap) {
12241224
// Check for write data.
1225-
if (writeOnPos.size() == 0) {
1225+
if (writeOnPos.isEmpty()) {
12261226
// Nothing to write. Exit.
12271227
Toast.makeText(this, R.string.info_nothing_to_write,
12281228
Toast.LENGTH_LONG).show();

Mifare Classic Tool/app/src/main/java/de/syss/MifareClassicTool/Common.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ private static String[] readLineByLine(BufferedReader reader,
425425
Log.e(LOG_TAG, "Error while reading from file.", ex);
426426
ret = null;
427427
}
428-
if (linesArray.size() > 0) {
428+
if (!linesArray.isEmpty()) {
429429
ret = linesArray.toArray(new String[0]);
430430
} else {
431431
ret = new String[]{""};

Mifare Classic Tool/app/src/main/java/de/syss/MifareClassicTool/MCDiffUtils.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public static SparseArray<Integer[][]> diffIndices(
7070
diffIndices.add(k);
7171
}
7272
}
73-
if (diffIndices.size() == 0) {
73+
if (diffIndices.isEmpty()) {
7474
// Block was identical.
7575
diffSector[j] = new Integer[0];
7676
} else {

Mifare Classic Tool/app/src/main/java/de/syss/MifareClassicTool/MCReader.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ public HashMap<Integer, HashMap<Integer, Integer>> isWritableOnPositions(
803803
}
804804

805805
}
806-
if (blockWithWriteInfo.size() > 0) {
806+
if (!blockWithWriteInfo.isEmpty()) {
807807
ret.put(sector, blockWithWriteInfo);
808808
}
809809
}
@@ -845,7 +845,7 @@ public int setKeyFile(File[] keyFiles, Context context) {
845845
}
846846
}
847847
}
848-
if (keys.size() > 0) {
848+
if (!keys.isEmpty()) {
849849
mHasAllZeroKey = keys.contains("000000000000");
850850
mKeysWithOrder = new ArrayList<>(keys);
851851
if (mHasAllZeroKey) {

0 commit comments

Comments
 (0)