From: David ‘Bombe’ Roden Date: Tue, 3 Jun 2008 06:52:25 +0000 (+0200) Subject: create id in constructor X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=a70ad571866b3c805f8a3aafbdba4dae45fd49a9;p=jSite2.git create id in constructor --- diff --git a/src/net/pterodactylus/jsite/core/Project.java b/src/net/pterodactylus/jsite/core/Project.java index 1edb933..8ad88a8 100644 --- a/src/net/pterodactylus/jsite/core/Project.java +++ b/src/net/pterodactylus/jsite/core/Project.java @@ -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;