Skip to content

Commit

Permalink
[GR-19604] Minor option value fixes.
Browse files Browse the repository at this point in the history
PullRequest: graal/5250
  • Loading branch information
farquet committed Jan 27, 2020
2 parents 3e83a17 + 185fcef commit a542dda
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.util.Formatter;

import org.graalvm.collections.EconomicMap;
import org.graalvm.collections.UnmodifiableEconomicMap;

/**
* A key for an option. The value for an option is obtained from an {@link OptionValues} object.
Expand Down Expand Up @@ -145,7 +146,7 @@ public T getValue(OptionValues values) {
* {@link #getDefaultValue()}.
*/
@SuppressWarnings("unchecked")
public T getValueOrDefault(EconomicMap<OptionKey<?>, Object> values) {
public T getValueOrDefault(UnmodifiableEconomicMap<OptionKey<?>, Object> values) {
if (!values.containsKey(this)) {
return defaultValue;
}
Expand All @@ -157,7 +158,7 @@ public T getValueOrDefault(EconomicMap<OptionKey<?>, Object> values) {
* {@link #onValueUpdate(EconomicMap, Object, Object)} method is called once the value is set.
*
* @param values map of option values
* @param v the value to set for this key in {@code map}
* @param v the value to set for this key in {@code values}
*/
@SuppressWarnings("unchecked")
public void update(EconomicMap<OptionKey<?>, Object> values, Object v) {
Expand All @@ -170,7 +171,7 @@ public void update(EconomicMap<OptionKey<?>, Object> values, Object v) {
* {@link #onValueUpdate(EconomicMap, Object, Object)} method is called once the value is set.
*
* @param values map of option values
* @param v the value to set for this key in {@code map}
* @param v the value to set for this key in {@code values}
*/
@SuppressWarnings("unchecked")
public void putIfAbsent(EconomicMap<OptionKey<?>, Object> values, Object v) {
Expand Down

0 comments on commit a542dda

Please sign in to comment.