RFR(s): 8133977 add specification for serial form of immutable collections

Stuart Marks stuart.marks at oracle.com
Tue May 17 18:24:19 UTC 2016


On 5/17/16 3:33 AM, Peter Levart wrote:
> On 05/17/2016 10:55 AM, Stephen Colebourne wrote:
>> CollSer should not be public, especially not just for serialization
>> reasons.
>
> I don't see a compelling reason why. Javadocs mention it by name. By making it
> Serializable, it is effectively public, so it can't go away or be renamed. What
> is gained by hiding it?

CollSer should be kept private in the API.

I think we need to be careful about terminology here. The 'P' in API stands for 
*programming* and CollSer is not used by applications or by higher-level libraries.

The serialization format is "public" but in a wholly different sense from the 
API. The format is specified so that it's compatible across different JDK 
implementations and versions. By necessity, the string names of classes are 
visible in this format, but this isn't a programming interface.

I'm happy to remove mention of CollSer from the API specification.

s'marks



More information about the core-libs-dev mailing list