Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maps.MapBuilder::and does not return parameterized MapBuilder #591

Closed
chtseac opened this issue May 15, 2020 · 1 comment · Fixed by #597
Closed

Maps.MapBuilder::and does not return parameterized MapBuilder #591

chtseac opened this issue May 15, 2020 · 1 comment · Fixed by #597
Labels
Milestone

Comments

@chtseac
Copy link

chtseac commented May 15, 2020

MapBuilder and(K key, V value);

Using and even once and the type parameters are erased and you have to put @SuppressWarnings("unchecked") on that line.

@SuppressWarnings("unchecked")
Map<String, String> myMap = Maps
    .<String, String>of("key1", "value1")  // MapBuilder<String, String>
    .and("key2", "value2")                 // MapBuilder
    .build();                              // Map
@lhazlewood
Copy link
Contributor

cc @bdemers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants