mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Merge remote-tracking branch 'origin/master' into code-cleanup
# Conflicts: # forge-ai/src/main/java/forge/ai/ability/PlayAi.java # forge-core/src/main/java/forge/util/collect/FCollection.java # forge-game/src/main/java/forge/game/ability/effects/PlayEffect.java
This commit is contained in:
@@ -760,7 +760,13 @@ public class FSkin {
|
||||
public static SkinIcon getIcon(final FSkinProp s0) {
|
||||
final SkinIcon icon = SkinIcon.icons.get(s0);
|
||||
if (icon == null) {
|
||||
throw new NullPointerException("Can't find an icon for FSkinProp " + s0);
|
||||
final SkinIcon blank = SkinIcon.icons.get(FSkinProp.ICO_BLANK);
|
||||
if (blank == null) // if blank is null at this point then the skin is bugged or GC?
|
||||
throw new NullPointerException("Can't find an icon for FSkinProp " + s0);
|
||||
else { // this should be 2 or less unless a new required image icon is needed.
|
||||
System.err.println("Missing image icon for FSkinProp " + s0 + ". Blank image will be used instead.");
|
||||
return blank;
|
||||
}
|
||||
}
|
||||
return icon;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import forge.game.card.CardCollection;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
@@ -15,7 +14,7 @@ public class FCollectionTest {
|
||||
/**
|
||||
* Just a quick test for FCollection.
|
||||
*/
|
||||
@Test
|
||||
/*@Test
|
||||
void testBadIteratorLogic() {
|
||||
List<Card> cards = new ArrayList<>();
|
||||
for (int i = 1; i < 5; i++)
|
||||
@@ -27,7 +26,7 @@ public class FCollectionTest {
|
||||
assertEquals(cc.size(), 3);
|
||||
}
|
||||
|
||||
@Test
|
||||
/*@Test
|
||||
void testBadIteratorLogicTwo() {
|
||||
List<Card> cards = new ArrayList<>();
|
||||
for (int i = 1; i <= 10; i++)
|
||||
@@ -40,7 +39,7 @@ public class FCollectionTest {
|
||||
i++;
|
||||
}
|
||||
assertEquals(cc.size(), 1);
|
||||
}
|
||||
}*/// Commented out since we use synchronized collection and it doesn't support modification while iteration
|
||||
|
||||
@Test
|
||||
void testCompletableFuture() {
|
||||
@@ -49,7 +48,7 @@ public class FCollectionTest {
|
||||
cards.add(new Card(i, null));
|
||||
CardCollection cc = new CardCollection(cards);
|
||||
List<CompletableFuture<Integer>> futures = new ArrayList<>();
|
||||
for (Card c : cc) {
|
||||
for (Card c : cc.threadSafeIterable()) {
|
||||
futures.add(CompletableFuture.supplyAsync(() -> {
|
||||
if (c.getId() % 2 > 0)
|
||||
cc.remove(c);
|
||||
|
||||
Reference in New Issue
Block a user