okaywit / guava-libraries

Automatically exported from code.google.com/p/guava-libraries
Apache License 2.0
0 stars 0 forks source link

ImmutableList, etc. can be subclassed because package com.google.common.collect is not sealed #1485

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The javadoc of ImmutableList states:

>Note: Although this class is not final, it cannot be subclassed as it has no 
public or protected constructors.
>Thus, instances of this type are guaranteed to be immutable.

Which is patently false. 
You can create a subclass of ImmutableList as long as it resides on 
com.google.common.collect.

It would suffice to seal the Jar to prevent subclasses.

Original issue reported on code.google.com by jua...@gmail.com on 19 Jul 2013 at 9:48

GoogleCodeExporter commented 9 years ago
Anyone know what are the disadvantages of jar sealing?

Original comment by kevinb@google.com on 19 Jul 2013 at 9:51

GoogleCodeExporter commented 9 years ago

Original comment by kevinb@google.com on 20 Nov 2013 at 8:53

GoogleCodeExporter commented 9 years ago
This issue has been migrated to GitHub.

It can be found at https://github.com/google/guava/issues/<issue id>

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:12

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:17

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 3 Nov 2014 at 9:08