cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject svn commit: r169481 - in /cocoon/trunk/src/java/org/apache/cocoon: components/modules/input/SystemPropertyModule.java components/source/SourceUtil.java core/CoreUtil.java servlet/CocoonServlet.java
Date Tue, 10 May 2005 14:33:17 GMT
Author: vgritsenko
Date: Tue May 10 07:33:16 2005
New Revision: 169481

URL: http://svn.apache.org/viewcvs?rev=169481&view=rev
Log:
don't use System.getProperties without reason

Modified:
    cocoon/trunk/src/java/org/apache/cocoon/components/modules/input/SystemPropertyModule.java
    cocoon/trunk/src/java/org/apache/cocoon/components/source/SourceUtil.java
    cocoon/trunk/src/java/org/apache/cocoon/core/CoreUtil.java
    cocoon/trunk/src/java/org/apache/cocoon/servlet/CocoonServlet.java

Modified: cocoon/trunk/src/java/org/apache/cocoon/components/modules/input/SystemPropertyModule.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/components/modules/input/SystemPropertyModule.java?rev=169481&r1=169480&r2=169481&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/components/modules/input/SystemPropertyModule.java
(original)
+++ cocoon/trunk/src/java/org/apache/cocoon/components/modules/input/SystemPropertyModule.java
Tue May 10 07:33:16 2005
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2004 The Apache Software Foundation
+ * Copyright 1999-2005 The Apache Software Foundation
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -28,19 +28,21 @@
  *
  * JXPath allows to apply XPath functions to system properties.
  *
- * If there is a security manager, its <code>checkPropertiesAccess</code>
+ * <p>If there is a security manager, its <code>checkPropertiesAccess</code>
  * method is called with no arguments. This may result in a security exception
- * which is wrapped into a configuration exception and re-thrown.
+ * which is wrapped into a configuration exception and re-thrown.</p>
  *
  * @author Konstantin Piroumian
- * @version CVS $Id: SystemPropertyModule.java,v 1.5 2004/06/16 20:00:07 vgritsenko Exp $
+ * @version $Id$
  */
 public class SystemPropertyModule extends AbstractJXPathModule
-    implements ThreadSafe {
+                                  implements ThreadSafe {
 
+    /**
+     * @throws SecurityException if access is denied
+     */
     protected Object getContextObject(Configuration modeConf,
                                       Map objectModel) {
-
         return System.getProperties();
     }
 }

Modified: cocoon/trunk/src/java/org/apache/cocoon/components/source/SourceUtil.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/components/source/SourceUtil.java?rev=169481&r1=169480&r2=169481&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/components/source/SourceUtil.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/components/source/SourceUtil.java Tue May 10 07:33:16
2005
@@ -503,7 +503,7 @@
         resolverParameters.put(SourceResolver.METHOD, method);
         if (typeParameters != null) {
             String encoding = typeParameters.getParameter("encoding",
-                 System.getProperties().getProperty("file.encoding", "ISO-8859-1"));
+                 System.getProperty("file.encoding", "ISO-8859-1"));
             if (encoding != null && !"".equals(encoding)) {
                 resolverParameters.put(SourceResolver.URI_ENCODING, encoding);
             }

Modified: cocoon/trunk/src/java/org/apache/cocoon/core/CoreUtil.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/core/CoreUtil.java?rev=169481&r1=169480&r2=169481&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/core/CoreUtil.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/core/CoreUtil.java Tue May 10 07:33:16 2005
@@ -65,7 +65,7 @@
 /**
  * This is an utility class to create a new Cocoon instance.
  *
- * @version SVN $Id$
+ * @version $Id$
  * @since 2.2
  */
 public class CoreUtil {
@@ -126,7 +126,7 @@
         // add root url
         try {
             appContext.put(ContextHelper.CONTEXT_ROOT_URL,
-                           new URL(this.env.getContextURL()));        
+                           new URL(this.env.getContextURL()));
         } catch (MalformedURLException ignore) {
             // we simply ignore this
         }
@@ -319,7 +319,7 @@
                     this.log.error("Could not initialize parent component manager.", e);
                 }
             }
-        }        
+        }
         return new RootServiceManager(parentServiceManager, core);
     }
 
@@ -367,7 +367,7 @@
         // now overwrite with system properties
         s.fill(System.getProperties());
 
-        return s;        
+        return s;
     }
 
     protected void initLogger() {
@@ -568,10 +568,10 @@
         if ( pos != -1 ) {
             uri = uri.substring(pos+1);
         }
-        return WildcardHelper.match(null, uri, parsedPattern);      
+        return WildcardHelper.match(null, uri, parsedPattern);
     }
 
-    public static final class RootServiceManager 
+    public static final class RootServiceManager
     implements ServiceManager, Disposable {
 
         protected final ServiceManager parent;
@@ -628,7 +628,7 @@
     /**
      * Creates the Cocoon object and handles exception handling.
      */
-    public synchronized Cocoon createCocoon() 
+    public synchronized Cocoon createCocoon()
     throws Exception {
 
         /* HACK for reducing class loader problems.                                     */
@@ -672,7 +672,7 @@
     }
 
     /**
-     * Gets the current cocoon object.  
+     * Gets the current cocoon object.
      * Reload cocoon if configuration changed or we are reloading.
      */
     public Cocoon getCocoon(final String pathInfo, final String reloadParam)
@@ -769,7 +769,6 @@
      */
     protected void forceProperty() {
         if (this.settings.getForceProperties().size() > 0) {
-            Properties systemProps = System.getProperties();
             final Iterator i = this.settings.getForceProperties().entrySet().iterator();
             while (i.hasNext()) {
                 final Map.Entry current = (Map.Entry)i.next();
@@ -777,7 +776,7 @@
                     if (this.log.isDebugEnabled()) {
                         this.log.debug("Setting: " + current.getKey() + "=" + current.getValue());
                     }
-                    systemProps.setProperty(current.getKey().toString(), current.getValue().toString());
+                    System.setProperty(current.getKey().toString(), current.getValue().toString());
                 } catch (Exception e) {
                     if (this.log.isWarnEnabled()) {
                         this.log.warn("Could not set property: " + current.getKey(), e);
@@ -785,7 +784,6 @@
                     // Do not throw an exception, because it is not a fatal error.
                 }
             }
-            System.setProperties(systemProps);
         }
     }
 

Modified: cocoon/trunk/src/java/org/apache/cocoon/servlet/CocoonServlet.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/servlet/CocoonServlet.java?rev=169481&r1=169480&r2=169481&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/servlet/CocoonServlet.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/servlet/CocoonServlet.java Tue May 10 07:33:16
2005
@@ -643,8 +643,8 @@
         public Logger logger;
         private final HttpContext   environmentContext;
 
-        public ServletBootstrapEnvironment(ServletConfig config, 
-                                           ClassLoader   cl, 
+        public ServletBootstrapEnvironment(ServletConfig config,
+                                           ClassLoader   cl,
                                            String        writeablePath,
                                            String        path) {
             this.config = config;



Mime
View raw message