cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asold...@apache.org
Subject [1/2] cxf git commit: [CXF-7339] Fix NPE due to weak reference being GC-ed
Date Wed, 26 Apr 2017 15:47:43 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes 0487b301a -> c74fd3862


[CXF-7339] Fix NPE due to weak reference being GC-ed


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/a0aa2349
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/a0aa2349
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/a0aa2349

Branch: refs/heads/3.1.x-fixes
Commit: a0aa23493598c6e7d2d9d41fd086bea430d4c6b5
Parents: 0487b30
Author: Alessio Soldano <asoldano@redhat.com>
Authored: Wed Apr 19 00:48:39 2017 +0200
Committer: Alessio Soldano <asoldano@redhat.com>
Committed: Wed Apr 26 17:46:29 2017 +0200

----------------------------------------------------------------------
 .../main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java  | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/a0aa2349/core/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java b/core/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java
index dcbe9fc..8d9bcb7 100644
--- a/core/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java
+++ b/core/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java
@@ -229,7 +229,10 @@ public final class JAXBContextCache {
                 if (cachedContextAndSchemasInternal != null) {
                     context = cachedContextAndSchemasInternal.getContext();
                     if (context == null) {
-                        JAXBCONTEXT_CACHE.remove(cachedContextAndSchemasInternal.getClasses());
+                        final Set<Class<?>> cls = cachedContextAndSchemasInternal.getClasses();
+                        if (cls != null) {
+                            JAXBCONTEXT_CACHE.remove(cls);
+                        }
                         cachedContextAndSchemasInternal = null;
                     } else {
                         return new CachedContextAndSchemas(context, cachedContextAndSchemasInternal.getClasses(),


Mime
View raw message