incubator-depot-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nickcha...@apache.org
Subject svn commit: rev 20189 - incubator/depot/trunk/version/src/java/org/apache/depot/version/impl
Date Fri, 21 May 2004 07:49:04 GMT
Author: nickchalko
Date: Fri May 21 00:49:03 2004
New Revision: 20189

Modified:
   incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/ApacheVersion.java
Log:
Use the VersionFormat class.

Modified: incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/ApacheVersion.java
==============================================================================
--- incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/ApacheVersion.java
(original)
+++ incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/ApacheVersion.java
Fri May 21 00:49:03 2004
@@ -37,7 +37,9 @@
 import org.apache.depot.version.impl.data.util.VersionDataIncrementor;
 import org.apache.depot.version.specification.VersionSpecification;
 import org.apache.depot.version.specification.VersionSpecificationFactory;
+import org.apache.depot.version.specification.formatting.VersionFormat;
 import org.apache.depot.version.specification.formatting.VersionFormatException;
+import org.apache.depot.version.specification.formatting.format.ApacheVersionFormat;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
@@ -48,8 +50,9 @@
 	implements Version, CompoundVersion, Dumpable, DOMProducer, DOMConsumer {
 
 	public final static String VERSION_TAG = "version";
+	
 
-	private VersionSpecification m_specification;
+	private final VersionSpecification m_specification;
 	private VersionData m_data;
 
 	public static ApacheVersion fromVersion(Version version)
@@ -776,21 +779,8 @@
 	}
 
 	public String toString() {
-		StringBuffer buffer = new StringBuffer();
-
-		if (null != m_data) {
-			if (buffer.length() > 0)
-				buffer.append("|");
-			buffer.append(m_data.toString());
-		}
-
-		//if (null != m_specification) {
-		//    if (buffer.length() > 0)
-		//        buffer.append("|");
-		//
-		//          buffer.append(m_specification.toString());
-		//    }
-		return buffer.toString();
+		// TODO handle this in a parent class.
+		return m_specification.getVersionFormat().toVersionString(getVersionData());
 	}
 
 	public void dump(PrintWriter out, int depth, boolean verbose) {

Mime
View raw message