Skip to content

Commit

Permalink
Fix error-prone crash
Browse files Browse the repository at this point in the history
  • Loading branch information
RoiEXLab committed Feb 22, 2018
1 parent f7df208 commit 3b109d8
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public static <T> MutableProperty<T> of(
/**
* Convenience method to create a generic String instance of this interface.
*/
public static MutableProperty<String> of(
public static MutableProperty<String> ofString(
final ThrowingConsumer<String, Exception> setter,
final Supplier<String> getter,
final Runnable resetter) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void validate(final GameData data) {}
@Override
public Map<String, MutableProperty<?>> getPropertyMap() {
return ImmutableMap.<String, MutableProperty<?>>builder()
.put("value", MutableProperty.of(this::setValue, this::getValue, this::resetValue))
.put("value", MutableProperty.ofString(this::setValue, this::getValue, this::resetValue))
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public void validate(final GameData data) throws GameParseException {
@Override
public Map<String, MutableProperty<?>> getPropertyMap() {
return ImmutableMap.<String, MutableProperty<?>>builder()
.put("canalName", MutableProperty.of(this::setCanalName, this::getCanalName, this::resetCanalName))
.put("canalName", MutableProperty.ofString(this::setCanalName, this::getCanalName, this::resetCanalName))
.put("landTerritories",
MutableProperty.of(
this::setLandTerritories,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -466,17 +466,17 @@ public Map<String, MutableProperty<?>> getPropertyMap() {
this::getImpArtTech,
this::resetImpArtTech))
.put("dice",
MutableProperty.of(
MutableProperty.ofString(
this::setDice,
this::getDice,
this::resetDice))
.put("side",
MutableProperty.of(
MutableProperty.ofString(
this::setSide,
this::getSide,
this::resetSide))
.put("faction",
MutableProperty.of(
MutableProperty.ofString(
this::setFaction,
this::getFaction,
this::resetFaction))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void validate(final GameData data) {
@Override
public Map<String, MutableProperty<?>> getPropertyMap() {
return ImmutableMap.<String, MutableProperty<?>>builder()
.put("name", MutableProperty.of(this::setName, this::getName, () -> {
.put("name", MutableProperty.ofString(this::setName, this::getName, () -> {
}))
.build();
}
Expand Down

0 comments on commit 3b109d8

Please sign in to comment.