You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by co...@apache.org on 2003/07/09 16:44:16 UTC

cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/starteam StarTeamCheckin.java StarTeamCheckout.java StarTeamLabel.java StarTeamList.java StarTeamTask.java TreeBasedTask.java

conor       2003/07/09 07:44:16

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional/starteam
                        StarTeamCheckin.java StarTeamCheckout.java
                        StarTeamLabel.java StarTeamList.java
                        StarTeamTask.java TreeBasedTask.java
  Log:
  Checkstyle
  
  Revision  Changes    Path
  1.13      +43 -48    ant/src/main/org/apache/tools/ant/taskdefs/optional/starteam/StarTeamCheckin.java
  
  Index: StarTeamCheckin.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/starteam/StarTeamCheckin.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -w -u -r1.12 -r1.13
  --- StarTeamCheckin.java	22 Apr 2003 07:35:16 -0000	1.12
  +++ StarTeamCheckin.java	9 Jul 2003 14:44:16 -0000	1.13
  @@ -191,8 +191,7 @@
        * (whether specified by the user or not).
        */
       protected void logOperationDescription(
  -        Folder starteamrootFolder, java.io.File targetrootFolder) 
  -    {
  +        Folder starteamrootFolder, java.io.File targetrootFolder) {
           log((this.isRecursive() ? "Recursive" : "Non-recursive")
               +" Checkin from" 
               + (null == getRootLocalFolder() ? " (default): " : ": ") 
  @@ -204,16 +203,16 @@
   
           if (this.lockStatus == Item.LockType.UNLOCKED) {
               log("  Items will be checked in unlocked.");
  -        } 
  -        else {
  +        } else {
               log("  Items will be checked in with no change in lock status.");
           }
   
           if (this.isForced()) {
  -            log("  Items will be checked in in accordance with repository status and regardless of lock status.");
  -        } 
  -        else {
  -            log("  Items will be checked in regardless of repository status only if locked." );
  +            log("  Items will be checked in in accordance with repository "
  +                + "status and regardless of lock status.");
  +        } else {
  +            log("  Items will be checked in regardless of repository status "
  +                + "only if locked.");
           }
   
   
  @@ -225,12 +224,11 @@
        *
        * @param starteamFolder the StarTeam folder to which files
        *                       will be checked in
  -     * @param localFolder local folder from which files will be checked in
  +     * @param targetFolder local folder from which files will be checked in
        * @exception BuildException if any error occurs
        */
       protected void visit(Folder starteamFolder, java.io.File targetFolder)
  -            throws BuildException 
  -    {
  +            throws BuildException {
           try {
               if (null != getRootLocalFolder()) {
                   starteamFolder.setAlternatePathFragment(
  @@ -289,8 +287,7 @@
        * 
        * @return a string showing from and to full paths
        */
  -    private String describeCheckin(com.starbase.starteam.File remotefile)
  -    {
  +    private String describeCheckin(com.starbase.starteam.File remotefile) {
           StringBuffer sb = new StringBuffer();
           sb.append(remotefile.getFullName())
             .append(" --> ")
  @@ -328,18 +325,16 @@
   
           if (fileStatus == Status.MODIFIED) {
               log("Checking in: " + describeCheckin(eachFile));
  -        } 
  -        else if (fileStatus == Status.MISSING) {
  +        } else if (fileStatus == Status.MISSING) {
               log("Local file missing: " + describeCheckin(eachFile));
               checkin = false;
  -        }
  -        else {
  +        } else {
               if (isForced()) {
  -                log("Forced checkin of " + describeCheckin(eachFile) + 
  -                    " over status " + Status.name(fileStatus));
  +                log("Forced checkin of " + describeCheckin(eachFile)
  +                    + " over status " + Status.name(fileStatus));
               } else {
  -                log("Skipping: " + getFullRepositoryPath(eachFile) + 
  -                    " - status: " + Status.name(fileStatus));
  +                log("Skipping: " + getFullRepositoryPath(eachFile)
  +                    + " - status: " + Status.name(fileStatus));
                   checkin = false;
               }
           }
  
  
  
  1.19      +87 -100   ant/src/main/org/apache/tools/ant/taskdefs/optional/starteam/StarTeamCheckout.java
  
  Index: StarTeamCheckout.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/starteam/StarTeamCheckout.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -w -u -r1.18 -r1.19
  --- StarTeamCheckout.java	2 May 2003 08:18:36 -0000	1.18
  +++ StarTeamCheckout.java	9 Jul 2003 14:44:16 -0000	1.19
  @@ -59,6 +59,7 @@
   import com.starbase.starteam.View;
   import com.starbase.starteam.ViewConfiguration;
   import java.io.IOException;
  +import java.io.File;
   import java.util.Enumeration;
   import java.util.Hashtable;
   import org.apache.tools.ant.BuildException;
  @@ -203,8 +204,7 @@
        *               false means the checked out files will be timestamped at the time
        *               of checkout.
        */
  -    public void setUseRepositoryTimeStamp(boolean useRepositoryTimeStamp)
  -    {
  +    public void setUseRepositoryTimeStamp(boolean useRepositoryTimeStamp) {
           this.useRepositoryTimeStamp = useRepositoryTimeStamp;
       }
   
  @@ -227,9 +227,7 @@
        * @return the snapshot <code>View</code> appropriately configured.
        * @exception BuildException
        */
  -    protected View createSnapshotView(View raw) 
  -    throws BuildException
  -    {
  +    protected View createSnapshotView(View raw) throws BuildException {
   
           int labelID = getLabelID(raw);
   
  @@ -258,8 +256,8 @@
        */
       protected void testPreconditions() throws BuildException {
           if (this.isUsingRevisionLabel() && this.createDirs) {
  -            log("Ignoring createworkingdirs while using a revision label." +
  -                "  Folders will be created only as needed.",
  +            log("Ignoring createworkingdirs while using a revision label."
  +                + "  Folders will be created only as needed.",
                   Project.MSG_WARN);
               this.createDirs=false;
           }
  @@ -277,10 +275,9 @@
        */
   
       protected void logOperationDescription(
  -        Folder starteamrootFolder, java.io.File targetrootFolder)
  -    {
  -        log((this.isRecursive() ? "Recursive" : "Non-recursive") + 
  -            " Checkout from: " + starteamrootFolder.getFolderHierarchy());
  +        Folder starteamrootFolder, java.io.File targetrootFolder) {
  +        log((this.isRecursive() ? "Recursive" : "Non-recursive")
  +            + " Checkout from: " + starteamrootFolder.getFolderHierarchy());
   
           log("  Checking out to" 
               + (null == getRootLocalFolder() ? "(default): " : ": ") 
  @@ -293,30 +290,26 @@
   
           if (this.lockStatus == Item.LockType.EXCLUSIVE) {
               log("  Items will be checked out with Exclusive locks.");
  -        }
  -        else if (this.lockStatus == Item.LockType.UNLOCKED) {
  +        } else if (this.lockStatus == Item.LockType.UNLOCKED) {
               log("  Items will be checked out unlocked "
                    +"(even if presently locked).");
  -        } 
  -        else {
  +        } else {
               log("  Items will be checked out with no change in lock status.");
           }
  -        log("  Items will be checked out with " + 
  -            (this.useRepositoryTimeStamp ? "repository timestamps."  
  +        log("  Items will be checked out with "
  +            + (this.useRepositoryTimeStamp ? "repository timestamps."
                                           : "the current timestamp."));
  -        log("  Items will be checked out " +
  -            (this.isForced() ? "regardless of" : "in accordance with") +
  +        log("  Items will be checked out "
  +            + (this.isForced() ? "regardless of" : "in accordance with") +
               " repository status.");
           if (this.deleteUncontrolled) {
               log("  Local items not found in the repository will be deleted.");
           }
  -        log("  Items will be checked out " +
  -            (this.convertEOL 
  -             ? "using the local machine's EOL convention"
  +        log("  Items will be checked out "
  +            + (this.convertEOL ? "using the local machine's EOL convention"
                : "without changing the EOL convention used on the server"));
  -        log("  Directories will be created"+
  -            (this.createDirs 
  -             ? " wherever they exist in the repository, even if empty." 
  +        log("  Directories will be created"
  +            + (this.createDirs ? " wherever they exist in the repository, even if empty."
                : " only where needed to check out files."));
           
       }
  @@ -330,8 +323,7 @@
        * @exception BuildException if any error occurs
        */
       protected void visit(Folder starteamFolder, java.io.File targetFolder)
  -            throws BuildException 
  -    {  
  +            throws BuildException {
           try {
   
   
  @@ -373,9 +365,9 @@
                   s = foundIds.length;
                   Item[] labeledFiles = new Item[s];
                   for (int i=0; i < s; i++) {
  -                    Integer ID = new Integer(foundIds[i]);
  +                    Integer id = new Integer(foundIds[i]);
                       labeledFiles[i] = 
  -                        filesList[((Integer) labelItems.get(ID)).intValue()];
  +                        filesList[((Integer) labelItems.get(id)).intValue()];
                   }
                   filesList = labeledFiles;
               }
  @@ -430,8 +422,7 @@
        * @return a string showing from and to full paths
        */
       private String describeCheckout(com.starbase.starteam.File remotefile,
  -                                    java.io.File localFile)
  -    {
  +                                    java.io.File localFile) {
           StringBuffer sb = new StringBuffer();
           sb.append(getFullRepositoryPath(remotefile))
             .append(" --> ");
  @@ -453,9 +444,8 @@
        * @throws IOException when StarTeam API fails to work with files
        */
       private void processFile(com.starbase.starteam.File eachFile, 
  -                             java.io.File targetFolder )
  -    throws IOException 
  -    {
  +                             File targetFolder)
  +    throws IOException {
           String filename = eachFile.getName();
   
           java.io.File localFile = new java.io.File(targetFolder, filename);
  @@ -486,8 +476,7 @@
               if (success) {
                   log("Checked out " + describeCheckout(eachFile, localFile));
               }
  -        }
  -        else {
  +        } else {
               boolean checkout = true;
   
               // Just a note: StarTeam has a status for NEW which implies
  @@ -506,15 +495,14 @@
               // We try to update the status once to give StarTeam
               // another chance.
   
  -            if (fileStatus == Status.MERGE || 
  -                fileStatus == Status.UNKNOWN) 
  -            {
  +            if (fileStatus == Status.MERGE
  +                || fileStatus == Status.UNKNOWN) {
                   eachFile.updateStatus(true, true);
                   fileStatus = (eachFile.getStatus());
               }
   
  -            log(eachFile.toString() + " has status of " + 
  -                Status.name(fileStatus), Project.MSG_DEBUG);
  +            log(eachFile.toString() + " has status of "
  +                + Status.name(fileStatus), Project.MSG_DEBUG);
   
   
               switch (fileStatus) {
  @@ -528,8 +516,8 @@
                           + describeCheckout(eachFile) 
                           + " over status " + Status.name(fileStatus));
                   } else {
  -                    log("Skipping: " + getFullRepositoryPath(eachFile) + 
  -                        " - status: " + Status.name(fileStatus));
  +                    log("Skipping: " + getFullRepositoryPath(eachFile)
  +                        + " - status: " + Status.name(fileStatus));
                       checkout = false;
                   }
               }
  @@ -582,8 +570,7 @@
       
                   if (localFile.isDirectory()) {
                       this.put(localFile, "");
  -                } 
  -                else {
  +                } else {
                       this.put(localFile, "");
                   }
               }
  
  
  
  1.16      +23 -26    ant/src/main/org/apache/tools/ant/taskdefs/optional/starteam/StarTeamLabel.java
  
  Index: StarTeamLabel.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/starteam/StarTeamLabel.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -w -u -r1.15 -r1.16
  --- StarTeamLabel.java	22 Apr 2003 07:35:16 -0000	1.15
  +++ StarTeamLabel.java	9 Jul 2003 14:44:16 -0000	1.16
  @@ -133,7 +133,7 @@
        * set the type of label based on the supplied value - if true, this 
        * label will be a revision label, if false, a build label.
        * 
  -     * @param revision If true this will be a revision label; if false, 
  +     * @param buildlabel If true this will be a revision label; if false,
        * a build label
        */
       public void setBuildLabel( boolean buildlabel ) {
  @@ -144,7 +144,7 @@
        * set the type of label based on the supplied value - if true, this 
        * label will be a revision label, if false, a build label.
        * 
  -     * @param revision If true this will be a revision label; if false, 
  +     * @param revisionlabel If true this will be a revision label; if false,
        * a build label
        */
       public void setRevisionLabel( boolean revisionlabel ) {
  @@ -162,8 +162,8 @@
               Date lastBuildTime = DATE_FORMAT.parse(lastbuild);
               this.lastBuild = new OLEDate(lastBuildTime);
           } catch (ParseException e) {
  -            throw new BuildException("Unable to parse the date '" + 
  -                                     lastbuild + "'", e);
  +            throw new BuildException("Unable to parse the date '"
  +                + lastbuild + "'", e);
           }
       }
   
  @@ -175,9 +175,8 @@
       public void execute() throws BuildException {
   
           if (this.revisionlabel && this.buildlabel) {
  -            throw new BuildException(
  -                "'revisionlabel' and 'buildlabel' both specified.  " +
  -                "A revision label cannot be a build label.");
  +            throw new BuildException("'revisionlabel' and 'buildlabel' "
  +                + "both specified.  A revision label cannot be a build label.");
           }
   
           View snapshot = openView();
  @@ -187,15 +186,13 @@
           if (this.revisionlabel) {
               new Label(snapshot, this.labelName, this.description).update();
               log("Created Revision Label " + this.labelName);
  -        } 
  -        else if (null != lastBuild){
  +        } else if (null != lastBuild) {
               new Label(snapshot, this.labelName, this.description,this.lastBuild,
                         this.buildlabel).update();
               log("Created View Label (" 
                   +(this.buildlabel ? "" : "non-") + "build) " + this.labelName
                   +" as of " + this.lastBuild.toString());
  -        }
  -        else {
  +        } else {
               new Label(snapshot, this.labelName, this.description,
                         this.buildlabel).update();
               log("Created View Label (" 
  
  
  
  1.13      +22 -27    ant/src/main/org/apache/tools/ant/taskdefs/optional/starteam/StarTeamList.java
  
  Index: StarTeamList.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/starteam/StarTeamList.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -w -u -r1.12 -r1.13
  --- StarTeamList.java	22 Apr 2003 07:35:16 -0000	1.12
  +++ StarTeamList.java	9 Jul 2003 14:44:16 -0000	1.13
  @@ -130,8 +130,8 @@
        *               root local folder for the operation (whether specified by the user or not.
        */
       protected void logOperationDescription(Folder starteamrootFolder, java.io.File targetrootFolder) {
  -        log((this.isRecursive() ? "Recursive" : "Non-recursive") + 
  -            " Listing of: " + starteamrootFolder.getFolderHierarchy());
  +        log((this.isRecursive() ? "Recursive" : "Non-recursive")
  +            + " Listing of: " + starteamrootFolder.getFolderHierarchy());
   
           log("Listing against local folder" 
               + (null == getRootLocalFolder() ? " (default): " : ": ") 
  @@ -167,10 +167,9 @@
                       targetFolder.getAbsoluteFile(), starteamFolder);
   
               log("");
  -            log("Listing StarTeam folder " + 
  -                starteamFolder.getFolderHierarchy()); 
  -            log(" against local folder " + 
  -                targetFolder.getAbsolutePath());
  +            log("Listing StarTeam folder "
  +                + starteamFolder.getFolderHierarchy());
  +            log(" against local folder " + targetFolder.getAbsolutePath());
   
   
               // For all Files in this folder, we need to check
  @@ -313,11 +312,7 @@
                   }
               }
           }
  -
  -
       }
  -
  -
  -}// StarTeamList
  +}
   
   
  
  
  
  1.11      +12 -13    ant/src/main/org/apache/tools/ant/taskdefs/optional/starteam/StarTeamTask.java
  
  Index: StarTeamTask.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/starteam/StarTeamTask.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -w -u -r1.10 -r1.11
  --- StarTeamTask.java	10 Feb 2003 14:14:27 -0000	1.10
  +++ StarTeamTask.java	9 Jul 2003 14:44:16 -0000	1.11
  @@ -116,8 +116,8 @@
       private Server server = null;
   
       private void logStarteamVersion() {
  -        log("StarTeam version: "+ 
  -            BuildNumber.getDisplayString(), Project.MSG_DEBUG);
  +        log("StarTeam version: "
  +            + BuildNumber.getDisplayString(), Project.MSG_DEBUG);
       }
   
   
  @@ -191,7 +191,7 @@
        * set the name of the StarTeam view to be acted on;
        * required if <tt>URL</tt> is not set.
        *
  -     * @param projectname the name of the StarTeam view to be acted on
  +     * @param viewname the name of the StarTeam view to be acted on
        * @see #setURL(String)
        */
       public final void setViewname(String viewname) {
  @@ -256,11 +256,10 @@
        * @see #getViewname()
        */
       public final String getURL() {
  -        return
  -                this.servername + ":" +
  -                this.serverport + "/" +
  -                this.projectname + "/" +
  -                ((null == this.viewname) ? "" : this.viewname);
  +        return this.servername + ":"
  +            + this.serverport + "/"
  +            + this.projectname + "/"
  +            + ((null == this.viewname) ? "" : this.viewname);
       }
   
       /**
  @@ -358,8 +357,8 @@
           }
   
           if (null == view) {
  -            throw new BuildException("Cannot find view" + getURL() +
  -                    " in repository()");
  +            throw new BuildException("Cannot find view" + getURL()
  +                + " in repository()");
           }
   
           View snapshot = createSnapshotView(view);
  
  
  
  1.19      +78 -89    ant/src/main/org/apache/tools/ant/taskdefs/optional/starteam/TreeBasedTask.java
  
  Index: TreeBasedTask.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/starteam/TreeBasedTask.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -w -u -r1.18 -r1.19
  --- TreeBasedTask.java	21 Apr 2003 01:08:17 -0000	1.18
  +++ TreeBasedTask.java	9 Jul 2003 14:44:16 -0000	1.19
  @@ -390,8 +390,7 @@
        * @return  true if a label has been specified and it is a view label
        */
       protected boolean isUsingViewLabel() {
  -        return null != this.labelInUse && 
  -            this.labelInUse.isViewLabel();
  +        return null != this.labelInUse && this.labelInUse.isViewLabel();
       }
       /**
        *  returns true if a label has been specified and it is a revision label.
  @@ -399,8 +398,7 @@
        * @return  true if a label has been specified and it is a revision label
        */
       protected boolean isUsingRevisionLabel() {
  -        return null != this.labelInUse && 
  -            this.labelInUse.isRevisionLabel();
  +        return null != this.labelInUse && this.labelInUse.isRevisionLabel();
       }
   
       /**
  @@ -418,8 +416,7 @@
       protected void logLabel() {
           if (this.isUsingViewLabel()) {
               log("  Using view label " + getLabel());
  -        }
  -        else if (this.isUsingRevisionLabel()) {
  +        } else if (this.isUsingRevisionLabel()) {
               log("  Using revision label " + getLabel());
           }
       }
  @@ -475,8 +472,7 @@
        *                   if the root folder cannot be found in the repository
        */
       private final Folder configureRootStarteamFolder() 
  -        throws BuildException 
  -    {
  +        throws BuildException {
           Folder starteamrootfolder = null;
           try {
               // no root local mapping has been specified.
  @@ -502,21 +498,17 @@
               }
   
   
  -        } 
  -        catch (BuildException e) {
  +        } catch (BuildException e) {
               throw e;
  -        }
  -        catch (Exception e) {
  -            throw new BuildException(
  -                "Unable to find root folder " + this.rootStarteamFolder + 
  -                " in repository at " + getURL(), e);
  +        } catch (Exception e) {
  +            throw new BuildException("Unable to find root folder "
  +                + this.rootStarteamFolder + " in repository at " + getURL(), e);
   
           }
   
           if (null == starteamrootfolder) {
  -            throw new BuildException(
  -                "Unable to find root folder " + this.rootStarteamFolder + 
  -                " in repository at " + getURL());
  +            throw new BuildException("Unable to find root folder "
  +                + this.rootStarteamFolder + " in repository at " + getURL());
           }  
           
           return starteamrootfolder;
  @@ -541,8 +533,7 @@
           String localrootfolder;
           if (null != this.rootLocalFolder) {
               localrootfolder = rootLocalFolder;
  -        }
  -        else  {
  +        } else  {
               // either use default path or root local mapping,
               // which is now embedded in the root folder
               localrootfolder = starteamrootfolder.getPathFragment();
  @@ -682,8 +673,7 @@
        * @return the full repository path name of a file.
        */
       public static String getFullRepositoryPath(
  -        com.starbase.starteam.File remotefile)
  -    {
  +        com.starbase.starteam.File remotefile) {
           StringBuffer sb = new StringBuffer();
           sb.append(remotefile.getParentFolderHierarchy())
             .append(remotefile.getName());
  @@ -736,8 +726,7 @@
       
                   if (localFile.isDirectory()) {
                       this.put(localFile, new Folder( remoteFolder, fn, fn));
  -                } 
  -                else {
  +                } else {
                       com.starbase.starteam.File remoteFile = 
                           new com.starbase.starteam.File(remoteFolder);
                       remoteFile.setName(fn);
  @@ -754,8 +743,8 @@
            */
           void removeControlledItem(java.io.File localFile) {
               if (isActive()) {
  -                log("removing processed " + localFile.getAbsoluteFile() + 
  -                    " from UnmatchedFileMap", Project.MSG_DEBUG);
  +                log("removing processed " + localFile.getAbsoluteFile()
  +                    + " from UnmatchedFileMap", Project.MSG_DEBUG);
                   this.remove(localFile.getAbsoluteFile());
               }
           }
  @@ -775,7 +764,7 @@
            * 
            * @return True if this object is to perform its functionality.
            */
  -        abstract protected boolean isActive();
  +        protected abstract boolean isActive();
       
       }
   
  
  
  

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