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 30834 - incubator/depot/trunk/update/src/java/org/apache/depot/update/version
Date Wed, 28 Jul 2004 08:04:29 GMT
Author: nickchalko
Date: Wed Jul 28 01:04:28 2004
New Revision: 30834

Modified:
   incubator/depot/trunk/update/src/java/org/apache/depot/update/version/VersionHelper.java
Log:
Strange errors with version helper.

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/version/VersionHelper.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/version/VersionHelper.java
(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/version/VersionHelper.java
Wed Jul 28 01:04:28 2004
@@ -14,14 +14,44 @@
  *  limitations under the License.
  */
 package org.apache.depot.update.version;
+
+import org.apache.depot.version.VersionException;
+import org.apache.depot.version.VersionManager;
 import org.apache.depot.version.VersionMarker;
+
 /**
  * Static method for getting a version Marker for this project.
- * 
+ *  
  */
 public class VersionHelper {
-	private static VersionMarker MARKER = VersionMarker.UNKNOWN;
+	
+	public static void main(String[] args) {
+		System.out.print(VersionHelper.getMarker().getLongVersion());
+	}
+	
+	private final static VersionHelper INSTANCE = new VersionHelper();
+
+	private final Version version = new Version();
+
+	private final VersionMarker MARKER;
+
+	private VersionHelper() {
+		VersionMarker temp = VersionMarker.UNKNOWN;
+		try {
+
+			temp = VersionManager.getManager().createVersionMarker(
+					"org.apache.depot.update",
+					version.getMajor() + "." + version.getMinor() + "."
+							+ version.getPoint() + "-"
+							+ version.getReleaseLevel());
+		} catch (VersionException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		MARKER = temp;
+	}
+
 	public static VersionMarker getMarker() {
-		return MARKER;
+		return INSTANCE.MARKER;
 	}
 }

Mime
View raw message