Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make [
EnumMap(Map)
](https://docs.oracle.com/en/java/javase/21/docs/…
…api/java.base/java/util/EnumMap.html#%3Cinit%3E(java.util.Map)) throw if passed an empty `Map` (other than an `EnumMap`). My motivation is that I'm migrating Guava's tests to run under J2CL, and we have [a test](https://github.com/google/guava/blob/b567b26e2bd6ea679b8cf69711cc8a41ecf219c4/guava-tests/test/com/google/common/collect/MapsTest.java#L359-L366) that expects an `IllegalArgumentException` in this case. Now, that's really more a test of the implementation of `EnumMap` than it is of a test of Guava, so I could see deleting the test or at least not running it under J2CL. But I figured I'd at least run this CL by you first to see if you thought the behavior was worth considering changing. (Not that I love the JDK's design of this API, and not that J2CL actually needs a non-empty map.) PiperOrigin-RevId: 570769285
- Loading branch information