mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
make sure copyOnWriteArray list does not get overwritten by other structure
This commit is contained in:
@@ -92,7 +92,8 @@ public class CardCharacteristics {
|
|||||||
* the type to set
|
* the type to set
|
||||||
*/
|
*/
|
||||||
public final void setType(final ArrayList<String> type0) {
|
public final void setType(final ArrayList<String> type0) {
|
||||||
this.type = type0;
|
this.type.clear();
|
||||||
|
this.type.addAll(type0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -395,7 +396,7 @@ public class CardCharacteristics {
|
|||||||
// String name : just copy reference
|
// String name : just copy reference
|
||||||
this.name = source.getName();
|
this.name = source.getName();
|
||||||
// ArrayList<String> type : list of String objects so use copy constructor
|
// ArrayList<String> type : list of String objects so use copy constructor
|
||||||
this.type = new ArrayList<String>(source.getType());
|
this.type = new CopyOnWriteArrayList<String>(source.getType());
|
||||||
// CardManaCost manaCost : not sure if a deep copy is needed
|
// CardManaCost manaCost : not sure if a deep copy is needed
|
||||||
this.manaCost = source.getManaCost();
|
this.manaCost = source.getManaCost();
|
||||||
// ArrayList<CardColor> cardColor : not sure if a deep copy is needed
|
// ArrayList<CardColor> cardColor : not sure if a deep copy is needed
|
||||||
|
|||||||
Reference in New Issue
Block a user