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

Reply via email to