dion        2004/07/09 05:03:33

  Modified:    changelog/src/main/org/apache/maven/cvslib
                        CvsConnection.java
  Log:
  Remove unused variable.
  Detab.
  
  Revision  Changes    Path
  1.10      +76 -78    
maven-plugins/changelog/src/main/org/apache/maven/cvslib/CvsConnection.java
  
  Index: CvsConnection.java
  ===================================================================
  RCS file: 
/home/cvs/maven-plugins/changelog/src/main/org/apache/maven/cvslib/CvsConnection.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- CvsConnection.java        9 Jul 2004 11:53:46 -0000       1.9
  +++ CvsConnection.java        9 Jul 2004 12:03:33 -0000       1.10
  @@ -53,37 +53,37 @@
       /** Log */
       private static final Log LOG = LogFactory.getLog(CvsConnection.class);
       /**
  -      * The path to the repository on the server
  -      */
  +     * The path to the repository on the server
  +     */
       private String repository;
   
       /**
  -      * The local path to use to perform operations (the top level)
  -      */
  +     * The local path to use to perform operations (the top level)
  +     */
       private String localPath;
   
       /**
  -      * The connection to the server
  -      */
  +     * The connection to the server
  +     */
       private Connection connection;
   
       /**
  -      * The client that manages interactions with the server
  -      */
  +     * The client that manages interactions with the server
  +     */
       private Client client;
   
       /**
  -      * The global options being used. GlobalOptions are only global for a
  -      * particular command.
  -      */
  +     * The global options being used. GlobalOptions are only global for a
  +     * particular command.
  +     */
       private GlobalOptions globalOptions;
   
       /**
  -      * Execute a configured CVS command
  -      * 
  -      * @param command the command to execute
  -      * @throws CommandException if there is an error running the command
  -      */
  +     * Execute a configured CVS command
  +     * 
  +     * @param command the command to execute
  +     * @throws CommandException if there is an error running the command
  +     */
       public void executeCommand(Command command)
           throws CommandException, AuthenticationException
       {
  @@ -106,8 +106,8 @@
       }
   
       /**
  -      * Creates the connection and the client and connects.
  -      */
  +     * Creates the connection and the client and connects.
  +     */
       private void connect(CVSRoot root, String password)
           throws IllegalArgumentException, AuthenticationException, 
CommandAbortedException
       {
  @@ -132,11 +132,11 @@
       }
   
       /**
  -      * Obtain the CVS root, either from the -D option cvs.root or from the CVS
  -      * directory
  -      * 
  -      * @return the CVSRoot string
  -      */
  +     * Obtain the CVS root, either from the -D option cvs.root or from the CVS
  +     * directory
  +     * 
  +     * @return the CVSRoot string
  +     */
       private static String getCVSRoot(String workingDir)
       {
           String root = null;
  @@ -181,12 +181,12 @@
       }
   
       /**
  -      * Process global options passed into the application
  -      * 
  -      * @param args the argument list, complete
  -      * @param globalOptions the global options structure that will be passed to
  -      *            the command
  -      */
  +     * Process global options passed into the application
  +     * 
  +     * @param args the argument list, complete
  +     * @param globalOptions the global options structure that will be passed to
  +     *            the command
  +     */
       private static int processGlobalOptions(
           String[] args,
           GlobalOptions globalOptions)
  @@ -209,12 +209,12 @@
       }
   
       /**
  -      * Lookup the password in the .cvspass file. This file is looked for in the
  -      * user.home directory if the option cvs.passfile is not set
  -      * 
  -      * @param CVSRoot the CVS root for which the password is being searched
  -      * @return the password, scrambled
  -      */
  +     * Lookup the password in the .cvspass file. This file is looked for in the
  +     * user.home directory if the option cvs.passfile is not set
  +     * 
  +     * @param CVSRoot the CVS root for which the password is being searched
  +     * @return the password, scrambled
  +     */
       private static String lookupPassword(String cvsRoot)
       {
           File passFile =
  @@ -228,24 +228,22 @@
   
           try
           {
  -             StringBuffer cvsroot = new StringBuffer();
  -             
               reader = new BufferedReader(new FileReader(passFile));
               String line;
               while ((line = reader.readLine()) != null)
               {
  -             if (line.startsWith("/"))
  -             {
  -                     Vector cvspass = StringUtils.split(line, ' ');
  -                     if (cvspass.size() >= 3)
  -                     {
  -                             if (compareCvsRoot(cvsRoot, (String)cvspass.get(1))) {
  -                                     password = (String)cvspass.get(2);
  -                                     break;
  -                             }
  -                     }
  -             }
  -             else if (line.startsWith(cvsRoot))
  +                if (line.startsWith("/"))
  +                {
  +                    Vector cvspass = StringUtils.split(line, ' ');
  +                    if (cvspass.size() >= 3)
  +                    {
  +                        if (compareCvsRoot(cvsRoot, (String)cvspass.get(1))) {
  +                            password = (String)cvspass.get(2);
  +                            break;
  +                        }
  +                    }
  +                }
  +                else if (line.startsWith(cvsRoot))
                   {
                       password = line.substring(cvsRoot.length() + 1);
                       break;
  @@ -280,43 +278,43 @@
   
       static boolean compareCvsRoot(String cvsRoot, String target)
       {
  -     String s1 = completeCvsRootPort(cvsRoot);
  -     String s2 = completeCvsRootPort(target);
  -     if (s1 != null && s1.equals(s2))
  -     {
  -             return true;
  -     }
  -     return false;
  -     
  +        String s1 = completeCvsRootPort(cvsRoot);
  +        String s2 = completeCvsRootPort(target);
  +        if (s1 != null && s1.equals(s2))
  +        {
  +            return true;
  +        }
  +        return false;
  +        
       }
       
       private static String completeCvsRootPort(String cvsRoot)
       {
  -     String result = cvsRoot;
  -     int idx = cvsRoot.indexOf(':');
  -     for (int i=0; i < 2 && idx != -1; i++)
  -     {
  -             idx = cvsRoot.indexOf(':', idx+1);
  -     }
  -     if (idx != -1 && cvsRoot.charAt(idx+1) == '/') 
  -     {
  -             StringBuffer sb = new StringBuffer();
  -             sb.append(cvsRoot.substring(0, idx+1));
  -             sb.append("2401");
  -             sb.append(cvsRoot.substring(idx+1));
  -             result = sb.toString();
  -     }
  -     return result;
  +        String result = cvsRoot;
  +        int idx = cvsRoot.indexOf(':');
  +        for (int i=0; i < 2 && idx != -1; i++)
  +        {
  +            idx = cvsRoot.indexOf(':', idx+1);
  +        }
  +        if (idx != -1 && cvsRoot.charAt(idx+1) == '/') 
  +        {
  +            StringBuffer sb = new StringBuffer();
  +            sb.append(cvsRoot.substring(0, idx+1));
  +            sb.append("2401");
  +            sb.append(cvsRoot.substring(idx+1));
  +            result = sb.toString();
  +        }
  +        return result;
   
       }
       
       /**
  -      * Process the CVS command passed in args[] array with all necessary
  -      * options. The only difference from main() method is, that this method
  -      * does not exit the JVM and provides command output.
  -      * 
  -      * @param args The command with options
  -      */
  +     * Process the CVS command passed in args[] array with all necessary
  +     * options. The only difference from main() method is, that this method
  +     * does not exit the JVM and provides command output.
  +     * 
  +     * @param args The command with options
  +     */
       public static boolean processCommand(
           String[] args,
           String localPath,
  
  
  

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

Reply via email to