Cleanup - Collection.toArray

This commit is contained in:
Jetz
2024-08-10 10:25:35 -04:00
parent 158ff30ff8
commit ae9877ce3c
8 changed files with 10 additions and 10 deletions

View File

@@ -122,7 +122,7 @@ public class DialogChooseFormats {
choices.addAll(formats);
final FCheckBoxList<FCheckBox> cbl = new FCheckBoxList<>(false);
cbl.setListData(formats.toArray(new FCheckBox[formats.size()]));
cbl.setListData(formats.toArray(new FCheckBox[0]));
cbl.setVisibleRowCount(Math.min(20, formats.size()));
if (focused) {

View File

@@ -209,7 +209,7 @@ public class FCheckBoxTree extends JTree {
}
public TreePath[] getCheckedPaths() {
return checkedPaths.toArray(new TreePath[checkedPaths.size()]);
return checkedPaths.toArray(new TreePath[0]);
}
/**
@@ -227,7 +227,7 @@ public class FCheckBoxTree extends JTree {
checkedValues.add(data.item);
}
}
return checkedValues.toArray(new Object[checkedValues.size()]);
return checkedValues.toArray(new Object[0]);
}
// Returns true in case that the node is selected, has children but not all of them are selected