You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juneau.apache.org by ja...@apache.org on 2016/08/05 13:17:04 UTC
incubator-juneau git commit:
https://issues.apache.org/jira/browse/JUNEAU-4
Repository: incubator-juneau
Updated Branches:
refs/heads/master 82eca2873 -> dabe77a54
https://issues.apache.org/jira/browse/JUNEAU-4
Project: http://git-wip-us.apache.org/repos/asf/incubator-juneau/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-juneau/commit/dabe77a5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-juneau/tree/dabe77a5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-juneau/diff/dabe77a5
Branch: refs/heads/master
Commit: dabe77a5480538dfbb19ddcc287fa87add3cafa3
Parents: 82eca28
Author: jamesbognar <ja...@gmail.com>
Authored: Fri Aug 5 09:17:00 2016 -0400
Committer: jamesbognar <ja...@gmail.com>
Committed: Fri Aug 5 09:17:00 2016 -0400
----------------------------------------------------------------------
.../src/main/java/org/apache/juneau/BeanContext.java | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/dabe77a5/org.apache.juneau/src/main/java/org/apache/juneau/BeanContext.java
----------------------------------------------------------------------
diff --git a/org.apache.juneau/src/main/java/org/apache/juneau/BeanContext.java b/org.apache.juneau/src/main/java/org/apache/juneau/BeanContext.java
index 3b2f51c..9027d57 100644
--- a/org.apache.juneau/src/main/java/org/apache/juneau/BeanContext.java
+++ b/org.apache.juneau/src/main/java/org/apache/juneau/BeanContext.java
@@ -481,7 +481,7 @@ public class BeanContext extends Context {
// This map ensures that if the BeanContext properties in the ConfigFactory are the same,
// then we reuse the same Class->ClassMeta cache map.
// This significantly reduces the number of times we need to construct ClassMeta objects which can be expensive.
- private static final ConcurrentHashMap<ContextFactory.PropertyMap,Map<Class,ClassMeta>> cmCacheCache = new ConcurrentHashMap<ContextFactory.PropertyMap,Map<Class,ClassMeta>>();
+ private static final ConcurrentHashMap<Integer,Map<Class,ClassMeta>> cmCacheCache = new ConcurrentHashMap<Integer,Map<Class,ClassMeta>>();
/** Default config. All default settings. */
public static final BeanContext DEFAULT = ContextFactory.create().getContext(BeanContext.class);
@@ -542,9 +542,9 @@ public class BeanContext extends Context {
super(cf);
ContextFactory.PropertyMap pm = cf.getPropertyMap("BeanContext");
+ hashCode = pm.hashCode();
classLoader = cf.classLoader;
defaultParser = cf.defaultParser;
- hashCode = pm.hashCode;
beansRequireDefaultConstructor = pm.get(BEAN_beansRequireDefaultConstructor, boolean.class, false);
beansRequireSerializable = pm.get(BEAN_beansRequireSerializable, boolean.class, false);
@@ -622,13 +622,13 @@ public class BeanContext extends Context {
implKeyClasses = implClasses.keySet().toArray(new Class[0]);
implValueClasses = implClasses.values().toArray(new Class[0]);
- if (! cmCacheCache.containsKey(pm)) {
+ if (! cmCacheCache.containsKey(hashCode)) {
ConcurrentHashMap<Class,ClassMeta> cm = new ConcurrentHashMap<Class,ClassMeta>();
cm.put(String.class, new ClassMeta(String.class, this));
cm.put(Object.class, new ClassMeta(Object.class, this));
- cmCacheCache.putIfAbsent(pm, cm);
+ cmCacheCache.putIfAbsent(hashCode, cm);
}
- this.cmCache = cmCacheCache.get(pm);
+ this.cmCache = cmCacheCache.get(hashCode);
this.cmString = cmCache.get(String.class);
this.cmObject = cmCache.get(Object.class);
this.cmClass = cmCache.get(Class.class);
@@ -2031,7 +2031,7 @@ public class BeanContext extends Context {
@Override /* Object */
public boolean equals(Object o) {
if (o instanceof BeanContext)
- return ((BeanContext)o).cmCache == cmCache;
+ return ((BeanContext)o).hashCode == hashCode;
return false;
}