} else {
// We need to clone the profile, otherwise the cache contents will be modifyable from the outside
final CertificateProfile cprofile = profileCache.getProfileCache(entityManager).get(Integer.valueOf(id));
try {
if (cprofile != null) {
returnval = (CertificateProfile)cprofile.clone();
}
} catch (CloneNotSupportedException e) {
LOG.error("Should never happen: ", e);
throw new RuntimeException(e);
}