inconsistent naming of Stream.sorted()?
brian.goetz at oracle.com
Thu May 23 08:02:05 PDT 2013
Sort of :)
"sorted" is an adjective as well: "This list is sorted". This is a
slightly different statement than "this list has been sorted", where
sorted is used as a past participle.
The intent of this naming choice was that the method would produce a
stream that has the property of being sorted. In that way, it is
Granted, there are two subgroups here; one is sorted and distinct, where
the named attribute describes the *elements*, and the others describe a
property of the the *stream*, but I don't really see it as being
I think calling it "sort" would be much worse. (Then we'd have to
rename distinct to something like makeDistinct or removeDuplicates or
On 5/23/2013 10:40 AM, Gernot Neppert wrote:
> I've been testing build 90 of JDK 1.8, and I came up with this question:
> Stream.sorted is the only method that uses the past participle form of the
> verb that describes it.
> All others, (such as filter, map, etc.) simply use the infinitive.
> Was this a deliberate decision or an an oversight?
More information about the lambda-dev