resolve https://issues.apache.org/activemq/browse/AMQ-2350 - amq may not have exclusive access to the propertyEditorManager

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@801989 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2009-08-07 13:16:56 +00:00
parent 1a6279e170
commit 6b283abdd0
1 changed files with 12 additions and 10 deletions

View File

@ -42,16 +42,18 @@ public final class IntrospectionSupport {
String[] additionalPath = new String[] { String[] additionalPath = new String[] {
"org.springframework.beans.propertyeditors", "org.springframework.beans.propertyeditors",
"org.apache.activemq.util" }; "org.apache.activemq.util" };
synchronized (PropertyEditorManager.class) {
String[] searchPath = (String[]) Array.newInstance(String.class, String[] existingSearchPath = PropertyEditorManager.getEditorSearchPath();
PropertyEditorManager.getEditorSearchPath().length String[] newSearchPath = (String[]) Array.newInstance(String.class,
+ additionalPath.length); existingSearchPath.length + additionalPath.length);
System.arraycopy(PropertyEditorManager.getEditorSearchPath(), 0, System.arraycopy(existingSearchPath, 0,
searchPath, 0, newSearchPath, 0,
PropertyEditorManager.getEditorSearchPath().length); existingSearchPath.length);
System.arraycopy(additionalPath, 0, searchPath, PropertyEditorManager System.arraycopy(additionalPath, 0,
.getEditorSearchPath().length, additionalPath.length); newSearchPath, existingSearchPath.length,
PropertyEditorManager.setEditorSearchPath(searchPath); additionalPath.length);
PropertyEditorManager.setEditorSearchPath(newSearchPath);
}
} }
private IntrospectionSupport() { private IntrospectionSupport() {