File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed
Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 11package bwapi ;
22
33import java .util .Arrays ;
4+ import java .util .Collections ;
45import java .util .List ;
56
67import static bwapi .Order .*;
@@ -223,7 +224,7 @@ public boolean targetsPosition() {
223224 }
224225
225226 public List <UnitType > whatsUses () {
226- return Arrays .asList (techWhatUses [id ]);
227+ return Collections . unmodifiableList ( Arrays .asList (techWhatUses [id ]) );
227228 }
228229
229230 public Order getOrder () {
Original file line number Diff line number Diff line change @@ -305,11 +305,11 @@ public TechType cloakingTech() {
305305 }
306306
307307 public List <TechType > abilities () {
308- return Arrays .asList (UnitTypeContainer .unitTechs [id ]);
308+ return Collections . unmodifiableList ( Arrays .asList (UnitTypeContainer .unitTechs [id ]) );
309309 }
310310
311311 public List <UpgradeType > upgrades () {
312- return Arrays .asList (UnitTypeContainer .upgrades [id ]);
312+ return Collections . unmodifiableList ( Arrays .asList (UnitTypeContainer .upgrades [id ]) );
313313 }
314314
315315 public UpgradeType armorUpgrade () {
@@ -644,15 +644,15 @@ public boolean canBuildAddon() {
644644 }
645645
646646 public List <UnitType > buildsWhat () {
647- return Arrays .asList (UnitTypeContainer .buildsWhat [id ]);
647+ return Collections . unmodifiableList ( Arrays .asList (UnitTypeContainer .buildsWhat [id ]) );
648648 }
649649
650650 public List <TechType > researchesWhat () {
651- return Arrays .asList (UnitTypeContainer .researchesWhat [id ]);
651+ return Collections . unmodifiableList ( Arrays .asList (UnitTypeContainer .researchesWhat [id ]) );
652652 }
653653
654654 public List <UpgradeType > upgradesWhat () {
655- return Arrays .asList (UnitTypeContainer .upgradesWhat [id ]);
655+ return Collections . unmodifiableList ( Arrays .asList (UnitTypeContainer .upgradesWhat [id ]) );
656656 }
657657
658658 public boolean isSuccessorOf (final UnitType type ) {
Original file line number Diff line number Diff line change 11package bwapi ;
22
33import java .util .Arrays ;
4+ import java .util .Collections ;
45import java .util .List ;
56
67public enum UpgradeType {
@@ -252,7 +253,7 @@ public UnitType whatUpgrades() {
252253 }
253254
254255 public List <UnitType > whatUses () {
255- return Arrays .asList (upgradeWhatUses [id ]);
256+ return Collections . unmodifiableList ( Arrays .asList (upgradeWhatUses [id ]) );
256257 }
257258
258259 public int maxRepeats () {
You can’t perform that action at this time.
0 commit comments