Return-Path: Delivered-To: apmail-incubator-bval-commits-archive@minotaur.apache.org Received: (qmail 55935 invoked from network); 1 Feb 2011 16:45:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Feb 2011 16:45:39 -0000 Received: (qmail 32263 invoked by uid 500); 1 Feb 2011 16:45:39 -0000 Delivered-To: apmail-incubator-bval-commits-archive@incubator.apache.org Received: (qmail 32228 invoked by uid 500); 1 Feb 2011 16:45:38 -0000 Mailing-List: contact bval-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: bval-dev@incubator.apache.org Delivered-To: mailing list bval-commits@incubator.apache.org Received: (qmail 32221 invoked by uid 99); 1 Feb 2011 16:45:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Feb 2011 16:45:37 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Feb 2011 16:45:37 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 0C06323889D7; Tue, 1 Feb 2011 16:45:17 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1066090 - /incubator/bval/sandbox/lang3-work/bval-core/src/main/java/org/apache/bval/model/FeaturesCapable.java Date: Tue, 01 Feb 2011 16:45:17 -0000 To: bval-commits@incubator.apache.org From: mbenson@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110201164517.0C06323889D7@eris.apache.org> Author: mbenson Date: Tue Feb 1 16:45:16 2011 New Revision: 1066090 URL: http://svn.apache.org/viewvc?rev=1066090&view=rev Log: make it possible for FeaturesCapable subclasses to use a specific type of features Map Modified: incubator/bval/sandbox/lang3-work/bval-core/src/main/java/org/apache/bval/model/FeaturesCapable.java Modified: incubator/bval/sandbox/lang3-work/bval-core/src/main/java/org/apache/bval/model/FeaturesCapable.java URL: http://svn.apache.org/viewvc/incubator/bval/sandbox/lang3-work/bval-core/src/main/java/org/apache/bval/model/FeaturesCapable.java?rev=1066090&r1=1066089&r2=1066090&view=diff ============================================================================== --- incubator/bval/sandbox/lang3-work/bval-core/src/main/java/org/apache/bval/model/FeaturesCapable.java (original) +++ incubator/bval/sandbox/lang3-work/bval-core/src/main/java/org/apache/bval/model/FeaturesCapable.java Tue Feb 1 16:45:16 2011 @@ -31,7 +31,7 @@ import org.apache.commons.lang3.ArrayUti public abstract class FeaturesCapable implements Serializable { private static final long serialVersionUID = -4045110242904814218L; - private ConcurrentMap features = new ConcurrentHashMap(); + private ConcurrentMap features = createFeaturesMap(); /** key = validation id, value = the validation */ private Validation[] validations = new Validation[0]; @@ -153,7 +153,8 @@ public abstract class FeaturesCapable im * @param target */ protected void copyInto(T target) { - target.features = new ConcurrentHashMap(features); + target.features = target.createFeaturesMap(); + target.features.putAll(features); if (validations != null) { target.validations = validations.clone(); } @@ -203,6 +204,14 @@ public abstract class FeaturesCapable im return false; } + /** + * Create a features map for this {@link FeaturesCapable} object. + * @return ConcurrentMap + */ + protected ConcurrentMap createFeaturesMap() { + return new ConcurrentHashMap(); + } + private boolean acquireLockIfNeeded() { if (locking) { lock.lock();