summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/databinding/src
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2011-08-17 16:04:45 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2011-08-17 16:04:45 +0000
commit9d69b5d4b215f691496a87eea974179a88885383 (patch)
tree39b4b4e5e5e470a019c5d4a4c66a009214c20bf9 /sca-java-2.x/trunk/modules/databinding/src
parent1798efc6a2291275dcf9a75b6cc06e64776a5cfa (diff)
TUSCANY-3922 - apply Jennifer's patch to add some missing doPrivileged calls around various classloader calls. Thanks for the patch Jennifer.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1158793 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/databinding/src')
-rw-r--r--sca-java-2.x/trunk/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBeansDataBinding.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/sca-java-2.x/trunk/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBeansDataBinding.java b/sca-java-2.x/trunk/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBeansDataBinding.java
index 5e5774f338..3721fb7e63 100644
--- a/sca-java-2.x/trunk/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBeansDataBinding.java
+++ b/sca-java-2.x/trunk/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBeansDataBinding.java
@@ -19,6 +19,7 @@
package org.apache.tuscany.sca.databinding.javabeans;
+
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -30,6 +31,8 @@ import java.io.OutputStream;
import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.util.logging.Logger;
import org.apache.tuscany.sca.databinding.BaseDataBinding;
@@ -88,7 +91,16 @@ public class JavaBeansDataBinding extends BaseDataBinding {
// because Collection classes are loaded by the System ClassLoader but their contents
// may be loaded from another ClassLoader
//
- ClassLoader classLoaderToUse = targetDataType.getPhysical().getClassLoader();
+ final DataType fTargetDataType = targetDataType;
+ ClassLoader classLoaderToUse = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+ public ClassLoader run() {
+ ClassLoader cl = fTargetDataType.getPhysical().getClassLoader();
+ return cl;
+ }
+ });
+
+
+
if (classLoaderToUse == null) {
classLoaderToUse = clazz.getClassLoader();
}