avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/cli/src/java/org/apache/avalon/excalibur/cli CLArgsParser.java
Date Tue, 19 Mar 2002 10:48:38 GMT
donaldp     02/03/19 02:48:38

  Modified:    cli/src/java/org/apache/avalon/excalibur/cli
                        CLArgsParser.java
  Log:
  Fix javadoc bugs
  
  FIx it so that code does not require that you specify long form of option
  
  Revision  Changes    Path
  1.12      +10 -11    jakarta-avalon-excalibur/cli/src/java/org/apache/avalon/excalibur/cli/CLArgsParser.java
  
  Index: CLArgsParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/cli/src/java/org/apache/avalon/excalibur/cli/CLArgsParser.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- CLArgsParser.java	16 Mar 2002 00:04:26 -0000	1.11
  +++ CLArgsParser.java	19 Mar 2002 10:48:37 -0000	1.12
  @@ -193,9 +193,9 @@
       /**
        * Create a parser that can deal with options and parses certain args.
        *
  -     * @param args[] the args, typically that passed to the
  +     * @param args the args, typically that passed to the
        * <code>public static void main(String[] args)</code> method.
  -     * @param optionDescriptors[] the option descriptors
  +     * @param optionDescriptors the option descriptors
        */
       public CLArgsParser( final String[] args,
                            final CLOptionDescriptor[] optionDescriptors,
  @@ -267,7 +267,6 @@
   
               final CLOption option = (CLOption)arguments.elementAt( i );
               final int id = option.getId();
  -            final CLOptionDescriptor descriptor = getDescriptorFor( id );
   
               for( int j = 0; j < incompatible.length; j++ )
               {
  @@ -333,8 +332,8 @@
       /**
        * Create a parser that deals with options and parses certain args.
        *
  -     * @param args[] the args
  -     * @param optionDescriptors[] the option descriptors
  +     * @param args the args
  +     * @param optionDescriptors the option descriptors
        */
       public CLArgsParser( final String[] args,
                            final CLOptionDescriptor[] optionDescriptors )
  @@ -347,7 +346,7 @@
        * The sub-array should start at array entry indicated by index. That array element
        * should only include characters from charIndex onwards.
        *
  -     * @param array[] the original array
  +     * @param array the original array
        * @param index the cut-point in array
        * @param charIndex the cut-point in element of array
        * @return the result array
  @@ -371,8 +370,6 @@
   
       /**
        * Actually parse arguments
  -     *
  -     * @param args[] arguments
        */
       private final void parse()
           throws ParseException
  @@ -753,9 +750,10 @@
        */
       private final void buildOptionIndex()
       {
  -        m_optionIndex = new Hashtable( m_options.size() * 2 );
  +        final int size = m_options.size();
  +        m_optionIndex = new Hashtable( size * 2 );
   
  -        for( int i = 0; i < m_options.size(); i++ )
  +        for( int i = 0; i < size; i++ )
           {
               final CLOption option = (CLOption)m_options.get( i );
               final CLOptionDescriptor optionDescriptor =
  @@ -763,7 +761,8 @@
   
               m_optionIndex.put( new Integer( option.getId() ), option );
   
  -            if( null != optionDescriptor )
  +            if( null != optionDescriptor &&
  +                null != optionDescriptor.getName() )
               {
                   m_optionIndex.put( optionDescriptor.getName(), option );
               }
  
  
  

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


Mime
View raw message