[10?] RFR: 8193128: Reduce number of implementation classes returned by List/Set/Map.of() (original) (raw)

Andrej Golovnin andrej.golovnin at gmail.com
Fri Dec 8 06:54:25 UTC 2017


Hi Claes,

http://cr.openjdk.java.net/~redestad/8193128/open.02/

I think you should provide specialised implementations of the #indexOf() and #lastIndexOf() methods in the classes List12 and ListN. Using an iterator in List12 is an overkill. But even in ListN using a simple for loop would be much better. In any case please take look at the implementation of the #lastIndexOf() method in the AbstractImmutableList class. It looks like a copy of AbstractImmutableList#indexOf() and this is wrong.

Best regards, Andrej Golovnin



More information about the core-libs-dev mailing list