antoine 2003/10/13 11:26:36
Modified: src/main/org/apache/tools/ant/taskdefs/optional/vss
MSVSS.java
Log:
Merge fix for PR 23711 from ANT_16_BRANCH
PR: 23711
Revision Changes Path
1.35 +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.35
diff -u -r1.34 -r1.35
--- MSVSS.java 25 Jul 2003 12:14:44 -0000 1.34
+++ MSVSS.java 13 Oct 2003 18:26:36 -0000 1.35
@@ -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
|