Fixes AMQ-3181

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1070876 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2011-02-15 13:02:59 +00:00
parent 6b643dc2c3
commit 65f2428342
1 changed files with 24 additions and 20 deletions

View File

@ -38,26 +38,30 @@ import org.apache.activemq.command.ActiveMQDestination;
public final class IntrospectionSupport {
static {
// Add Spring and ActiveMQ specific property editors
String[] additionalPath = new String[] {
"org.springframework.beans.propertyeditors",
"org.apache.activemq.util" };
synchronized (PropertyEditorManager.class) {
String[] existingSearchPath = PropertyEditorManager.getEditorSearchPath();
String[] newSearchPath = (String[]) Array.newInstance(String.class,
existingSearchPath.length + additionalPath.length);
System.arraycopy(existingSearchPath, 0,
newSearchPath, 0,
existingSearchPath.length);
System.arraycopy(additionalPath, 0,
newSearchPath, existingSearchPath.length,
additionalPath.length);
PropertyEditorManager.setEditorSearchPath(newSearchPath);
PropertyEditorManager.registerEditor(String[].class, StringArrayEditor.class);
}
}
static {
// Add Spring and ActiveMQ specific property editors
String[] additionalPath = new String[] {
"org.springframework.beans.propertyeditors",
"org.apache.activemq.util" };
synchronized (PropertyEditorManager.class) {
String[] existingSearchPath = PropertyEditorManager.getEditorSearchPath();
String[] newSearchPath = (String[]) Array.newInstance(String.class,
existingSearchPath.length + additionalPath.length);
System.arraycopy(existingSearchPath, 0,
newSearchPath, 0,
existingSearchPath.length);
System.arraycopy(additionalPath, 0,
newSearchPath, existingSearchPath.length,
additionalPath.length);
try {
PropertyEditorManager.setEditorSearchPath(newSearchPath);
PropertyEditorManager.registerEditor(String[].class, StringArrayEditor.class);
} catch(java.security.AccessControlException ignore) {
// we might be in an applet...
}
}
}
private IntrospectionSupport() {
}