cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject cvs commit: cocoon-2.1/src/java/org/apache/cocoon Cocoon.java
Date Sun, 11 Jul 2004 23:02:54 GMT
antonio     2004/07/11 16:02:54

  Modified:    src/java/org/apache/cocoon/generation
                        JXTemplateGenerator.java
               src/java/org/apache/cocoon/bean CocoonBean.java
                        CocoonWrapper.java
               src/test/org/apache/cocoon/util/test MIMEUtilsTestCase.java
               src/blocks/portal/java/org/apache/cocoon/portlet
                        CocoonPortlet.java
               src/blocks/scratchpad/garbage/source/java/org/apache/garbage/serializer
                        XMLSerializer.java
               src/blocks/javaflow/java/org/apache/cocoon/components/flow/javascript
                        JavaScriptCompilingClassLoader.java
               src/java/org/apache/cocoon/servlet CocoonServlet.java
               src/blocks/portal/java/org/apache/cocoon/portal/pluto
                        Deploy.java
               src/blocks/serializers/java/org/apache/cocoon/components/serializers
                        XMLSerializer.java EncodingSerializer.java
               src/java/org/apache/cocoon/environment/commandline
                        CommandLineRequest.java
               src/java/org/apache/cocoon Cocoon.java
  Log:
  Use commons lang
  
  Revision  Changes    Path
  1.53      +4 -9      cocoon-2.1/src/java/org/apache/cocoon/generation/JXTemplateGenerator.java
  
  Index: JXTemplateGenerator.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/generation/JXTemplateGenerator.java,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- JXTemplateGenerator.java	6 Jul 2004 10:34:36 -0000	1.52
  +++ JXTemplateGenerator.java	11 Jul 2004 23:02:54 -0000	1.53
  @@ -1555,8 +1555,7 @@
               this.locale = locale;
           }
   
  -        String format(JexlContext jexl, JXPathContext jxp)
  -            throws Exception {
  +        String format(JexlContext jexl, JXPathContext jxp) throws Exception {
               // Determine formatting locale
               String var = getStringValue(this.var, jexl, jxp);
               Number input = getNumberValue(this.value, jexl, jxp);
  @@ -1604,9 +1603,7 @@
               return formatted;
           }
   
  -        private NumberFormat createFormatter(Locale loc,
  -                                             String type)
  -            throws Exception {
  +        private NumberFormat createFormatter(Locale loc, String type) throws Exception
{
               NumberFormat formatter = null;
               if ((type == null) || NUMBER.equalsIgnoreCase(type)) {
                   formatter = NumberFormat.getNumberInstance(loc);
  @@ -1671,9 +1668,7 @@
            * <1.4        EUR           \u20AC       \u20AC
            * >=1.4       EUR           \u20AC       Locale's currency symbol for Euro
            */
  -        private void setCurrency(NumberFormat formatter,
  -                                 String currencyCode,
  -                                 String currencySymbol) throws Exception {
  +        private void setCurrency(NumberFormat formatter, String currencyCode, String currencySymbol)
throws Exception {
               String code = null;
               String symbol = null;
   
  
  
  
  1.45      +3 -2      cocoon-2.1/src/java/org/apache/cocoon/bean/CocoonBean.java
  
  Index: CocoonBean.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/bean/CocoonBean.java,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- CocoonBean.java	10 May 2004 12:26:12 -0000	1.44
  +++ CocoonBean.java	11 Jul 2004 23:02:54 -0000	1.45
  @@ -24,6 +24,7 @@
   import org.apache.cocoon.components.notification.DefaultNotifyingBuilder;
   import org.apache.cocoon.components.notification.Notifying;
   import org.apache.cocoon.matching.helpers.WildcardHelper;
  +import org.apache.commons.lang.SystemUtils;
   
   import org.apache.excalibur.source.ModifiableSource;
   import org.apache.excalibur.source.SourceResolver;
  @@ -733,7 +734,7 @@
        * Print a description of the software before running
        */
       public static String getProlog() {
  -        String lSep = System.getProperty("line.separator");
  +        String lSep = SystemUtils.LINE_SEPARATOR;
           StringBuffer msg = new StringBuffer();
           msg.append("------------------------------------------------------------------------
").append(lSep);
           msg.append(Constants.NAME).append(" ").append(Constants.VERSION).append(lSep);
  
  
  
  1.14      +4 -4      cocoon-2.1/src/java/org/apache/cocoon/bean/CocoonWrapper.java
  
  Index: CocoonWrapper.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/bean/CocoonWrapper.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- CocoonWrapper.java	25 May 2004 07:28:25 -0000	1.13
  +++ CocoonWrapper.java	11 Jul 2004 23:02:54 -0000	1.14
  @@ -50,6 +50,7 @@
   import org.apache.cocoon.util.ClassUtils;
   import org.apache.cocoon.util.IOUtils;
   import org.apache.cocoon.util.NetUtils;
  +import org.apache.commons.lang.SystemUtils;
   
   import org.apache.log.Hierarchy;
   import org.apache.log.Priority;
  @@ -184,7 +185,7 @@
               }
               if (conf == null) {
                   conf =  tryConfigurationFile(
  -                        System.getProperty("user.dir")
  +                        SystemUtils.USER_DIR
                               + File.separator
                               + Constants.DEFAULT_CONF_FILE);
               }
  @@ -526,8 +527,7 @@
               }
           }
   
  -        buildClassPath.append(File.pathSeparatorChar).append(
  -            System.getProperty("java.class.path"));
  +        buildClassPath.append(File.pathSeparatorChar).append(SystemUtils.JAVA_CLASS_PATH);
   
           // Extra class path is necessary for non-classloader-aware java compilers to compile
XSPs
           //        buildClassPath.append(File.pathSeparatorChar)
  
  
  
  1.4       +5 -4      cocoon-2.1/src/test/org/apache/cocoon/util/test/MIMEUtilsTestCase.java
  
  Index: MIMEUtilsTestCase.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/test/org/apache/cocoon/util/test/MIMEUtilsTestCase.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MIMEUtilsTestCase.java	5 Mar 2004 13:03:04 -0000	1.3
  +++ MIMEUtilsTestCase.java	11 Jul 2004 23:02:54 -0000	1.4
  @@ -21,6 +21,7 @@
   import junit.framework.TestCase;
   
   import org.apache.cocoon.util.MIMEUtils;
  +import org.apache.commons.lang.SystemUtils;
   
   /**
    * Test Cases for the MIMEUtils class.
  @@ -33,7 +34,7 @@
   public class MIMEUtilsTestCase extends TestCase
   {
   
  -    final String NL = System.getProperty("line.separator");
  +    final String NL = SystemUtils.LINE_SEPARATOR;
       Map mimeMap;
       Map extMap;
       final String M2E = "MIME to extension mappings";
  @@ -107,7 +108,7 @@
       }
   
       public void tstCommentsAndWhitespace() throws Exception {
  -        String NL = System.getProperty("line.separator");
  +        String NL = SystemUtils.LINE_SEPARATOR;
           String mime_types="## A commented line"+NL+
               "   "+NL+
               "# Another comment";
  @@ -117,7 +118,7 @@
       }
   
       public void tstMimeTypeWithoutExtension() throws Exception {
  -        String NL = System.getProperty("line.separator");
  +        String NL = SystemUtils.LINE_SEPARATOR;
           String mime_types=
               "text/plain  txt text"+NL+
               "application/octet-stream"+NL+NL;
  
  
  
  1.10      +4 -3      cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portlet/CocoonPortlet.java
  
  Index: CocoonPortlet.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portlet/CocoonPortlet.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- CocoonPortlet.java	23 Jun 2004 20:09:05 -0000	1.9
  +++ CocoonPortlet.java	11 Jul 2004 23:02:54 -0000	1.10
  @@ -51,6 +51,7 @@
   import org.apache.cocoon.util.log.Log4JConfigurator;
   
   import org.apache.commons.lang.BooleanUtils;
  +import org.apache.commons.lang.SystemUtils;
   import org.apache.excalibur.instrument.InstrumentManager;
   import org.apache.excalibur.instrument.manager.DefaultInstrumentManager;
   import org.apache.log.ContextMap;
  @@ -638,7 +639,7 @@
           }
   
           buildClassPath.append(File.pathSeparatorChar)
  -                      .append(System.getProperty("java.class.path"));
  +                      .append(SystemUtils.JAVA_CLASS_PATH);
   
           buildClassPath.append(File.pathSeparatorChar)
                         .append(getExtraClassPath());
  @@ -737,7 +738,7 @@
           String extraClassPath = this.getInitParameter("extra-classpath");
           if (extraClassPath != null) {
               StringBuffer sb = new StringBuffer();
  -            StringTokenizer st = new StringTokenizer(extraClassPath, System.getProperty("path.separator"),
false);
  +            StringTokenizer st = new StringTokenizer(extraClassPath, SystemUtils.PATH_SEPARATOR,
false);
               int i = 0;
               while (st.hasMoreTokens()) {
                   String s = st.nextToken();
  
  
  
  1.3       +2 -2      cocoon-2.1/src/blocks/scratchpad/garbage/source/java/org/apache/garbage/serializer/XMLSerializer.java
  
  Index: XMLSerializer.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/scratchpad/garbage/source/java/org/apache/garbage/serializer/XMLSerializer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XMLSerializer.java	5 Mar 2004 10:07:22 -0000	1.2
  +++ XMLSerializer.java	11 Jul 2004 23:02:54 -0000	1.3
  @@ -33,7 +33,7 @@
   
       private static final XMLEncoder XML_ENCODER = new XMLEncoder();
   
  -    private static final char S_EOL[] =
  +    private static final char S_EOL[] = 
               System.getProperty("line.separator").toCharArray();
   
       private static final char S_DOCUMENT_1[] = "<?xml version=\"1.0".toCharArray();
  
  
  
  1.3       +2 -1      cocoon-2.1/src/blocks/javaflow/java/org/apache/cocoon/components/flow/javascript/JavaScriptCompilingClassLoader.java
  
  Index: JavaScriptCompilingClassLoader.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/javaflow/java/org/apache/cocoon/components/flow/javascript/JavaScriptCompilingClassLoader.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JavaScriptCompilingClassLoader.java	6 Jun 2004 21:02:35 -0000	1.2
  +++ JavaScriptCompilingClassLoader.java	11 Jul 2004 23:02:54 -0000	1.3
  @@ -31,6 +31,7 @@
   import org.apache.avalon.framework.service.ServiceException;
   import org.apache.avalon.framework.service.ServiceManager;
   import org.apache.avalon.framework.service.Serviceable;
  +import org.apache.commons.lang.SystemUtils;
   import org.apache.excalibur.source.Source;
   import org.apache.excalibur.source.SourceResolver;
   import org.apache.excalibur.source.SourceUtil;
  @@ -54,7 +55,7 @@
               Source source = resolver.resolveURI(uri);
   
               String classname = getClassName(uri);
  -            String filename = System.getProperty("java.io.tmpdir") + File.separator + classname;
  +            String filename = SystemUtils.JAVA_IO_TMPDIR + File.separator + classname;
   
               System.out.println("source=" + uri);
               System.out.println("filename=" + filename);
  
  
  
  1.33      +4 -3      cocoon-2.1/src/java/org/apache/cocoon/servlet/CocoonServlet.java
  
  Index: CocoonServlet.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/servlet/CocoonServlet.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- CocoonServlet.java	23 Jun 2004 20:09:04 -0000	1.32
  +++ CocoonServlet.java	11 Jul 2004 23:02:54 -0000	1.33
  @@ -51,6 +51,7 @@
   import org.apache.cocoon.util.log.Log4JConfigurator;
   
   import org.apache.commons.lang.BooleanUtils;
  +import org.apache.commons.lang.SystemUtils;
   import org.apache.excalibur.instrument.InstrumentManager;
   import org.apache.excalibur.instrument.manager.DefaultInstrumentManager;
   import org.apache.log.ContextMap;
  @@ -611,7 +612,7 @@
           }
   
           buildClassPath.append(File.pathSeparatorChar)
  -                      .append(System.getProperty("java.class.path"));
  +                      .append(SystemUtils.JAVA_CLASS_PATH);
   
           buildClassPath.append(File.pathSeparatorChar)
                         .append(getExtraClassPath());
  @@ -710,7 +711,7 @@
           String extraClassPath = this.getInitParameter("extra-classpath");
           if (extraClassPath != null) {
               StringBuffer sb = new StringBuffer();
  -            StringTokenizer st = new StringTokenizer(extraClassPath, System.getProperty("path.separator"),
false);
  +            StringTokenizer st = new StringTokenizer(extraClassPath, SystemUtils.PATH_SEPARATOR,
false);
               int i = 0;
               while (st.hasMoreTokens()) {
                   String s = st.nextToken();
  
  
  
  1.5       +4 -3      cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/pluto/Deploy.java
  
  Index: Deploy.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/pluto/Deploy.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Deploy.java	23 Jun 2004 14:14:02 -0000	1.4
  +++ Deploy.java	11 Jul 2004 23:02:54 -0000	1.5
  @@ -47,6 +47,7 @@
   import org.apache.commons.cli.Options;
   import org.apache.commons.cli.ParseException;
   import org.apache.commons.cli.PosixParser;
  +import org.apache.commons.lang.SystemUtils;
   import org.apache.pluto.om.ControllerFactory;
   import org.apache.pluto.om.common.Parameter;
   import org.apache.pluto.om.common.ParameterCtrl;
  @@ -372,8 +373,8 @@
   
           FileWriter writer =
               new FileWriter(webAppsDir + webModule + 
  -                                           System.getProperty("file.separator") + "WEB-INF"+
  -                                           System.getProperty("file.separator") + "web.xml");
  +                                           SystemUtils.FILE_SEPARATOR + "WEB-INF"+
  +                                           SystemUtils.FILE_SEPARATOR + "web.xml");
           XMLSerializer serializer = new XMLSerializer(writer, of);
           try {
               Marshaller marshaller = new Marshaller(serializer.asDocumentHandler());
  
  
  
  1.7       +3 -3      cocoon-2.1/src/blocks/serializers/java/org/apache/cocoon/components/serializers/XMLSerializer.java
  
  Index: XMLSerializer.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/serializers/java/org/apache/cocoon/components/serializers/XMLSerializer.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- XMLSerializer.java	1 Jun 2004 17:16:28 -0000	1.6
  +++ XMLSerializer.java	11 Jul 2004 23:02:54 -0000	1.7
  @@ -20,6 +20,7 @@
   import org.apache.cocoon.components.serializers.encoding.XMLEncoder;
   import org.apache.cocoon.components.serializers.util.DocType;
   import org.apache.cocoon.components.serializers.util.Namespaces;
  +import org.apache.commons.lang.SystemUtils;
   import org.xml.sax.SAXException;
   
   /**
  @@ -32,8 +33,7 @@
   
       private static final XMLEncoder XML_ENCODER = new XMLEncoder();
   
  -    private static final char S_EOL[] =
  -            System.getProperty("line.separator").toCharArray();
  +    private static final char S_EOL[] = SystemUtils.LINE_SEPARATOR.toCharArray();
   
       private static final char S_DOCUMENT_1[] = "<?xml version=\"1.0".toCharArray();
       private static final char S_DOCUMENT_2[] = "\" encoding=\"".toCharArray();
  
  
  
  1.4       +3 -3      cocoon-2.1/src/blocks/serializers/java/org/apache/cocoon/components/serializers/EncodingSerializer.java
  
  Index: EncodingSerializer.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/serializers/java/org/apache/cocoon/components/serializers/EncodingSerializer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- EncodingSerializer.java	1 Jun 2004 17:16:28 -0000	1.3
  +++ EncodingSerializer.java	11 Jul 2004 23:02:54 -0000	1.4
  @@ -30,6 +30,7 @@
   import org.apache.cocoon.components.serializers.encoding.Encoder;
   import org.apache.cocoon.components.serializers.util.Namespaces;
   import org.apache.cocoon.serialization.Serializer;
  +import org.apache.commons.lang.SystemUtils;
   import org.xml.sax.Attributes;
   import org.xml.sax.Locator;
   import org.xml.sax.SAXException;
  @@ -43,8 +44,7 @@
   public abstract class EncodingSerializer implements Serializer, Locator, Recyclable, Configurable
 {
   
       /** The line separator string */
  -    private static final char S_EOL[] =
  -            System.getProperty("line.separator").toCharArray();
  +    private static final char S_EOL[] = SystemUtils.LINE_SEPARATOR.toCharArray();
   
       /* ====================================================================== */
   
  
  
  
  1.12      +3 -2      cocoon-2.1/src/java/org/apache/cocoon/environment/commandline/CommandLineRequest.java
  
  Index: CommandLineRequest.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/environment/commandline/CommandLineRequest.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- CommandLineRequest.java	11 Jul 2004 13:59:12 -0000	1.11
  +++ CommandLineRequest.java	11 Jul 2004 23:02:54 -0000	1.12
  @@ -27,6 +27,7 @@
   import org.apache.cocoon.environment.Request;
   import org.apache.cocoon.environment.Session;
   import org.apache.commons.collections.IteratorUtils;
  +import org.apache.commons.lang.SystemUtils;
   
   /**
    * Creates a specific servlet request simulation from command line usage.
  @@ -272,7 +273,7 @@
       public String getRemoteAddr() { return "127.0.0.1"; }
       public String getRemoteHost() { return "localhost"; }
       public String getMethod() { return "get"; }
  -    public String getRemoteUser() { return System.getProperty("user.name"); }
  +    public String getRemoteUser() { return SystemUtils.USER_NAME; }
   
       public Cookie[] getCookies() { return null; }
       public Map getCookieMap() {
  
  
  
  1.30      +3 -2      cocoon-2.1/src/java/org/apache/cocoon/Cocoon.java
  
  Index: Cocoon.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/Cocoon.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- Cocoon.java	8 Jul 2004 12:42:27 -0000	1.29
  +++ Cocoon.java	11 Jul 2004 23:02:54 -0000	1.30
  @@ -61,6 +61,7 @@
   import org.apache.cocoon.environment.Session;
   import org.apache.cocoon.environment.internal.EnvironmentHelper;
   import org.apache.cocoon.util.ClassUtils;
  +import org.apache.commons.lang.SystemUtils;
   
   import org.apache.excalibur.event.Queue;
   import org.apache.excalibur.event.command.CommandManager;
  @@ -515,7 +516,7 @@
        * @param environment an <code>Environment</code> value
        */
       protected void debug(Environment environment, boolean internal) {
  -        String lineSeparator = System.getProperty("line.separator");
  +        String lineSeparator = SystemUtils.LINE_SEPARATOR;
           Map objectModel = environment.getObjectModel();
           Request request = ObjectModelHelper.getRequest(objectModel);
           Session session = request.getSession(false);
  
  
  

Mime
View raw message