From: "Enrico Weigelt, metux IT consult" <[email protected]>
---
.../freecol/client/gui/panel/colopedia/GoodsDetailPanel.java | 2 +-
src/net/sf/freecol/common/model/GoodsType.java | 2 +-
src/net/sf/freecol/common/model/Specification.java | 11 +----------
src/net/sf/freecol/common/model/Unit.java | 2 +-
4 files changed, 4 insertions(+), 13 deletions(-)
diff --git
a/src/net/sf/freecol/client/gui/panel/colopedia/GoodsDetailPanel.java
b/src/net/sf/freecol/client/gui/panel/colopedia/GoodsDetailPanel.java
index 22268485a75..d07ee78b57c 100644
--- a/src/net/sf/freecol/client/gui/panel/colopedia/GoodsDetailPanel.java
+++ b/src/net/sf/freecol/client/gui/panel/colopedia/GoodsDetailPanel.java
@@ -157,7 +157,7 @@ public class GoodsDetailPanel extends
ColopediaGameObjectTypePanel<GoodsType> {
}
}
List<Role> roles = new ArrayList<>();
- allTypes = filterBuildables(getSpecification().getRolesList(),
+ allTypes = filterBuildables(getSpecification().getRoles(),
roles, type);
if (!roles.isEmpty()) {
panel.add(Utility.localizedLabel("colopedia.goods.equipment"),
diff --git a/src/net/sf/freecol/common/model/GoodsType.java
b/src/net/sf/freecol/common/model/GoodsType.java
index 5402f534154..a4f2d98cc66 100644
--- a/src/net/sf/freecol/common/model/GoodsType.java
+++ b/src/net/sf/freecol/common/model/GoodsType.java
@@ -501,7 +501,7 @@ public final class GoodsType extends FreeColSpecObjectType {
List<BuildableType> buildableTypes = new ArrayList<>();
buildableTypes.addAll(spec.getBuildingTypeList());
buildableTypes.addAll(spec.getUnitTypeList());
- buildableTypes.addAll(spec.getRolesList());
+ buildableTypes.addAll(spec.getRoles());
forEach(flatten(buildableTypes, BuildableType::getRequiredGoods),
ag -> ag.getType().buildingMaterial = true);
diff --git a/src/net/sf/freecol/common/model/Specification.java
b/src/net/sf/freecol/common/model/Specification.java
index 3e7b5364044..950ea4d0049 100644
--- a/src/net/sf/freecol/common/model/Specification.java
+++ b/src/net/sf/freecol/common/model/Specification.java
@@ -1622,20 +1622,11 @@ public final class Specification {
*
* @return A list of available {@code Role}s.
*/
- public List<Role> getRolesList() {
+ public List<Role> getRoles() {
return this.roles;
}
/**
- * Get all the available roles as a stream.
- *
- * @return A stream of available {@code Role}s.
- */
- public Stream<Role> getRoles() {
- return getRolesList().stream();
- }
-
- /**
* Get a role by identifier.
*
* @param id The object identifier.
diff --git a/src/net/sf/freecol/common/model/Unit.java
b/src/net/sf/freecol/common/model/Unit.java
index b4f875550ec..90be94f59a1 100644
--- a/src/net/sf/freecol/common/model/Unit.java
+++ b/src/net/sf/freecol/common/model/Unit.java
@@ -885,7 +885,7 @@ public class Unit extends GoodsLocation
* @return A list of available {@code Role}s.
*/
public List<Role> getAvailableRolesList(List<Role> roles) {
- if (roles == null) roles = getSpecification().getRolesList();
+ if (roles == null) roles = getSpecification().getRoles();
return transform(roles, r -> roleIsAvailable(r));
}
--
2.11.0.rc0.7.gbe5a750
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Freecol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freecol-developers