Author: davsclaus
Date: Fri Oct 5 07:27:43 2012
New Revision: 1394391
URL: http://svn.apache.org/viewvc?rev=1394391&view=rev
Log:
CAMEL-5675: Flush java bean introspector cache when stopping Camel. And
property editor is not thread safe.
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/util/IntrospectionSupport.java
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/util/IntrospectionSupport.java
URL:
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/util/IntrospectionSupport.java?rev=1394391&r1=1394390&r2=1394391&view=diff
==============================================================================
---
camel/trunk/camel-core/src/main/java/org/apache/camel/util/IntrospectionSupport.java
(original)
+++
camel/trunk/camel-core/src/main/java/org/apache/camel/util/IntrospectionSupport.java
Fri Oct 5 07:27:43 2012
@@ -60,6 +60,7 @@ public final class IntrospectionSupport
// use a weak cache as we dont want the cache to keep around as it
reference classes
// which could prevent classloader to unload classes if being referenced
from this cache
private static final LRUCache<Class<?>, ClassInfo> CACHE = new
LRUWeakCache<Class<?>, ClassInfo>(1000);
+ private static final Object LOCK = new Object();
static {
// exclude all java.lang.Object methods as we dont want to invoke them
@@ -494,7 +495,7 @@ public final class IntrospectionSupport
if (editor != null) {
// property editor is not thread safe, so we need to lock
Object answer;
- synchronized (editor) {
+ synchronized (LOCK) {
editor.setAsText(value.toString());
answer = editor.getValue();
}