bckfnn      2004/09/13 00:08:49

  Modified:    src/java/org/apache/fop/apps CommandLineOptions.java
                        Fop.java
  Log:
  Avoid throwing exceptions from ctor, the logger is lost in that case.
  
  Revision  Changes    Path
  1.31      +10 -9     xml-fop/src/java/org/apache/fop/apps/CommandLineOptions.java
  
  Index: CommandLineOptions.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/CommandLineOptions.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- CommandLineOptions.java   11 Sep 2004 18:56:20 -0000      1.30
  +++ CommandLineOptions.java   13 Sep 2004 07:08:49 -0000      1.31
  @@ -72,13 +72,9 @@
       private Vector xsltParams = null;
       
       /**
  -     * Construct a command line option object from command line arguments
  -     * @param args command line parameters
  -     * @throws FOPException for general errors
  -     * @throws FileNotFoundException if an input file wasn't found
  -     * @throws IOException if the the configuration file could not be loaded
  +     * Construct a command line option object.
        */
  -    public CommandLineOptions(String[] args) throws FOPException, IOException {
  +    public CommandLineOptions() {
           LogFactory logFactory = LogFactory.getFactory();
           
           // Enable the simple command line logging when no other logger is
  @@ -90,11 +86,16 @@
           }
   
           log = LogFactory.getLog("FOP");
  -        
  -        parse(args);
       }
       
  -    private void parse(String[] args) 
  +    /**
  +     * Parse the command line arguments.
  +     * @param args the command line arguments.
  +     * @throws FOPException for general errors
  +     * @throws FileNotFoundException if an input file wasn't found
  +     * @throws IOException if the the configuration file could not be loaded
  +     */
  +    public void parse(String[] args) 
               throws FOPException, IOException {
           boolean optionsParsed = true;
           
  
  
  
  1.21      +3 -2      xml-fop/src/java/org/apache/fop/apps/Fop.java
  
  Index: Fop.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/Fop.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- Fop.java  11 Sep 2004 18:56:20 -0000      1.20
  +++ Fop.java  13 Sep 2004 07:08:49 -0000      1.21
  @@ -138,7 +138,8 @@
           BufferedOutputStream bos = null;
   
           try {
  -            options = new CommandLineOptions(args);
  +            options = new CommandLineOptions();
  +            options.parse(args);
               foUserAgent = options.getFOUserAgent();
               
               Fop fop = new Fop(options.getRenderer(), foUserAgent);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to