create id in constructor
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 3 Jun 2008 06:52:25 +0000 (08:52 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 3 Jun 2008 06:52:25 +0000 (08:52 +0200)
src/net/pterodactylus/jsite/core/Project.java

index 1edb933..8ad88a8 100644 (file)
@@ -27,7 +27,10 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import net.pterodactylus.jsite.core.Node;
+import net.pterodactylus.jsite.util.IdGenerator;
 import net.pterodactylus.util.beans.AbstractBean;
+import net.pterodactylus.util.number.Hex;
 
 /**
  * Container for project information. A Project is capable of notifying
@@ -86,7 +89,7 @@ public class Project extends AbstractBean {
         * Creates a new project.
         */
        public Project() {
-               /* do nothing. */
+               id = Hex.toHex(IdGenerator.generateId());
        }
 
        /**
@@ -95,6 +98,7 @@ public class Project extends AbstractBean {
         * @param project
         */
        Project(Project project) {
+               this();
                this.name = project.name;
                this.description = project.description;
                this.publicKey = project.publicKey;