valhalla-spec-comments post from jackammo77 at gmail.com requires approval
forax at univ-mlv.fr
Wed Feb 20 14:01:28 UTC 2019
----- Mail original -----
> De: "Stephen Colebourne" <scolebourne at joda.org>
> À: "valhalla-dev" <valhalla-dev at openjdk.java.net>
> Envoyé: Mercredi 20 Février 2019 13:21:22
> Objet: Re: valhalla-spec-comments post from jackammo77 at gmail.com requires approval
> On Wed, 20 Feb 2019 at 01:05, John Rose <john.r.rose at oracle.com> wrote:
>> For me, I think we should all work on getting used to
>> the idea that some Java objects *should not* be
>> synchronizable. Well, that's already true, but let's
>> give our JVM permission to diagnose that particular
>> "should not" with an IllegalMonitorStateException
>> or something like that. Bad? Yes, but the least-bad,
>> where value types are concerned.
> Is there a way to ease the pain?
if we want to ease the pain, the best is as John said to teach that synchronized doesn't work on some objects and emit a compile error when someone try to synchronized on String, Integer or Class (all are interned references) to spread the knowledge that you can not synchronized on all objects.
More information about the valhalla-dev