X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Fjsite%2Fcore%2FProject.java;h=9ddada5243f140df5fb774a6578c4270f41205c9;hb=62d8078eff84dd476c3cf7c6b95b47d1438a1360;hp=d250af1a437d6c40c360767d6d49140ac91720e3;hpb=9ed381297cca35dfdab072643bdb38444cfd9779;p=jSite2.git diff --git a/src/net/pterodactylus/jsite/core/Project.java b/src/net/pterodactylus/jsite/core/Project.java index d250af1..9ddada5 100644 --- a/src/net/pterodactylus/jsite/core/Project.java +++ b/src/net/pterodactylus/jsite/core/Project.java @@ -127,7 +127,11 @@ public class Project extends AbstractBean { * The internal ID */ void setId(String id) { - this.id = id; + if (id == null) { + this.id = Hex.toHex(IdGenerator.generateId()); + } else { + this.id = id; + } } /** @@ -399,6 +403,14 @@ public class Project extends AbstractBean { fireIfPropertyChanged(PROPERTY_NODE, oldNode, node); } + /** + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return getClass().getName() + "[id=" + id + ",name=" + name + ",description=" + description + ",publicKey=" + publicKey + ",privateKey=" + privateKey + ",basePath=" + basePath + ",defaultFile=" + defaultFile + ",node=" + node + "]"; + } + // // PRIVATE METHODS //