JUNEAU-176 - Race condition when parsing into array types.
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanContext.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanContext.java
index e4244e0..288dd03 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanContext.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/BeanContext.java
@@ -2695,12 +2695,6 @@
*/
final <T> ClassMeta<T> getClassMeta(Class<T> type, boolean waitForInit) {
- // If this is an array, then we want it wrapped in an uncached ClassMeta object.
- // Note that if it has a pojo swap, we still want to cache it so that
- // we can cache something like byte[] with ByteArraySwap.Base64.
- if (type.isArray() && findPojoSwaps(type) == null)
- return new ClassMeta(type, this, findImplClass(type), findBeanFilter(type), findPojoSwaps(type), findChildPojoSwaps(type), findExample(type));
-
// This can happen if we have transforms defined against String or Object.
if (cmCache == null)
return null;
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ClassMeta.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ClassMeta.java
index 1882fe8..1826aa3 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ClassMeta.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/ClassMeta.java
@@ -111,8 +111,8 @@
private final Map<Class<?>,Mutater<T,?>> toMutaters = new ConcurrentHashMap<>();
private final Mutater<String,T> stringMutater;
- private ReadWriteLock lock = new ReentrantReadWriteLock(false);
- private Lock rLock = lock.readLock(), wLock = lock.writeLock();
+ private final ReadWriteLock lock = new ReentrantReadWriteLock(false);
+ private final Lock rLock = lock.readLock(), wLock = lock.writeLock();
/**
* Construct a new {@code ClassMeta} based on the specified {@link Class}.