> On Dec 6, 2017, at 5:16 PM, Paul Sandoz <paul.san...@oracle.com> wrote:
> 
> It can, since final fields are not treated as really final (unless in 
> java.lang.invoke package, where it’s as if all such fields are annotated with 
> @Stable). C2 will treat the field value a constant value if the collection is 
> held in a static final field.

We could tweak the semantics of @Stable to omit the zero corner case for a 
final field. Then the annotation on a non-array field would mean “trust this 
final”.

It would be yet another stop gap before that far-off day when we fix finals 
(and arrays). Such new uses of @Stable would have to be evaluated for any 
interaction with deserialization, so it’s not a simple decision. 



Reply via email to