ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/vss MSVSS.java
Date Mon, 13 Oct 2003 18:23:33 GMT
antoine     2003/10/13 11:23:33

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional/vss Tag:
                        ANT_16_BRANCH MSVSS.java
  Log:
  <vssget/> was sending a wrong command line prefix for labels -VL-Lsome.label
  this change fixes it to -VLsome.label instead
  PR: 23711
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.34.2.1  +16 -10    ant/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java
  
  Index: MSVSS.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java,v
  retrieving revision 1.34
  retrieving revision 1.34.2.1
  diff -u -r1.34 -r1.34.2.1
  --- MSVSS.java	25 Jul 2003 12:14:44 -0000	1.34
  +++ MSVSS.java	13 Oct 2003 18:23:33 -0000	1.34.2.1
  @@ -377,18 +377,24 @@
        */
       protected String getLabel() {
           if (m_Label != null && m_Label.length() > 0) {
  -            if (m_Label.length() > 31) {
  -                String label = m_Label.substring(0, 30);
  -                log("Label is longer than 31 characters, truncated to: " + label, Project.MSG_WARN);
  -                return FLAG_LABEL + label;
  -            } else {
  -                return FLAG_LABEL + m_Label;
  -            }
  +                return FLAG_LABEL + getShortLabel();
           } else {
               return "";
           }
       }
  -
  +    /**
  +     * return at most the 30 first chars of the label, logging a warning message about
the truncation
  +     * @return at most the 30 first chars of the label
  +     */
  +    private String getShortLabel() {
  +        if (m_Label !=  null && m_Label.length() > 31) {
  +            String label = m_Label.substring(0, 30);
  +            log("Label is longer than 31 characters, truncated to: " + label, Project.MSG_WARN);
  +            return label;
  +        } else {
  +            return m_Label;
  +        }
  +    }
       /**
        *  Gets the style string. "-Lbuild1"
        *
  @@ -410,9 +416,9 @@
           } else if (m_Date != null) {
               return FLAG_VERSION_DATE + m_Date;
           } else {
  -            // Use getLabel() so labels longer then 30 char are truncated
  +            // Use getShortLabel() so labels longer then 30 char are truncated
               // and the user is warned
  -            String label = getLabel();
  +            String label = getShortLabel();
               if (!label.equals("") && label != null) {
                   return FLAG_VERSION_LABEL + label;
               }
  
  
  

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


Mime
View raw message