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

cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/starteam TreeBasedTask.java

bodewig     2003/03/27 00:02:15

  Modified:    .        WHATSNEW
               src/main/org/apache/tools/ant/taskdefs/optional/starteam
                        TreeBasedTask.java
  Log:
  Make starteam checkout handle deleted labels correctly.
  
  PR: 17646
  Submitted by:	Brian Brooks <brian dot brooks at metavante dot com>
  Reviewed by:	Steve Cohen
  
  Revision  Changes    Path
  1.371     +2 -0      ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.370
  retrieving revision 1.371
  diff -u -r1.370 -r1.371
  --- WHATSNEW	25 Mar 2003 09:30:59 -0000	1.370
  +++ WHATSNEW	27 Mar 2003 08:02:15 -0000	1.371
  @@ -70,6 +70,8 @@
     StringIndexOutOfBoundsException on all OSes where os.name is shorter
     than seven characters.  Bugzilla Report 18105.
   
  +* starteam checkout can now handle deleted labels.  Bugzilla Report 17646.
  +
   Other changes:
   --------------
   * The filesetmanifest attribute of <jar> has been reenabled.
  
  
  
  1.16      +1 -1      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.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- TreeBasedTask.java	11 Feb 2003 11:57:27 -0000	1.15
  +++ TreeBasedTask.java	27 Mar 2003 08:02:15 -0000	1.16
  @@ -566,7 +566,7 @@
           for (int i = 0; i < allLabels.length; i++) {
               Label stLabel = allLabels[i];
               log("checking label " + stLabel.getName(), Project.MSG_DEBUG);
  -            if (stLabel.getName().equals(this.label)) {
  +            if (stLabel != null && !stLabel.isDeleted() && stLabel.getName().equals(this.label)) {
                   if (!stLabel.isRevisionLabel() && !stLabel.isViewLabel()) {
                       throw new BuildException("Unexpected label type.");
                   }
  
  
  

Re: cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/starteam TreeBasedTask.java

Posted by Stefan Bodewig <bo...@apache.org>.
On 27 Mar 2003, <bo...@apache.org> wrote:

>   log("checking label " + stLabel.getName(), Project.MSG_DEBUG); 
> - if (stLabel.getName().equals(this.label)) {
> + if (stLabel != null && !stLabel.isDeleted() && stLabel.getName().equals(this.label)) {

given that the log line will have thrown a NPE if the first test in
the if statement fails, it looks a bit redundant 8-)

I've kept it in anyway.

Stefan