avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From leosim...@apache.org
Subject cvs commit: avalon-sandbox/merlin/merlin-cli/src/java Merlin.java
Date Wed, 16 Apr 2003 14:32:40 GMT
leosimons    2003/04/16 07:32:40

  Modified:    merlin/merlin-cli/src/java Merlin.java
  Log:
  optimize imports, remove unused stuff.
  
  Revision  Changes    Path
  1.6       +27 -34    avalon-sandbox/merlin/merlin-cli/src/java/Merlin.java
  
  Index: Merlin.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-cli/src/java/Merlin.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Merlin.java	10 Apr 2003 04:36:14 -0000	1.5
  +++ Merlin.java	16 Apr 2003 14:32:39 -0000	1.6
  @@ -88,7 +88,7 @@
   
       private static final File HOME = new File( System.getProperty( "user.dir" ) );
   
  -    private static final String MERLIN_KERNEL_LOADER_CLASSNAME = 
  +    private static final String MERLIN_KERNEL_LOADER_CLASSNAME =
         "org.apache.avalon.merlin.kernel.impl.DefaultKernelLoader";
   
       private static Resources I18N =
  @@ -101,19 +101,19 @@
   
       private static Options buildCommandLineOptions()
       {
  -        // create Options object 
  +        // create Options object
           Options options = new Options();
   
  -        Option help = new Option( 
  -           "help", 
  +        Option help = new Option(
  +           "help",
              I18N.getString( "cli-help-description" ) );
   
  -        Option version = new Option( 
  -           "version", 
  +        Option version = new Option(
  +           "version",
              I18N.getString( "cli-version-description" ) );
   
  -        Option debug = new Option( 
  -           "debug", 
  +        Option debug = new Option(
  +           "debug",
              I18N.getString( "cli-debug-description" ) );
   
           Option locale = OptionBuilder
  @@ -134,12 +134,6 @@
              .withDescription( I18N.getString( "cli-system-description" ) )
              .create( "system" );
   
  -        Option block = OptionBuilder
  -           .hasArg()
  -           .withArgName( I18N.getString( "file" ) )
  -           .withDescription( I18N.getString( "cli-block-description" ) )
  -           .create( "block" );
  -
           Option config = OptionBuilder
              .hasArg()
              .withArgName( I18N.getString( "file" ) )
  @@ -170,8 +164,8 @@
   
      /**
       * Command line entry point to the Merlin system.
  -    * The main method handles the establishment of a bootstrap classloader, 
  -    * installation directory and base working directory from which a root 
  +    * The main method handles the establishment of a bootstrap classloader,
  +    * installation directory and base working directory from which a root
       * {@link Kernel} is instantiated.
       *
       * @param args a set command line arguments
  @@ -234,12 +228,12 @@
               //
   
               //
  -            // the the system directory that we use to build the 
  +            // the the system directory that we use to build the
               // classloaders
  -            File system = getSystemPath( line ); 
  +            File system = getSystemPath( line );
   
               //
  -            // the working home directory 
  +            // the working home directory
               File home = getHomePath( line );
   
               //
  @@ -380,7 +374,7 @@
           }
           catch( Throwable e )
           {
  -            final String error = 
  +            final String error =
                 "Internal error during loader class creation.";
               throw new BootstrapRuntimeException( error, e );
           }
  @@ -396,7 +390,7 @@
           }
           catch( Throwable e )
           {
  -            final String error = 
  +            final String error =
                 "Internal error during loader instantiation.";
               e.printStackTrace();
               throw new BootstrapRuntimeException( error, e );
  @@ -413,9 +407,9 @@
           }
           catch( Throwable e )
           {
  -            final String error = 
  +            final String error =
                 "Kernel establishment error.";
  -            throw new RuntimeException( error, e );         
  +            throw new RuntimeException( error, e );
           }
   
       }
  @@ -428,8 +422,8 @@
       private static void doHelp()
       {
           HelpFormatter formatter = new HelpFormatter();
  -        final String description = 
  -          "\nDescription: The merlin command executes the deployment of a component block.
 The [block] argument may be either an block descriptor file or a jar file containing a block
descriptor.  If no value if declared, Merlin will attempt to execute a file named 'block.xml'
in the current directory."; 
  +        final String description =
  +          "\nDescription: The merlin command executes the deployment of a component block.
 The [block] argument may be either an block descriptor file or a jar file containing a block
descriptor.  If no value if declared, Merlin will attempt to execute a file named 'block.xml'
in the current directory.";
   
           formatter.printHelp( "merlin [block]", description, CL_OPTIONS, "", true );
       }
  @@ -497,7 +491,7 @@
               File kernel = new File( conf, "kernel.xml" );
               if( !kernel.exists() )
               {
  -                final String error = 
  +                final String error =
                     "Could not locate the kernel configuration ${merlin.kernel}/config/kernel.xml";
                   throw new IOException( error );
               }
  @@ -509,8 +503,8 @@
       }
   
      /**
  -    * Return the directory to be used as the working home directory.  If no command line

  -    * argument is supplied, the home directory defaults to the directory derived from 
  +    * Return the directory to be used as the working home directory.  If no command line
  +    * argument is supplied, the home directory defaults to the directory derived from
       * the user.work System property.
       *
       * @param command the command line arguments
  @@ -520,7 +514,6 @@
       private static File getHomePath( CommandLine command ) throws IOException
       {
           String path = null;
  -        File file = null;
           final String key = "home"; 
           if( command.hasOption( key ) )
           {
  @@ -538,20 +531,20 @@
           File file = getSysPath( command );
           if( !file.exists() )
           {
  -            final String error = 
  +            final String error =
                 "Supplied system path does not exist: " + file;
               throw new IllegalArgumentException( error );
           }
           if( !file.isDirectory() )
           {
  -            final String error = 
  +            final String error =
                 "Supplied system path does not refer to a directory: " + file;
               throw new IllegalArgumentException( error );
           }
           File lib = new File( file, "lib" );
           if( !lib.exists() )
           {
  -            final String error = 
  +            final String error =
                 "Supplied system path does not contain a 'lib' subdirectory: " + file;
               throw new IllegalArgumentException( error );
           }
  @@ -561,7 +554,7 @@
       private static File getSysPath( CommandLine command ) throws IOException
       {
           String path = null;
  -        final String key = "system"; 
  +        final String key = "system";
           if( command.hasOption( key ) )
           {
               path = command.getOptionValue( key );
  @@ -571,7 +564,7 @@
               }
               catch( FileNotFoundException fnfe )
               {
  -                final String error = 
  +                final String error =
                    "Supplied home path does not exist: " + path;
                   throw new FileNotFoundException( error );
               }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message