Spliterator flags as enum (was Initial java.util.Spliterator putback) (original) (raw)
Tim Peierls tim at peierls.net
Fri Mar 29 15:25:54 UTC 2013
- Previous message: Spliterator flags as enum (was Initial java.util.Spliterator putback)
- Next message: hg: jdk8/tl/jdk: 8010309: Improve PlatformLogger.isLoggable performance by direct mapping from an integer to Level
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Fri, Mar 29, 2013 at 10:53 AM, Doug Lea <dl at cs.oswego.edu> wrote:
But really, the painfulness quotient is equally important. We'd need to create immutableEnumSet class, and another class that can arbitrarily extend the Spliterator's enums with other control flags, all for the sake of arriving at an API that seems less clear and less easy to use than what we have.
That API doesn't exist, so it's not really fair to say that it seems less clear and easy to use. As far as I can see in the common discussions, no one has seriously explored any alternatives.
The presence of such flags in a Java 8 API would (and should) raise a lot of eyebrows, because it goes against what people have been told for well over a decade. If it's adopted as is, there had better be a good explanation for doc readers of why alternatives were rejected. "We were comfortable with int flags and nothing else significantly better suggested itself" won't cut it. "We know int flags aren't great for an API, but we tried very hard to find better alternatives, to no avail" would (if it were true).
--tim
- Previous message: Spliterator flags as enum (was Initial java.util.Spliterator putback)
- Next message: hg: jdk8/tl/jdk: 8010309: Improve PlatformLogger.isLoggable performance by direct mapping from an integer to Level
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]