mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
Cleanup - Collection.toArray
This commit is contained in:
@@ -245,7 +245,7 @@ public final class NameGenerator {
|
||||
Collections.addAll(all, fantasyMales);
|
||||
Collections.addAll(all, genericFemales);
|
||||
Collections.addAll(all, fantasyFemales);
|
||||
sourceList = all.toArray(new String[all.size()]);
|
||||
sourceList = all.toArray(new String[0]);
|
||||
useMoniker = MyRandom.getRandom().nextFloat() <= 0.04f;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ public abstract class StorageReaderRecursiveFolderWithUserFolder<T> extends Stor
|
||||
|
||||
forgeFormats.addAll(customFormats);
|
||||
|
||||
final File[] files = forgeFormats.toArray(new File[forgeFormats.size()]);
|
||||
final File[] files = forgeFormats.toArray(new File[0]);
|
||||
|
||||
for (final File file : files) {
|
||||
try {
|
||||
|
||||
@@ -104,7 +104,7 @@ public class TokenInfo {
|
||||
if (c.getType().isLegendary()) {
|
||||
relevantTypes.add("Legendary");
|
||||
}
|
||||
return relevantTypes.toArray(new String[relevantTypes.size()]);
|
||||
return relevantTypes.toArray(new String[0]);
|
||||
}
|
||||
|
||||
private Card toCard(Game game) {
|
||||
|
||||
@@ -149,7 +149,7 @@ public class Untap extends Phase {
|
||||
}
|
||||
}
|
||||
final CardCollection untapList = new CardCollection(list);
|
||||
final String[] restrict = restrictUntap.keySet().toArray(new String[restrictUntap.keySet().size()]);
|
||||
final String[] restrict = restrictUntap.keySet().toArray(new String[0]);
|
||||
list = CardLists.filter(list, c -> {
|
||||
if (!Untap.canUntap(c)) {
|
||||
return false;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -281,7 +281,7 @@ public class SpellSmithScene extends UIScene {
|
||||
loadEditions(); //just to be safe since it's preloaded, if somehow edition is null, then reload it
|
||||
editionList.clearListeners();
|
||||
editionList.clearItems();
|
||||
editionList.setItems(editions.toArray(new CardEdition[editions.size()]));
|
||||
editionList.setItems(editions.toArray(new CardEdition[0]));
|
||||
editionList.addListener(new ChangeListener() {
|
||||
@Override
|
||||
public void changed(ChangeEvent event, Actor actor) {
|
||||
|
||||
@@ -283,7 +283,7 @@ public class SoundSystem {
|
||||
invalidateSoundCache();
|
||||
}
|
||||
|
||||
return availableSets.toArray(new String[availableSets.size()]);
|
||||
return availableSets.toArray(new String[0]);
|
||||
}
|
||||
|
||||
public String getSoundDirectory() {
|
||||
@@ -341,6 +341,6 @@ public class SoundSystem {
|
||||
MusicPlaylist.invalidateMusicPlaylist();
|
||||
}
|
||||
|
||||
return availableSets.toArray(new String[availableSets.size()]);
|
||||
return availableSets.toArray(new String[0]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user