Skip to content
This repository has been archived by the owner on Sep 17, 2020. It is now read-only.

FP: Unsupported method call (2) #30

Open
ben-manes opened this issue Nov 6, 2016 · 1 comment
Open

FP: Unsupported method call (2) #30

ben-manes opened this issue Nov 6, 2016 · 1 comment

Comments

@ben-manes
Copy link

The Map.put() is unsupported.
This code calls Map.put(). However analysis found that this method as well as 
and its overrides (if applicable) unconditionally throw UnsupportedOperationException,
so it's likely that this call will fail.

This makes little sense to me as it is calling into a HashMap. It must be observing that AbstractMap#put() throws an UOE but the subclass does not.

Map<K, V> result = new HashMap<>(loaded.size());
loaded.forEach((key, value) -> {
  if ((key == null) || (value == null)) {
    nullBulkLoad.set(true);
  } else {
    result.put(key, value);
  }
});
@ben-manes
Copy link
Author

Probably the same as #25 but calling out separately as easier to isolate as a subclass confusion.

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

No branches or pull requests

1 participant