You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An ImmutableMap.Builder has two terminal methods which accomplish the same thing: build or buildOrThrow.
The buildOrThrow method should be preferred, because the documentation of build specifies:
Prefer the equivalent method {@link #buildOrThrow()} to make it explicit that the method will throw an exception if there are duplicate keys. The {@code build()} method will soon be deprecated.
Description of the proposed new feature
Support a stylistic preference.
Avoid a common gotcha, or potential problem.
Make the behavior evident: an exception may be thrown (in case of duplicate keys).
Problem
An
ImmutableMap.Builder
has two terminal methods which accomplish the same thing:build
orbuildOrThrow
.The
buildOrThrow
method should be preferred, because the documentation ofbuild
specifies:Description of the proposed new feature
I would like to rewrite the following code:
to:
The text was updated successfully, but these errors were encountered: