public void setDefault(@Nullable Long idToUseAsDefault) {
checkPermission(UserSession.get());
if (idToUseAsDefault == null) {
propertiesDao.deleteGlobalProperty(SONAR_QUALITYGATE_PROPERTY);
} else {
<BUG>QualityGateDto newDefault = getNonNull(idToUseAsDefault);
</BUG>
propertiesDao.setProperty(new PropertyDto().setKey(SONAR_QUALITYGATE_PROPERTY).setValue(newDefault.getName()));
}
}

public void setDefault(@Nullable Long idToUseAsDefault) {
checkPermission(UserSession.get());
if (idToUseAsDefault == null) {
propertiesDao.deleteGlobalProperty(SONAR_QUALITYGATE_PROPERTY);
} else {
QualityGateDto newDefault = getNonNullQgate(idToUseAsDefault);
propertiesDao.setProperty(new PropertyDto().setKey(SONAR_QUALITYGATE_PROPERTY).setValue(newDefault.getName()));
}
}
