incubator-depot-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: rev 23152 - in incubator/depot/trunk/version/src/java/org/apache/depot/version: . impl specification/formatting
Date Thu, 22 Jul 2004 14:19:32 GMT
Author: ajack
Date: Thu Jul 22 07:19:32 2004
New Revision: 23152

Modified:
   incubator/depot/trunk/version/src/java/org/apache/depot/version/VersionManager.java
   incubator/depot/trunk/version/src/java/org/apache/depot/version/impl/ApacheVersion.java
   incubator/depot/trunk/version/src/java/org/apache/depot/version/specification/formatting/VersionFormat.java
Log:
Attempt to fix problem discovered by Gump since resetting that VersionData != Version.

Modified: incubator/depot/trunk/version/src/java/org/apache/depot/version/VersionManager.java
==============================================================================
--- incubator/depot/trunk/version/src/java/org/apache/depot/version/VersionManager.java	(original)
+++ incubator/depot/trunk/version/src/java/org/apache/depot/version/VersionManager.java	Thu
Jul 22 07:19:32 2004
@@ -16,36 +16,44 @@
 
 package org.apache.depot.version;
 
+import org.apache.depot.version.impl.ApacheVersion;
 import org.apache.depot.version.impl.ApacheVersionMarker;
+import org.apache.depot.version.impl.data.VersionData;
+import org.apache.depot.version.specification.VersionSpecification;
+import org.apache.depot.version.specification.VersionSpecificationFactory;
 import org.apache.depot.version.specification.formatting.VersionFormatException;
-import org.apache.depot.version.specification.formatting.VersionFormatFactory;
 
 /**
  * @author arb_jack@users.sourceforge.net
  */
 public class VersionManager {
 
-    public static final VersionManager getManager() {
-        return new VersionManager();
-    }
-
-    public final VersionMarker createVersionMarker(String id, String version)
-        throws VersionException {
-        return new ApacheVersionMarker(id, version);
-    }
+	public static final VersionManager getManager() {
+		return new VersionManager();
+	}
+
+	public final VersionMarker createVersionMarker(String id, String version)
+			throws VersionException {
+		return new ApacheVersionMarker(id, version);
+	}
 
 	/**
 	 * Create a Version object from the given string.
+	 * 
 	 * @param versionString
-	 * @return
-	 * @throws VersionFormatException
+	 * @return @throws
+	 *         VersionFormatException
 	 */
-	public Version createVersion(String versionString) throws VersionFormatException {
-		return VersionFormatFactory.createDefaultVersionFormat().parseVersion(versionString);
+	public Version createVersion(String versionString)
+			throws VersionFormatException {
+		VersionSpecification spec = VersionSpecificationFactory.createDefaultVersionSpecification();
+		VersionData data = spec.getVersionFormat().parseVersion(versionString);
+
+		return new ApacheVersion(spec, data);
 	}
 
-    // :TODO:
-    //  Stamp a version for ...
-    //  Generate code for ...
-    //  Increment ...
-}
+	// :TODO:
+	//  Stamp a version for ...
+	//  Generate code for ...
+	//  Increment ...
+}
\ No newline at end of file

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
Thu Jul 22 07:19:32 2004
@@ -50,7 +50,8 @@
 	public final static String VERSION_TAG = "version";
 	
 	public final static ApacheVersion UNKNOWN =
-		new ApacheVersion(null,VersionData.UNSET);
+		new ApacheVersion(VersionSpecificationFactory.createApacheVersionSpecification(),
+							VersionData.UNSET);
 	
 	/** The specification for this type of format */
 	private final VersionSpecification m_specification;

Modified: incubator/depot/trunk/version/src/java/org/apache/depot/version/specification/formatting/VersionFormat.java
==============================================================================
--- incubator/depot/trunk/version/src/java/org/apache/depot/version/specification/formatting/VersionFormat.java
(original)
+++ incubator/depot/trunk/version/src/java/org/apache/depot/version/specification/formatting/VersionFormat.java
Thu Jul 22 07:19:32 2004
@@ -17,6 +17,7 @@
 package org.apache.depot.version.specification.formatting;
 
 import org.apache.depot.common.util.debug.Dumpable;
+import org.apache.depot.version.Version;
 import org.apache.depot.version.impl.data.VersionData;
 
 /**

Mime
View raw message