You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ff...@apache.org on 2013/01/21 08:20:12 UTC
svn commit: r1436211 - in /cxf/branches/2.6.x-fixes: ./
rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java
Author: ffang
Date: Mon Jan 21 07:20:12 2013
New Revision: 1436211
URL: http://svn.apache.org/viewvc?rev=1436211&view=rev
Log:
Merged revisions 1436210 via svnmerge from
https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes
................
r1436210 | ffang | 2013-01-21 15:14:54 +0800 (一, 21 1 2013) | 9 lines
Merged revisions 1436208 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r1436208 | ffang | 2013-01-21 15:06:30 +0800 (一, 21 1 2013) | 1 line
[CXF-4768]Refact SwaOutInterceptor to honor other JAXB impl(besides JAXB RI)
........
................
Modified:
cxf/branches/2.6.x-fixes/ (props changed)
cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java
Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
Merged /cxf/branches/2.7.x-fixes:r1436210
Merged /cxf/trunk:r1436208
Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java?rev=1436211&r1=1436210&r2=1436211&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java (original)
+++ cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java Mon Jan 21 07:20:12 2013
@@ -25,6 +25,8 @@ import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.lang.reflect.Method;
+import java.security.AccessController;
+import java.security.PrivilegedExceptionAction;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
@@ -81,11 +83,20 @@ public class SwAOutInterceptor extends A
addBefore(WrapperClassOutInterceptor.class.getName());
}
- private boolean callSWARefMethod(JAXBContext ctx) {
+ private boolean callSWARefMethod(final JAXBContext ctx) {
Method m = SWA_REF_METHOD.get(ctx.getClass().getName());
if (m == null && !SWA_REF_METHOD.containsKey(ctx.getClass().getName())) {
try {
- m = ctx.getClass().getMethod("hasSwaRef", new Class[0]);
+ m = AccessController.doPrivileged(new PrivilegedExceptionAction<Method>() {
+
+ public Method run() throws Exception {
+ Method hasSwaRefMethod = ctx.getClass().getMethod("hasSwaRef", new Class[0]);
+ if (!hasSwaRefMethod.isAccessible()) {
+ hasSwaRefMethod.setAccessible(true);
+ }
+ return hasSwaRefMethod;
+ }
+ });
SWA_REF_METHOD.put(ctx.getClass().getName(), m);
} catch (Exception e) {
//ignore
@@ -219,7 +230,8 @@ public class SwAOutInterceptor extends A
atts.add(att);
}
}
- private boolean hasSwaRef(JAXBDataBinding db) {
+
+ protected boolean hasSwaRef(JAXBDataBinding db) {
JAXBContext context = db.getContext();
return callSWARefMethod(context);
}