cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject svn commit: r169479 - in /cocoon/branches/BRANCH_2_1_X/src: blocks/portal/java/org/apache/cocoon/portlet/CocoonPortlet.java java/org/apache/cocoon/components/modules/input/SystemPropertyModule.java java/org/apache/cocoon/components/source/SourceUtil.java java/org/apache/cocoon/servlet/CocoonServlet.java
Date Tue, 10 May 2005 14:27:47 GMT
Author: vgritsenko
Date: Tue May 10 07:27:45 2005
New Revision: 169479

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

Modified:
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portlet/CocoonPortlet.java
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/modules/input/SystemPropertyModule.java
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/SourceUtil.java
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/CocoonServlet.java

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portlet/CocoonPortlet.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portlet/CocoonPortlet.java?rev=169479&r1=169478&r2=169479&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portlet/CocoonPortlet.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portlet/CocoonPortlet.java
Tue May 10 07:27:45 2005
@@ -1026,7 +1026,6 @@
         if (this.forceSystemProperty != null) {
             StringTokenizer tokenizer = new StringTokenizer(forceSystemProperty, " \t\r\n\f;,",
false);
 
-            java.util.Properties systemProps = System.getProperties();
             while (tokenizer.hasMoreTokens()) {
                 final String property = tokenizer.nextToken().trim();
                 if (property.indexOf('=') == -1) {
@@ -1041,7 +1040,7 @@
                     if (getLogger().isDebugEnabled()) {
                         getLogger().debug("setting " + key + "=" + value);
                     }
-                    systemProps.setProperty(key, value);
+                    System.setProperty(key, value);
                 } catch (Exception e) {
                     if (getLogger().isWarnEnabled()) {
                         getLogger().warn("Could not set property: " + property, e);
@@ -1049,7 +1048,6 @@
                     // Do not throw an exception, because it is not a fatal error.
                 }
             }
-            System.setProperties(systemProps);
         }
     }
 

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/modules/input/SystemPropertyModule.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/modules/input/SystemPropertyModule.java?rev=169479&r1=169478&r2=169479&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/modules/input/SystemPropertyModule.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/modules/input/SystemPropertyModule.java
Tue May 10 07:27:45 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.4 2004/03/06 02:26:17 antonio 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/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/SourceUtil.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/SourceUtil.java?rev=169479&r1=169478&r2=169479&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/SourceUtil.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/SourceUtil.java
Tue May 10 07:27:45 2005
@@ -579,7 +579,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/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/CocoonServlet.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/CocoonServlet.java?rev=169479&r1=169478&r2=169479&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/CocoonServlet.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/CocoonServlet.java Tue
May 10 07:27:45 2005
@@ -989,7 +989,6 @@
         if (this.forceSystemProperty != null) {
             StringTokenizer tokenizer = new StringTokenizer(forceSystemProperty, " \t\r\n\f;,",
false);
 
-            Properties systemProps = System.getProperties();
             while (tokenizer.hasMoreTokens()) {
                 final String property = tokenizer.nextToken().trim();
                 if (property.indexOf('=') == -1) {
@@ -1004,7 +1003,7 @@
                     if (getLogger().isDebugEnabled()) {
                         getLogger().debug("Setting " + key + "=" + value);
                     }
-                    systemProps.setProperty(key, value);
+                    System.setProperty(key, value);
                 } catch (Exception e) {
                     if (getLogger().isWarnEnabled()) {
                         getLogger().warn("Could not set property: " + property, e);
@@ -1012,7 +1011,6 @@
                     // Do not throw an exception, because it is not a fatal error.
                 }
             }
-            System.setProperties(systemProps);
         }
     }
 



Mime
View raw message