X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2Forg%2Fcacert%2Fgigi%2FdbObjects%2FDomain.java;h=3685de1b37fb2c68e77a76697d317730a9735be7;hb=61f103133741ad8b9b45d03d89bbdc09a61bbfef;hp=b481e76fe5868bb3c09a15616bdc2e6a22c95d4a;hpb=76e3ad5851967bea57005ec9858625d4a7071d7c;p=gigi.git diff --git a/src/org/cacert/gigi/dbObjects/Domain.java b/src/org/cacert/gigi/dbObjects/Domain.java index b481e76f..3685de1b 100644 --- a/src/org/cacert/gigi/dbObjects/Domain.java +++ b/src/org/cacert/gigi/dbObjects/Domain.java @@ -15,15 +15,15 @@ public class Domain implements IdCachable { public class DomainPingExecution { - String state; + private String state; - String type; + private String type; - String info; + private String info; - String result; + private String result; - DomainPingConfiguration config; + private DomainPingConfiguration config; public DomainPingExecution(ResultSet rs) throws SQLException { state = rs.getString(1); @@ -134,6 +134,7 @@ public class Domain implements IdCachable { return owner; } + @Override public int getId() { return id; } @@ -221,13 +222,11 @@ public class Domain implements IdCachable { private static ObjectCache myCache = new ObjectCache<>(); - public static Domain getById(int id) throws IllegalArgumentException { + public static synchronized Domain getById(int id) throws IllegalArgumentException { Domain em = myCache.get(id); if (em == null) { try { - synchronized (Domain.class) { - myCache.put(em = new Domain(id)); - } + myCache.put(em = new Domain(id)); } catch (SQLException e1) { throw new IllegalArgumentException(e1); }