dlr         01/03/19 22:39:01

  Modified:    src/java/org/apache/velocity/convert WebMacro.java
  Log:
  Brace and long line cleanup.
  
  Revision  Changes    Path
  1.8       +11 -3     
jakarta-velocity/src/java/org/apache/velocity/convert/WebMacro.java
  
  Index: WebMacro.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/convert/WebMacro.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- WebMacro.java     2001/03/20 01:52:53     1.7
  +++ WebMacro.java     2001/03/20 06:39:01     1.8
  @@ -70,7 +70,7 @@
    * this class.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
  - * @version $Id: WebMacro.java,v 1.7 2001/03/20 01:52:53 jon Exp $ 
  + * @version $Id: WebMacro.java,v 1.8 2001/03/20 06:39:01 dlr Exp $ 
    */
   public class WebMacro
   {
  @@ -158,7 +158,8 @@
           
           if (!file.exists())
           {
  -            System.err.println("The template or directory specified doesn't 
exist!");
  +            System.err.println
  +                ("The specified template or directory does not exist");
               System.exit(1);
           }
           
  @@ -177,14 +178,17 @@
                   writeTemplate(files[i], basedir, newBasedir);
           }
           else
  +        {
               writeTemplate(args[0], "", "");
  +        }
       }
   
       /**
        * Write out the converted template to the given named file
        * and base directory.
        */
  -    private boolean writeTemplate(String file, String basedir, String newBasedir)
  +    private boolean writeTemplate(String file, String basedir,
  +                                  String newBasedir)
       {
           if (file.indexOf(WM_EXT) < 0)
               return false;
  @@ -266,9 +270,13 @@
   
           perl = new Perl5Util();
           for (int i = 0; i < res.length; i += 2)
  +        {
               while (perl.match("/" + res[i] + "/", orignalTemplate))
  +            {
                   orignalTemplate = perl.substitute(
                       "s/" + res[i] + "/" + res[i+1] + "/", orignalTemplate);
  +            }
  +        }
   
           return orignalTemplate;
       }
  
  
  

Reply via email to