groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mauro Molinari <mauro...@tiscali.it>
Subject @Synchronized on fields
Date Wed, 19 Aug 2015 08:38:44 GMT
Hi,
I wrote this as a post-mortem comment to bug GROOVY-4697, but didn't 
receive any answer.
Probably, there's something obvious I'm missing, anyway I was wondering 
why Groovy doesn't support @Synchronized on fields, something like this:

class MyClass {
   @Synchronized
   String  foo
}

that is, to say that the generated getter and setter methods should be 
synchronized (in the same way they are if I write them explicitly and 
annotate themselves with @Synchronized). Right now, to get a simple 
synchronized access to a field, I have to write something almost as much 
verbose as Java.

Thanks in advance for any hint.
Mauro


Mime
View raw message