ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sbaill...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/pvcs Pvcs.java
Date Tue, 08 Jan 2002 22:33:08 GMT
sbailliez    02/01/08 14:33:08

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional/pvcs
                        Pvcs.java
  Log:
  Fix bad coding style.
  then/else parts of if statement and loop body must always been enclosed
  in a block statement.
  
  Revision  Changes    Path
  1.6       +27 -16    jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java
  
  Index: Pvcs.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/pvcs/Pvcs.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Pvcs.java	22 Nov 2001 08:46:55 -0000	1.5
  +++ Pvcs.java	8 Jan 2002 22:33:07 -0000	1.6
  @@ -143,11 +143,13 @@
   
       private String getExecutable(String exe) {
           StringBuffer correctedExe = new StringBuffer();
  -        if(getPvcsbin()!=null)
  -            if(pvcsbin.endsWith(File.separator))
  +        if(getPvcsbin()!=null) {
  +            if(pvcsbin.endsWith(File.separator)) {
                   correctedExe.append(pvcsbin);
  -            else
  +            } else {
                   correctedExe.append(pvcsbin).append(File.separator);
  +            }
  +        }
           return correctedExe.append(exe).toString();
       }
   
  @@ -158,8 +160,9 @@
           Project aProj = getProject();
           int result = 0;
   
  -        if(repository == null || repository.trim().equals("")) 
  +        if(repository == null || repository.trim().equals("")) { 
               throw new BuildException("Required argument repository not specified");
  +        }
   
           // Check workspace exists
           // Launch PCLI listversionedfiles -z -aw
  @@ -171,22 +174,26 @@
           commandLine.createArgument().setValue("lvf");
           commandLine.createArgument().setValue("-z");
           commandLine.createArgument().setValue("-aw");
  -        if(getWorkspace()!=null)
  +        if(getWorkspace()!=null) {
               commandLine.createArgument().setValue("-sp"+getWorkspace());
  +        }
           commandLine.createArgument().setValue("-pr"+getRepository());
   
           // default pvcs project is "/"
  -        if(getPvcsproject() == null && getPvcsprojects().isEmpty())
  +        if(getPvcsproject() == null && getPvcsprojects().isEmpty()) {
               pvcsProject = "/";
  +        }
   
  -        if(getPvcsproject()!=null)
  +        if(getPvcsproject()!=null) {
               commandLine.createArgument().setValue(getPvcsproject());
  +        }
           if(!getPvcsprojects().isEmpty()) {
               Enumeration e = getPvcsprojects().elements();
               while (e.hasMoreElements()) {
                   String projectName = ((PvcsProject)e.nextElement()).getName();
  -                if (projectName == null || (projectName.trim()).equals(""))
  +                if (projectName == null || (projectName.trim()).equals("")) {
                       throw new BuildException("name is a required attribute of pvcsproject");
  +                }
                   commandLine.createArgument().setValue(projectName);
               }
           }
  @@ -204,8 +211,9 @@
                   throw new BuildException(msg, location);
               }
   
  -            if(!tmp.exists())
  +            if(!tmp.exists()) {
                   throw new BuildException("Communication between ant and pvcs failed. No
output generated from executing PVCS commandline interface \"pcli\" and \"get\"");
  +            }
   
               // Create folders in workspace
               log("Creating folders", Project.MSG_INFO);
  @@ -218,16 +226,18 @@
               commandLine.clearArgs();
               commandLine.setExecutable(getExecutable(GET_EXE));
   
  -            if(getForce()!=null && getForce().equals("yes"))
  +            if(getForce()!=null && getForce().equals("yes")) {
                   commandLine.createArgument().setValue("-Y");
  -            else
  +            } else {
                   commandLine.createArgument().setValue("-N");
  +            }
   
  -            if(getPromotiongroup()!=null)
  +            if(getPromotiongroup()!=null) {
                   commandLine.createArgument().setValue("-G"+getPromotiongroup());
  -            else {
  -                if(getLabel()!=null)
  +            } else {
  +                if(getLabel()!=null) {
                       commandLine.createArgument().setValue("-r"+getLabel());
  +                }
               }
   
               if (updateOnly) {
  @@ -419,10 +429,11 @@
        * @param repo String (yes/no)
        */
       public void setForce(String f) {
  -        if(f!=null && f.equalsIgnoreCase("yes"))
  +        if(f!=null && f.equalsIgnoreCase("yes")) {
               force="yes";
  -        else
  +        } else {
               force = "no";
  +        }
       }
   
       /**
  
  
  

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


Mime
View raw message