cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1170638 - in /cxf/trunk: api/src/main/java/org/apache/cxf/ api/src/main/java/org/apache/cxf/io/ common/common/src/main/java/org/apache/cxf/common/logging/ common/common/src/main/java/org/apache/cxf/common/util/ common/common/src/main/java/...
Date Wed, 14 Sep 2011 14:20:33 GMT
Author: dkulp
Date: Wed Sep 14 14:20:32 2011
New Revision: 1170638

URL: http://svn.apache.org/viewvc?rev=1170638&view=rev
Log:
When running in restricted environment, don't SecurityException if we
query for properties we don't really need or have defaults for.

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/BusFactory.java
    cxf/trunk/api/src/main/java/org/apache/cxf/io/CachedOutputStream.java
    cxf/trunk/common/common/src/main/java/org/apache/cxf/common/logging/JDKBugHacks.java
    cxf/trunk/common/common/src/main/java/org/apache/cxf/common/logging/LogUtils.java
    cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/Compiler.java
    cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/SystemPropertyAction.java
    cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/SystemUtils.java
    cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/FileUtils.java
    cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java
    cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJFactoryResolver.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerBus.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusApplicationContext.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/ControlledValidationXmlBeanDefinitionReader.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBusFactory.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java
    cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
    cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
    cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/ProxyFactory.java
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/BusFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/BusFactory.java?rev=1170638&r1=1170637&r2=1170638&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/BusFactory.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/BusFactory.java Wed Sep 14 14:20:32 2011
@@ -22,7 +22,6 @@ package org.apache.cxf;
 import java.io.BufferedReader;
 import java.io.InputStream;
 import java.io.InputStreamReader;
-import java.security.AccessController;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.WeakHashMap;
@@ -260,8 +259,7 @@ public abstract class BusFactory {
         String busFactoryCondition = null;
 
         // next check system properties
-        busFactoryClass = AccessController
-            .doPrivileged(new SystemPropertyAction(BusFactory.BUS_FACTORY_PROPERTY_NAME));
+        busFactoryClass = SystemPropertyAction.getPropertyOrNull(BusFactory.BUS_FACTORY_PROPERTY_NAME);
         if (isValidBusFactoryClass(busFactoryClass)) {
             return busFactoryClass;
         }

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/io/CachedOutputStream.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/io/CachedOutputStream.java?rev=1170638&r1=1170637&r2=1170638&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/io/CachedOutputStream.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/io/CachedOutputStream.java Wed Sep 14 14:20:32
2011
@@ -31,7 +31,6 @@ import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.PipedInputStream;
 import java.io.PipedOutputStream;
-import java.security.AccessController;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
@@ -45,17 +44,15 @@ public class CachedOutputStream extends 
     private static final File DEFAULT_TEMP_DIR;
     private static final int DEFAULT_THRESHOLD;
     static {
-        String s = AccessController
-            .doPrivileged(new SystemPropertyAction("org.apache.cxf.io.CachedOutputStream.Threshold",
-                                                   "-1"));
+        String s = SystemPropertyAction.getProperty("org.apache.cxf.io.CachedOutputStream.Threshold",
+                                                   "-1");
         int i = Integer.parseInt(s);
         if (i <= 0) {
             i = 64 * 1024;
         }
         DEFAULT_THRESHOLD = i;
         
-        s = AccessController
-            .doPrivileged(new SystemPropertyAction("org.apache.cxf.io.CachedOutputStream.OutputDirectory"));
+        s = SystemPropertyAction.getPropertyOrNull("org.apache.cxf.io.CachedOutputStream.OutputDirectory");
         if (s != null) {
             File f = new File(s);
             if (f.exists() && f.isDirectory()) {

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/common/logging/JDKBugHacks.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/logging/JDKBugHacks.java?rev=1170638&r1=1170637&r2=1170638&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/common/logging/JDKBugHacks.java (original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/common/logging/JDKBugHacks.java Wed
Sep 14 14:20:32 2011
@@ -27,6 +27,9 @@ import java.net.URLConnection;
 import javax.imageio.ImageIO;
 import javax.xml.parsers.DocumentBuilderFactory;
 
+import org.apache.cxf.common.classloader.ClassLoaderUtils;
+import org.apache.cxf.common.classloader.ClassLoaderUtils.ClassLoaderHolder;
+
 /**
  * This is called from LogUtils as LogUtils is almost always one of the VERY
  * first classes loaded in CXF so we can try and register to hacks/workarounds
@@ -46,11 +49,11 @@ final class JDKBugHacks {
     
     public static void doHacks() {
         try {
-            ClassLoader orig = Thread.currentThread().getContextClassLoader();
+            // Use the system classloader as the victim for all this
+            // ClassLoader pinning we're about to do.
+            ClassLoaderHolder orig = ClassLoaderUtils
+                .setThreadContextClassloader(ClassLoader.getSystemClassLoader());
             try {
-                // Use the system classloader as the victim for all this
-                // ClassLoader pinning we're about to do.
-                Thread.currentThread().setContextClassLoader(ClassLoader.getSystemClassLoader());
                 
                 try {
                     //Trigger a call to sun.awt.AppContext.getAppContext()
@@ -122,7 +125,9 @@ final class JDKBugHacks {
                 // to the web application class loader.
                 java.security.Security.getProviders();
             } finally {
-                Thread.currentThread().setContextClassLoader(orig);
+                if (orig != null) {
+                    orig.reset();
+                }
             }
         } catch (Throwable t) {
             //ignore

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/common/logging/LogUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/logging/LogUtils.java?rev=1170638&r1=1170637&r2=1170638&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/common/logging/LogUtils.java (original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/common/logging/LogUtils.java Wed
Sep 14 14:20:32 2011
@@ -67,7 +67,7 @@ public final class LogUtils {
         JDKBugHacks.doHacks();
         
         try {
-            String cname = SystemPropertyAction.getProperty(KEY);
+            String cname = SystemPropertyAction.getPropertyOrNull(KEY);
             if (StringUtils.isEmpty(cname)) {
                 InputStream ins = Thread.currentThread().getContextClassLoader()
                     .getResourceAsStream("META-INF/cxf/" + KEY);

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/Compiler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/Compiler.java?rev=1170638&r1=1170637&r2=1170638&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/Compiler.java (original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/Compiler.java Wed Sep
14 14:20:32 2011
@@ -130,7 +130,7 @@ public class Compiler {
         List<String> list = new ArrayList<String>();
 
         // Start of honoring java.home for used javac
-        String fsep = SystemPropertyAction.getProperty("file.separator");
+        String fsep = File.separator;
         String javacstr = "javac";
         String platformjavacname = "javac";
 

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/SystemPropertyAction.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/SystemPropertyAction.java?rev=1170638&r1=1170637&r2=1170638&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/SystemPropertyAction.java
(original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/SystemPropertyAction.java
Wed Sep 14 14:20:32 2011
@@ -21,18 +21,23 @@ package org.apache.cxf.common.util;
 
 import java.security.AccessController;
 import java.security.PrivilegedAction;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.apache.cxf.common.logging.LogUtils;
 
 /**
  * 
  */
-public class SystemPropertyAction implements PrivilegedAction<String> {
+public final class SystemPropertyAction implements PrivilegedAction<String> {
+    private static final Logger LOG = LogUtils.getL7dLogger(SystemPropertyAction.class);
     final String property;
     final String def;
-    public SystemPropertyAction(String name) {
+    private SystemPropertyAction(String name) {
         property = name;
         def = null;
     }
-    public SystemPropertyAction(String name, String d) {
+    private SystemPropertyAction(String name, String d) {
         property = name;
         def = d;
     }
@@ -50,7 +55,28 @@ public class SystemPropertyAction implem
     public static String getProperty(String name) {
         return AccessController.doPrivileged(new SystemPropertyAction(name));
     }
+    
     public static String getProperty(String name, String def) {
-        return AccessController.doPrivileged(new SystemPropertyAction(name, def));
+        try {
+            return AccessController.doPrivileged(new SystemPropertyAction(name, def));
+        } catch (SecurityException ex) {
+            LOG.log(Level.FINE, "SecurityException raised getting property " + name, ex);
+            return def;
+        }
+    }
+
+    /**
+     * Get the system propery via the AccessController, but if a SecurityException is 
+     * raised, just return null;
+     * @param name
+     * @return
+     */
+    public static String getPropertyOrNull(String name) {
+        try {
+            return AccessController.doPrivileged(new SystemPropertyAction(name));
+        } catch (SecurityException ex) {
+            LOG.log(Level.FINE, "SecurityException raised getting property " + name, ex);
+            return null;
+        }
     }
 }

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/SystemUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/SystemUtils.java?rev=1170638&r1=1170637&r2=1170638&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/SystemUtils.java (original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/SystemUtils.java Wed
Sep 14 14:20:32 2011
@@ -41,9 +41,9 @@ public final class SystemUtils {
     public static String getSpringValidationMode() {
         return AccessController.doPrivileged(new PrivilegedAction<String>() {
             public String run() {
-                String mode = SystemPropertyAction.getProperty(SPRING_VALIDATION_MODE);
+                String mode = SystemPropertyAction.getPropertyOrNull(SPRING_VALIDATION_MODE);
                 if (mode == null) {
-                    mode = SystemPropertyAction.getProperty("spring.validation.mode");
+                    mode = SystemPropertyAction.getPropertyOrNull("spring.validation.mode");
                 }
                 return mode;
             }

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/FileUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/FileUtils.java?rev=1170638&r1=1170637&r2=1170638&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/FileUtils.java (original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/FileUtils.java Wed Sep 14
14:20:32 2011
@@ -49,12 +49,7 @@ public final class FileUtils {
             return defaultTempDir;
         }
         
-        String s = null;
-        try {
-            s = SystemPropertyAction.getProperty(FileUtils.class.getName() + ".TempDirectory");
-        } catch (SecurityException e) {
-            //Ignorable, we'll use the default
-        }
+        String s = SystemPropertyAction.getPropertyOrNull(FileUtils.class.getName() + ".TempDirectory");
         if (s != null) {
             //assume someone outside of us will manage the directory
             File f = new File(s);

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java?rev=1170638&r1=1170637&r2=1170638&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java (original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java Wed Sep
14 14:20:32 2011
@@ -146,7 +146,7 @@ public class URIResolver {
                 try {
                     HttpURLConnection huc = (HttpURLConnection)url.openConnection();
 
-                    String host = SystemPropertyAction.getProperty("http.proxyHost");
+                    String host = SystemPropertyAction.getPropertyOrNull("http.proxyHost");
                     if (host != null) {
                         //comment out unused port to pass pmd check
                         /*String ports = SystemPropertyAction.getProperty("http.proxyPort");
@@ -155,8 +155,8 @@ public class URIResolver {
                             port = Integer.parseInt(ports);
                         }*/
 
-                        String username = SystemPropertyAction.getProperty("http.proxy.user");
-                        String password = SystemPropertyAction.getProperty("http.proxy.password");
+                        String username = SystemPropertyAction.getPropertyOrNull("http.proxy.user");
+                        String password = SystemPropertyAction.getPropertyOrNull("http.proxy.password");
 
                         if (username != null && password != null) {
                             String encoded = Base64Utility.encode((username + ":" + password).getBytes());

Modified: cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJFactoryResolver.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJFactoryResolver.java?rev=1170638&r1=1170637&r2=1170638&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJFactoryResolver.java
(original)
+++ cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJFactoryResolver.java
Wed Sep 14 14:20:32 2011
@@ -45,7 +45,7 @@ public final class SAAJFactoryResolver {
 
     public static MessageFactory createMessageFactory(SoapVersion version) throws SOAPException
{
         MessageFactory messageFactory;
-        String messageFactoryClassName = SystemPropertyAction.getProperty(MESSAGE_FACTORY_KEY);
+        String messageFactoryClassName = SystemPropertyAction.getPropertyOrNull(MESSAGE_FACTORY_KEY);
         if (messageFactoryClassName != null) {
             messageFactory = newInstanceCxfSAAJFactory(messageFactoryClassName,
                                                           MessageFactory.class);
@@ -69,7 +69,7 @@ public final class SAAJFactoryResolver {
 
     public static SOAPFactory createSOAPFactory(SoapVersion version) throws SOAPException
{
         SOAPFactory soapFactory;
-        String soapFactoryClassName = SystemPropertyAction.getProperty(SOAP_FACTORY_KEY);
+        String soapFactoryClassName = SystemPropertyAction.getPropertyOrNull(SOAP_FACTORY_KEY);
         if (soapFactoryClassName != null) {
             soapFactory = newInstanceCxfSAAJFactory(soapFactoryClassName,
                                                        SOAPFactory.class);

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerBus.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerBus.java?rev=1170638&r1=1170637&r2=1170638&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerBus.java
(original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerBus.java
Wed Sep 14 14:20:32 2011
@@ -19,7 +19,6 @@
 package org.apache.cxf.bus.extension;
 
 import java.io.InputStream;
-import java.security.AccessController;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -181,7 +180,7 @@ public class ExtensionManagerBus extends
         }
 
         // next check system properties
-        busId = AccessController.doPrivileged(new SystemPropertyAction(BUS_ID_PROPERTY_NAME));
+        busId = SystemPropertyAction.getPropertyOrNull(BUS_ID_PROPERTY_NAME);
         if (null != busId && !"".equals(busId)) {
             return busId;
         }

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusApplicationContext.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusApplicationContext.java?rev=1170638&r1=1170637&r2=1170638&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusApplicationContext.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusApplicationContext.java Wed
Sep 14 14:20:32 2011
@@ -163,8 +163,7 @@ public class BusApplicationContext exten
         
         boolean usingDefault = false;
         if (null == cfgFiles) {
-            String cfgFile = AccessController
-                .doPrivileged(new SystemPropertyAction(Configurer.USER_CFG_FILE_PROPERTY_NAME));
+            String cfgFile = SystemPropertyAction.getPropertyOrNull(Configurer.USER_CFG_FILE_PROPERTY_NAME);
             if (cfgFile != null) {
                 cfgFiles = new String[] {cfgFile};
             }
@@ -204,8 +203,7 @@ public class BusApplicationContext exten
             }
         } 
         
-        String sysCfgFileUrl = AccessController
-            .doPrivileged(new SystemPropertyAction(Configurer.USER_CFG_FILE_PROPERTY_URL));
+        String sysCfgFileUrl = SystemPropertyAction.getPropertyOrNull(Configurer.USER_CFG_FILE_PROPERTY_URL);
         if (null != sysCfgFileUrl) {
             try {
                 UrlResource ur = new UrlResource(sysCfgFileUrl);

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/ControlledValidationXmlBeanDefinitionReader.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/ControlledValidationXmlBeanDefinitionReader.java?rev=1170638&r1=1170637&r2=1170638&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/ControlledValidationXmlBeanDefinitionReader.java
(original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/ControlledValidationXmlBeanDefinitionReader.java
Wed Sep 14 14:20:32 2011
@@ -86,8 +86,7 @@ public class ControlledValidationXmlBean
         super(beanFactory);
         tunedDocumentLoader = new TunedDocumentLoader();
         this.setDocumentLoader(tunedDocumentLoader);
-        noFastinfoset = AccessController
-            .doPrivileged(new SystemPropertyAction("org.apache.cxf.nofastinfoset")) != null

+        noFastinfoset = SystemPropertyAction.getPropertyOrNull("org.apache.cxf.nofastinfoset")
!= null 
             || !TunedDocumentLoader.hasFastInfoSet();
     }
 

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBusFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBusFactory.java?rev=1170638&r1=1170637&r2=1170638&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBusFactory.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBusFactory.java Wed Sep
14 14:20:32 2011
@@ -95,10 +95,10 @@ public class SpringBusFactory extends Bu
     
     public Bus createBus(String cfgFiles[], boolean includeDefaults) {
         try {
-            String userCfgFile = AccessController
-                .doPrivileged(new SystemPropertyAction(Configurer.USER_CFG_FILE_PROPERTY_NAME));
-            String sysCfgFileUrl = AccessController
-                .doPrivileged(new SystemPropertyAction(Configurer.USER_CFG_FILE_PROPERTY_URL));
+            String userCfgFile 
+                = SystemPropertyAction.getPropertyOrNull(Configurer.USER_CFG_FILE_PROPERTY_NAME);
+            String sysCfgFileUrl 
+                = SystemPropertyAction.getPropertyOrNull(Configurer.USER_CFG_FILE_PROPERTY_URL);
             final Resource r = BusApplicationContext.findResource(Configurer.DEFAULT_USER_CFG_FILE);
 
             boolean exists = true;

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java?rev=1170638&r1=1170637&r2=1170638&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java Wed Sep
14 14:20:32 2011
@@ -24,7 +24,6 @@ import java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.URISyntaxException;
 import java.net.URL;
-import java.security.AccessController;
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashSet;
@@ -50,7 +49,7 @@ public class OASISCatalogManager {
     private static final Logger LOG =
         LogUtils.getL7dLogger(OASISCatalogManager.class);
     private static final String DEBUG_LEVEL 
-        = AccessController.doPrivileged(new SystemPropertyAction(CATALOG_DEBUG_KEY));
+        = SystemPropertyAction.getPropertyOrNull(CATALOG_DEBUG_KEY);
     
 
     private Object resolver;

Modified: cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java?rev=1170638&r1=1170637&r2=1170638&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
(original)
+++ cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
Wed Sep 14 14:20:32 2011
@@ -494,7 +494,7 @@ public class DynamicClientFactory {
                 }
                 if (f2.exists()) {
                     classPath.append(f2.getAbsolutePath());
-                    classPath.append(SystemPropertyAction.getProperty("path.separator"));
+                    classPath.append(File.pathSeparator);
                 }
             }
         }         
@@ -545,7 +545,7 @@ public class DynamicClientFactory {
                     Method method = tcl.getClass().getMethod("getClassPath");
                     Object weblogicClassPath = method.invoke(tcl);
                     classPath.append(weblogicClassPath)
-                        .append(SystemPropertyAction.getProperty("path.separator")); 
+                        .append(File.pathSeparator); 
                 } catch (Exception e) {
                     LOG.log(Level.FINE, "unsuccessfully tried getClassPath method", e);
                 }

Modified: cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?rev=1170638&r1=1170637&r2=1170638&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
(original)
+++ cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
Wed Sep 14 14:20:32 2011
@@ -31,7 +31,6 @@ import java.lang.reflect.TypeVariable;
 import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URL;
-import java.security.AccessController;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -2511,8 +2510,7 @@ public class ReflectionServiceFactoryBea
 
     private boolean isValidate() {
         return validate 
-            || AccessController.doPrivileged(new SystemPropertyAction("cxf.validateServiceSchemas",
-                                                                      "false")).equals("true");
+            || SystemPropertyAction.getProperty("cxf.validateServiceSchemas", "false").equals("true");
     }
 
     /**

Modified: cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java?rev=1170638&r1=1170637&r2=1170638&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
(original)
+++ cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
Wed Sep 14 14:20:32 2011
@@ -218,10 +218,10 @@ public class JettyHTTPServerEngine
         //test things in the same VM.
         
         String s = SystemPropertyAction
-                .getProperty("org.apache.cxf.transports.http_jetty.DontClosePort." + port);
+                .getPropertyOrNull("org.apache.cxf.transports.http_jetty.DontClosePort."
+ port);
         if (s == null) {
             s = SystemPropertyAction
-                .getProperty("org.apache.cxf.transports.http_jetty.DontClosePort");
+                .getPropertyOrNull("org.apache.cxf.transports.http_jetty.DontClosePort");
         }
         return !Boolean.valueOf(s);
     }

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/ProxyFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/ProxyFactory.java?rev=1170638&r1=1170637&r2=1170638&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/ProxyFactory.java
(original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/ProxyFactory.java
Wed Sep 14 14:20:32 2011
@@ -62,7 +62,7 @@ public class ProxyFactory {
     private static HTTPClientPolicy createSystemProxyConfiguration() {
         // Retrieve system properties (if any)
         HTTPClientPolicy systemProxyConfiguration = null;
-        String proxyHost = SystemPropertyAction.getProperty(HTTP_PROXY_HOST);
+        String proxyHost = SystemPropertyAction.getPropertyOrNull(HTTP_PROXY_HOST);
         if (proxyHost != null) {
             // System is configured with a proxy, use it
 
@@ -75,7 +75,7 @@ public class ProxyFactory {
             systemProxyConfiguration.setProxyServerPort(Integer.valueOf(proxyPort));
 
             // Load non proxy hosts
-            String nonProxyHosts = SystemPropertyAction.getProperty(HTTP_NON_PROXY_HOSTS);
+            String nonProxyHosts = SystemPropertyAction.getPropertyOrNull(HTTP_NON_PROXY_HOSTS);
             if (!StringUtils.isEmpty(nonProxyHosts)) {
                 systemProxyConfiguration.setNonProxyHosts(nonProxyHosts);
             }

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java?rev=1170638&r1=1170637&r2=1170638&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java
(original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/persistence/jdbc/RMTxStore.java
Wed Sep 14 14:20:32 2011
@@ -694,7 +694,7 @@ public class RMTxStore implements RMStor
     }
     
     public static void deleteDatabaseFiles(String dbName, boolean now) {
-        String dsh = SystemPropertyAction.getProperty("derby.system.home");
+        String dsh = SystemPropertyAction.getPropertyOrNull("derby.system.home");
        
         File root = null;  
         File log = null;



Mime
View raw message