Return-Path: X-Original-To: apmail-groovy-dev-archive@minotaur.apache.org Delivered-To: apmail-groovy-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C09F318F0B for ; Wed, 19 Aug 2015 08:38:53 +0000 (UTC) Received: (qmail 80515 invoked by uid 500); 19 Aug 2015 08:38:53 -0000 Delivered-To: apmail-groovy-dev-archive@groovy.apache.org Received: (qmail 80473 invoked by uid 500); 19 Aug 2015 08:38:53 -0000 Mailing-List: contact dev-help@groovy.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.incubator.apache.org Delivered-To: mailing list dev@groovy.incubator.apache.org Received: (qmail 80462 invoked by uid 99); 19 Aug 2015 08:38:53 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Aug 2015 08:38:53 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 057B7182108 for ; Wed, 19 Aug 2015 08:38:53 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.008 X-Spam-Level: X-Spam-Status: No, score=-0.008 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.006, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id m-kVmawyipOi for ; Wed, 19 Aug 2015 08:38:52 +0000 (UTC) Received: from smtp.tiscali.it (michael-notr.mail.tiscali.it [213.205.33.216]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTP id 25F52210C9 for ; Wed, 19 Aug 2015 08:38:51 +0000 (UTC) Received: from [127.0.0.1] ([89.96.52.22]) by michael.mail.tiscali.it with id 6Yek1r0050Ukgup01YekZJ; Wed, 19 Aug 2015 10:38:44 +0200 x-auth-user: mauromol Subject: @Synchronized on fields To: dev@groovy.incubator.apache.org References: From: Mauro Molinari Message-ID: <55D44094.6030108@tiscali.it> Date: Wed, 19 Aug 2015 10:38:44 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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