Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A8D4CFE17 for ; Thu, 4 Apr 2013 16:55:48 +0000 (UTC) Received: (qmail 55947 invoked by uid 500); 4 Apr 2013 16:55:48 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 55868 invoked by uid 500); 4 Apr 2013 16:55:48 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 55770 invoked by uid 99); 4 Apr 2013 16:55:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Apr 2013 16:55:48 +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; Thu, 04 Apr 2013 16:55:45 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 94B9D23889D5; Thu, 4 Apr 2013 16:55:24 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1464629 - /cxf/branches/2.7.x-fixes/api/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java Date: Thu, 04 Apr 2013 16:55:24 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130404165524.94B9D23889D5@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dkulp Date: Thu Apr 4 16:55:24 2013 New Revision: 1464629 URL: http://svn.apache.org/r1464629 Log: Merged revisions 1464627 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/trunk ........ r1464627 | dkulp | 2013-04-04 12:50:21 -0400 (Thu, 04 Apr 2013) | 2 lines [CXF-4947] Minor cleanup of JAXBContextCache as per suggestion from Rex Wang(rwonly) ........ Modified: cxf/branches/2.7.x-fixes/api/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java Modified: cxf/branches/2.7.x-fixes/api/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/api/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java?rev=1464629&r1=1464628&r2=1464629&view=diff ============================================================================== --- cxf/branches/2.7.x-fixes/api/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java (original) +++ cxf/branches/2.7.x-fixes/api/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java Thu Apr 4 16:55:24 2013 @@ -47,13 +47,14 @@ import org.apache.cxf.common.util.String /** * */ -public final class JAXBContextCache { +public final class JAXBContextCache { + /** * Return holder of the context, classes, etc... * Do NOT hold onto these strongly as that can lock the JAXBContext and Set objects - * into memory. It prefererred to grab the context and classes (if needed) from this object + * into memory. It preferred to grab the context and classes (if needed) from this object * immediately after the call to getCachedContextAndSchemas and then discard it. The - * main purpose of this class is to hold onto the context/set stongly until the caller + * main purpose of this class is to hold onto the context/set strongly until the caller * has a chance to copy those into a place where they can hold onto it strongly as * needed. */ @@ -88,9 +89,9 @@ public final class JAXBContextCache { } } - public static final class CachedContextAndSchemasInternal { - private WeakReference context; - private WeakReference>> classes; + private static final class CachedContextAndSchemasInternal { + private final WeakReference context; + private final WeakReference>> classes; private Collection schemas; CachedContextAndSchemasInternal(JAXBContext context, Set> classes) { @@ -104,10 +105,7 @@ public final class JAXBContextCache { public Set> getClasses() { return classes.get(); } - public void setClasses(Set> cls) { - classes = new WeakReference>>(cls); - } - + public Collection getSchemas() { return schemas; } @@ -115,7 +113,7 @@ public final class JAXBContextCache { public void setSchemas(Collection schemas) { this.schemas = schemas; } - } + } private static final Map>, CachedContextAndSchemasInternal> JAXBCONTEXT_CACHE = new CacheMap>, CachedContextAndSchemasInternal>();